diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-02-10 12:16:10 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-02-13 17:28:18 -0500 |
commit | 091df6cbf248811150552d51dacb9dc1fe6b0a23 (patch) | |
tree | 3a5cc00acb6bb8c40c72522d7aa9d6ae67395fed | |
parent | 18c5247e1e96d657334dabd8ab611001f16a62b0 (diff) |
drm/i915: Switch intel_fb_align_height to fb format modifiers
With this we can treat the fb format modifier completely independently
from the fencing mode in obj->tiling_mode in the initial plane code.
Which means new tiling modes without any gtt fence are now fully
support in the core i915 driver code.
v2: Also add pixel_format while at it, we need this to compute the
height for the new tiling formats.
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 20 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_fbdev.c | 3 |
3 files changed, 18 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 85274906f686..a2bb905c2372 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -2190,11 +2190,15 @@ static bool need_vtd_wa(struct drm_device *dev) | |||
2190 | } | 2190 | } |
2191 | 2191 | ||
2192 | int | 2192 | int |
2193 | intel_fb_align_height(struct drm_device *dev, int height, unsigned int tiling) | 2193 | intel_fb_align_height(struct drm_device *dev, int height, |
2194 | uint32_t pixel_format, | ||
2195 | uint64_t fb_format_modifier) | ||
2194 | { | 2196 | { |
2195 | int tile_height; | 2197 | int tile_height; |
2196 | 2198 | ||
2197 | tile_height = tiling ? (IS_GEN2(dev) ? 16 : 8) : 1; | 2199 | tile_height = fb_format_modifier == I915_FORMAT_MOD_X_TILED ? |
2200 | (IS_GEN2(dev) ? 16 : 8) : 1; | ||
2201 | |||
2198 | return ALIGN(height, tile_height); | 2202 | return ALIGN(height, tile_height); |
2199 | } | 2203 | } |
2200 | 2204 | ||
@@ -6657,7 +6661,8 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc, | |||
6657 | fb->pitches[0] = val & 0xffffffc0; | 6661 | fb->pitches[0] = val & 0xffffffc0; |
6658 | 6662 | ||
6659 | aligned_height = intel_fb_align_height(dev, fb->height, | 6663 | aligned_height = intel_fb_align_height(dev, fb->height, |
6660 | plane_config->tiling); | 6664 | fb->pixel_format, |
6665 | fb->modifier[0]); | ||
6661 | 6666 | ||
6662 | plane_config->size = PAGE_ALIGN(fb->pitches[0] * aligned_height); | 6667 | plane_config->size = PAGE_ALIGN(fb->pitches[0] * aligned_height); |
6663 | 6668 | ||
@@ -7699,7 +7704,8 @@ skylake_get_initial_plane_config(struct intel_crtc *crtc, | |||
7699 | fb->pitches[0] = (val & 0x3ff) * stride_mult; | 7704 | fb->pitches[0] = (val & 0x3ff) * stride_mult; |
7700 | 7705 | ||
7701 | aligned_height = intel_fb_align_height(dev, fb->height, | 7706 | aligned_height = intel_fb_align_height(dev, fb->height, |
7702 | plane_config->tiling); | 7707 | fb->pixel_format, |
7708 | fb->modifier[0]); | ||
7703 | 7709 | ||
7704 | plane_config->size = ALIGN(fb->pitches[0] * aligned_height, PAGE_SIZE); | 7710 | plane_config->size = ALIGN(fb->pitches[0] * aligned_height, PAGE_SIZE); |
7705 | 7711 | ||
@@ -7795,7 +7801,8 @@ ironlake_get_initial_plane_config(struct intel_crtc *crtc, | |||
7795 | fb->pitches[0] = val & 0xffffffc0; | 7801 | fb->pitches[0] = val & 0xffffffc0; |
7796 | 7802 | ||
7797 | aligned_height = intel_fb_align_height(dev, fb->height, | 7803 | aligned_height = intel_fb_align_height(dev, fb->height, |
7798 | plane_config->tiling); | 7804 | fb->pixel_format, |
7805 | fb->modifier[0]); | ||
7799 | 7806 | ||
7800 | plane_config->size = PAGE_ALIGN(fb->pitches[0] * aligned_height); | 7807 | plane_config->size = PAGE_ALIGN(fb->pitches[0] * aligned_height); |
7801 | 7808 | ||
@@ -12823,7 +12830,8 @@ static int intel_framebuffer_init(struct drm_device *dev, | |||
12823 | return -EINVAL; | 12830 | return -EINVAL; |
12824 | 12831 | ||
12825 | aligned_height = intel_fb_align_height(dev, mode_cmd->height, | 12832 | aligned_height = intel_fb_align_height(dev, mode_cmd->height, |
12826 | obj->tiling_mode); | 12833 | mode_cmd->pixel_format, |
12834 | mode_cmd->modifier[0]); | ||
12827 | /* FIXME drm helper for size checks (especially planar formats)? */ | 12835 | /* FIXME drm helper for size checks (especially planar formats)? */ |
12828 | if (obj->base.size < aligned_height * mode_cmd->pitches[0]) | 12836 | if (obj->base.size < aligned_height * mode_cmd->pitches[0]) |
12829 | return -EINVAL; | 12837 | return -EINVAL; |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 76b3c2043954..b9598ba6901c 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -879,7 +879,8 @@ void intel_frontbuffer_flip(struct drm_device *dev, | |||
879 | } | 879 | } |
880 | 880 | ||
881 | int intel_fb_align_height(struct drm_device *dev, int height, | 881 | int intel_fb_align_height(struct drm_device *dev, int height, |
882 | unsigned int tiling); | 882 | uint32_t pixel_format, |
883 | uint64_t fb_format_modifier); | ||
883 | void intel_fb_obj_flush(struct drm_i915_gem_object *obj, bool retire); | 884 | void intel_fb_obj_flush(struct drm_i915_gem_object *obj, bool retire); |
884 | 885 | ||
885 | 886 | ||
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c index 3001a8674611..234a699b8219 100644 --- a/drivers/gpu/drm/i915/intel_fbdev.c +++ b/drivers/gpu/drm/i915/intel_fbdev.c | |||
@@ -594,7 +594,8 @@ static bool intel_fbdev_init_bios(struct drm_device *dev, | |||
594 | 594 | ||
595 | cur_size = intel_crtc->config->base.adjusted_mode.crtc_vdisplay; | 595 | cur_size = intel_crtc->config->base.adjusted_mode.crtc_vdisplay; |
596 | cur_size = intel_fb_align_height(dev, cur_size, | 596 | cur_size = intel_fb_align_height(dev, cur_size, |
597 | plane_config->tiling); | 597 | fb->base.pixel_format, |
598 | fb->base.modifier[0]); | ||
598 | cur_size *= fb->base.pitches[0]; | 599 | cur_size *= fb->base.pitches[0]; |
599 | DRM_DEBUG_KMS("pipe %c area: %dx%d, bpp: %d, size: %d\n", | 600 | DRM_DEBUG_KMS("pipe %c area: %dx%d, bpp: %d, size: %d\n", |
600 | pipe_name(intel_crtc->pipe), | 601 | pipe_name(intel_crtc->pipe), |