|
@@ -2436,6 +2436,18 @@ static void intel_fb_offset_to_xy(int *x, int *y,
|
|
*x = linear_offset % pitch / cpp;
|
|
*x = linear_offset % pitch / cpp;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static unsigned int intel_fb_modifier_to_tiling(uint64_t fb_modifier)
|
|
|
|
+{
|
|
|
|
+ switch (fb_modifier) {
|
|
|
|
+ case I915_FORMAT_MOD_X_TILED:
|
|
|
|
+ return I915_TILING_X;
|
|
|
|
+ case I915_FORMAT_MOD_Y_TILED:
|
|
|
|
+ return I915_TILING_Y;
|
|
|
|
+ default:
|
|
|
|
+ return I915_TILING_NONE;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
static int
|
|
static int
|
|
intel_fill_fb_info(struct drm_i915_private *dev_priv,
|
|
intel_fill_fb_info(struct drm_i915_private *dev_priv,
|
|
struct drm_framebuffer *fb)
|
|
struct drm_framebuffer *fb)
|
|
@@ -2834,7 +2846,8 @@ static void i9xx_update_primary_plane(struct drm_plane *primary,
|
|
BUG();
|
|
BUG();
|
|
}
|
|
}
|
|
|
|
|
|
- if (INTEL_INFO(dev)->gen >= 4 && i915_gem_object_is_tiled(obj))
|
|
|
|
|
|
+ if (INTEL_GEN(dev_priv) >= 4 &&
|
|
|
|
+ fb->modifier[0] == I915_FORMAT_MOD_X_TILED)
|
|
dspcntr |= DISPPLANE_TILED;
|
|
dspcntr |= DISPPLANE_TILED;
|
|
|
|
|
|
if (IS_G4X(dev))
|
|
if (IS_G4X(dev))
|
|
@@ -2899,7 +2912,6 @@ static void ironlake_update_primary_plane(struct drm_plane *primary,
|
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
|
struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->base.crtc);
|
|
struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->base.crtc);
|
|
struct drm_framebuffer *fb = plane_state->base.fb;
|
|
struct drm_framebuffer *fb = plane_state->base.fb;
|
|
- struct drm_i915_gem_object *obj = intel_fb_obj(fb);
|
|
|
|
int plane = intel_crtc->plane;
|
|
int plane = intel_crtc->plane;
|
|
u32 linear_offset;
|
|
u32 linear_offset;
|
|
u32 dspcntr;
|
|
u32 dspcntr;
|
|
@@ -2937,7 +2949,7 @@ static void ironlake_update_primary_plane(struct drm_plane *primary,
|
|
BUG();
|
|
BUG();
|
|
}
|
|
}
|
|
|
|
|
|
- if (i915_gem_object_is_tiled(obj))
|
|
|
|
|
|
+ if (fb->modifier[0] == I915_FORMAT_MOD_X_TILED)
|
|
dspcntr |= DISPPLANE_TILED;
|
|
dspcntr |= DISPPLANE_TILED;
|
|
|
|
|
|
if (!IS_HASWELL(dev) && !IS_BROADWELL(dev))
|
|
if (!IS_HASWELL(dev) && !IS_BROADWELL(dev))
|
|
@@ -11444,7 +11456,7 @@ static int intel_gen4_queue_flip(struct drm_device *dev,
|
|
MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
|
|
MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
|
|
intel_ring_emit(ring, fb->pitches[0]);
|
|
intel_ring_emit(ring, fb->pitches[0]);
|
|
intel_ring_emit(ring, intel_crtc->flip_work->gtt_offset |
|
|
intel_ring_emit(ring, intel_crtc->flip_work->gtt_offset |
|
|
- i915_gem_object_get_tiling(obj));
|
|
|
|
|
|
+ intel_fb_modifier_to_tiling(fb->modifier[0]));
|
|
|
|
|
|
/* XXX Enabling the panel-fitter across page-flip is so far
|
|
/* XXX Enabling the panel-fitter across page-flip is so far
|
|
* untested on non-native modes, so ignore it for now.
|
|
* untested on non-native modes, so ignore it for now.
|
|
@@ -11476,7 +11488,8 @@ static int intel_gen6_queue_flip(struct drm_device *dev,
|
|
|
|
|
|
intel_ring_emit(ring, MI_DISPLAY_FLIP |
|
|
intel_ring_emit(ring, MI_DISPLAY_FLIP |
|
|
MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
|
|
MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
|
|
- intel_ring_emit(ring, fb->pitches[0] | i915_gem_object_get_tiling(obj));
|
|
|
|
|
|
+ intel_ring_emit(ring, fb->pitches[0] |
|
|
|
|
+ intel_fb_modifier_to_tiling(fb->modifier[0]));
|
|
intel_ring_emit(ring, intel_crtc->flip_work->gtt_offset);
|
|
intel_ring_emit(ring, intel_crtc->flip_work->gtt_offset);
|
|
|
|
|
|
/* Contrary to the suggestions in the documentation,
|
|
/* Contrary to the suggestions in the documentation,
|
|
@@ -11579,7 +11592,8 @@ static int intel_gen7_queue_flip(struct drm_device *dev,
|
|
}
|
|
}
|
|
|
|
|
|
intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | plane_bit);
|
|
intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | plane_bit);
|
|
- intel_ring_emit(ring, fb->pitches[0] | i915_gem_object_get_tiling(obj));
|
|
|
|
|
|
+ intel_ring_emit(ring, fb->pitches[0] |
|
|
|
|
+ intel_fb_modifier_to_tiling(fb->modifier[0]));
|
|
intel_ring_emit(ring, intel_crtc->flip_work->gtt_offset);
|
|
intel_ring_emit(ring, intel_crtc->flip_work->gtt_offset);
|
|
intel_ring_emit(ring, (MI_NOOP));
|
|
intel_ring_emit(ring, (MI_NOOP));
|
|
|
|
|
|
@@ -11664,15 +11678,13 @@ static void ilk_do_mmio_flip(struct intel_crtc *intel_crtc,
|
|
{
|
|
{
|
|
struct drm_device *dev = intel_crtc->base.dev;
|
|
struct drm_device *dev = intel_crtc->base.dev;
|
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
|
- struct intel_framebuffer *intel_fb =
|
|
|
|
- to_intel_framebuffer(intel_crtc->base.primary->fb);
|
|
|
|
- struct drm_i915_gem_object *obj = intel_fb->obj;
|
|
|
|
|
|
+ struct drm_framebuffer *fb = intel_crtc->base.primary->fb;
|
|
i915_reg_t reg = DSPCNTR(intel_crtc->plane);
|
|
i915_reg_t reg = DSPCNTR(intel_crtc->plane);
|
|
u32 dspcntr;
|
|
u32 dspcntr;
|
|
|
|
|
|
dspcntr = I915_READ(reg);
|
|
dspcntr = I915_READ(reg);
|
|
|
|
|
|
- if (i915_gem_object_is_tiled(obj))
|
|
|
|
|
|
+ if (fb->modifier[0] == I915_FORMAT_MOD_X_TILED)
|
|
dspcntr |= DISPPLANE_TILED;
|
|
dspcntr |= DISPPLANE_TILED;
|
|
else
|
|
else
|
|
dspcntr &= ~DISPPLANE_TILED;
|
|
dspcntr &= ~DISPPLANE_TILED;
|
|
@@ -11900,8 +11912,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
|
|
|
|
|
|
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) {
|
|
if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) {
|
|
engine = &dev_priv->engine[BCS];
|
|
engine = &dev_priv->engine[BCS];
|
|
- if (i915_gem_object_get_tiling(obj) !=
|
|
|
|
- i915_gem_object_get_tiling(intel_fb_obj(work->old_fb)))
|
|
|
|
|
|
+ if (fb->modifier[0] != old_fb->modifier[0])
|
|
/* vlv: DISPLAY_FLIP fails to change tiling */
|
|
/* vlv: DISPLAY_FLIP fails to change tiling */
|
|
engine = NULL;
|
|
engine = NULL;
|
|
} else if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev)) {
|
|
} else if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev)) {
|