drm/i915: Use fb modifiers for display tiling decisions
Soon the fence tiling mode may not always match the fb modifier even for X tiled buffers. So let's use the fb modifier consistently for all display tiling decisions. v2: Rebased due to s/ring/engine/ v3: Rebased due to s/engine/ring/ O_o v4: Rebase due to i915_gem_object_get_tiling() & co. Reviewed-by: Matthew Auld <matthew.auld@intel.com> (v1) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1470821001-25272-6-git-send-email-ville.syrjala@linux.intel.com
This commit is contained in:
@@ -360,7 +360,6 @@ vlv_update_plane(struct drm_plane *dplane,
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
struct intel_plane *intel_plane = to_intel_plane(dplane);
|
||||
struct drm_framebuffer *fb = plane_state->base.fb;
|
||||
struct drm_i915_gem_object *obj = intel_fb_obj(fb);
|
||||
int pipe = intel_plane->pipe;
|
||||
int plane = intel_plane->plane;
|
||||
u32 sprctl;
|
||||
@@ -427,7 +426,7 @@ vlv_update_plane(struct drm_plane *dplane,
|
||||
*/
|
||||
sprctl |= SP_GAMMA_ENABLE;
|
||||
|
||||
if (i915_gem_object_is_tiled(obj))
|
||||
if (fb->modifier[0] == I915_FORMAT_MOD_X_TILED)
|
||||
sprctl |= SP_TILED;
|
||||
|
||||
/* Sizes are 0 based */
|
||||
@@ -463,7 +462,7 @@ vlv_update_plane(struct drm_plane *dplane,
|
||||
I915_WRITE(SPSTRIDE(pipe, plane), fb->pitches[0]);
|
||||
I915_WRITE(SPPOS(pipe, plane), (crtc_y << 16) | crtc_x);
|
||||
|
||||
if (i915_gem_object_is_tiled(obj))
|
||||
if (fb->modifier[0] == I915_FORMAT_MOD_X_TILED)
|
||||
I915_WRITE(SPTILEOFF(pipe, plane), (y << 16) | x);
|
||||
else
|
||||
I915_WRITE(SPLINOFF(pipe, plane), linear_offset);
|
||||
@@ -501,7 +500,6 @@ ivb_update_plane(struct drm_plane *plane,
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
struct intel_plane *intel_plane = to_intel_plane(plane);
|
||||
struct drm_framebuffer *fb = plane_state->base.fb;
|
||||
struct drm_i915_gem_object *obj = intel_fb_obj(fb);
|
||||
enum pipe pipe = intel_plane->pipe;
|
||||
u32 sprctl, sprscale = 0;
|
||||
u32 sprsurf_offset, linear_offset;
|
||||
@@ -547,7 +545,7 @@ ivb_update_plane(struct drm_plane *plane,
|
||||
*/
|
||||
sprctl |= SPRITE_GAMMA_ENABLE;
|
||||
|
||||
if (i915_gem_object_is_tiled(obj))
|
||||
if (fb->modifier[0] == I915_FORMAT_MOD_X_TILED)
|
||||
sprctl |= SPRITE_TILED;
|
||||
|
||||
if (IS_HASWELL(dev) || IS_BROADWELL(dev))
|
||||
@@ -600,7 +598,7 @@ ivb_update_plane(struct drm_plane *plane,
|
||||
* register */
|
||||
if (IS_HASWELL(dev) || IS_BROADWELL(dev))
|
||||
I915_WRITE(SPROFFSET(pipe), (y << 16) | x);
|
||||
else if (i915_gem_object_is_tiled(obj))
|
||||
else if (fb->modifier[0] == I915_FORMAT_MOD_X_TILED)
|
||||
I915_WRITE(SPRTILEOFF(pipe), (y << 16) | x);
|
||||
else
|
||||
I915_WRITE(SPRLINOFF(pipe), linear_offset);
|
||||
@@ -640,7 +638,6 @@ ilk_update_plane(struct drm_plane *plane,
|
||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||
struct intel_plane *intel_plane = to_intel_plane(plane);
|
||||
struct drm_framebuffer *fb = plane_state->base.fb;
|
||||
struct drm_i915_gem_object *obj = intel_fb_obj(fb);
|
||||
int pipe = intel_plane->pipe;
|
||||
u32 dvscntr, dvsscale;
|
||||
u32 dvssurf_offset, linear_offset;
|
||||
@@ -686,7 +683,7 @@ ilk_update_plane(struct drm_plane *plane,
|
||||
*/
|
||||
dvscntr |= DVS_GAMMA_ENABLE;
|
||||
|
||||
if (i915_gem_object_is_tiled(obj))
|
||||
if (fb->modifier[0] == I915_FORMAT_MOD_X_TILED)
|
||||
dvscntr |= DVS_TILED;
|
||||
|
||||
if (IS_GEN6(dev))
|
||||
@@ -728,7 +725,7 @@ ilk_update_plane(struct drm_plane *plane,
|
||||
I915_WRITE(DVSSTRIDE(pipe), fb->pitches[0]);
|
||||
I915_WRITE(DVSPOS(pipe), (crtc_y << 16) | crtc_x);
|
||||
|
||||
if (i915_gem_object_is_tiled(obj))
|
||||
if (fb->modifier[0] == I915_FORMAT_MOD_X_TILED)
|
||||
I915_WRITE(DVSTILEOFF(pipe), (y << 16) | x);
|
||||
else
|
||||
I915_WRITE(DVSLINOFF(pipe), linear_offset);
|
||||
|
Reference in New Issue
Block a user