diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-23 08:02:00 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-06-05 15:05:21 -0400 |
commit | cb05d8dedefa3066bf5d74ef88c6ca6cf4bd1c87 (patch) | |
tree | 583447e310a90e6e58a58e48427917ae640fab3e /drivers | |
parent | b7884eb45ec98c0d34c7f49005ae9d4b4b4e38f6 (diff) |
drm/i915: fix up ivb plane 3 pageflips
Or at least plug another gapping hole. Apparrently hw desingers only
moved the bit field, but did not bother ot re-enumerate the planes
when adding support for a 3rd pipe.
Discovered by i-g-t/flip_test.
This may or may not fix the reference bugzilla, because that one
smells like we have still larger fish to fry.
v2: Fixup the impossible case to catch programming errors, noticed by
Chris Wilson.
References: https://bugs.freedesktop.org/show_bug.cgi?id=50069
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Eugeni Dodonov <eugeni.dodonov@intel.com>
Cc: stable@vger.kernel.org
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 19 |
2 files changed, 26 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 2d49b9507ed0..76bc2756d7c4 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -210,6 +210,14 @@ | |||
210 | #define MI_DISPLAY_FLIP MI_INSTR(0x14, 2) | 210 | #define MI_DISPLAY_FLIP MI_INSTR(0x14, 2) |
211 | #define MI_DISPLAY_FLIP_I915 MI_INSTR(0x14, 1) | 211 | #define MI_DISPLAY_FLIP_I915 MI_INSTR(0x14, 1) |
212 | #define MI_DISPLAY_FLIP_PLANE(n) ((n) << 20) | 212 | #define MI_DISPLAY_FLIP_PLANE(n) ((n) << 20) |
213 | /* IVB has funny definitions for which plane to flip. */ | ||
214 | #define MI_DISPLAY_FLIP_IVB_PLANE_A (0 << 19) | ||
215 | #define MI_DISPLAY_FLIP_IVB_PLANE_B (1 << 19) | ||
216 | #define MI_DISPLAY_FLIP_IVB_SPRITE_A (2 << 19) | ||
217 | #define MI_DISPLAY_FLIP_IVB_SPRITE_B (3 << 19) | ||
218 | #define MI_DISPLAY_FLIP_IVB_PLANE_C (4 << 19) | ||
219 | #define MI_DISPLAY_FLIP_IVB_SPRITE_C (5 << 19) | ||
220 | |||
213 | #define MI_SET_CONTEXT MI_INSTR(0x18, 0) | 221 | #define MI_SET_CONTEXT MI_INSTR(0x18, 0) |
214 | #define MI_MM_SPACE_GTT (1<<8) | 222 | #define MI_MM_SPACE_GTT (1<<8) |
215 | #define MI_MM_SPACE_PHYSICAL (0<<8) | 223 | #define MI_MM_SPACE_PHYSICAL (0<<8) |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 914789420906..e0aa064def31 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -6158,17 +6158,34 @@ static int intel_gen7_queue_flip(struct drm_device *dev, | |||
6158 | struct drm_i915_private *dev_priv = dev->dev_private; | 6158 | struct drm_i915_private *dev_priv = dev->dev_private; |
6159 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 6159 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
6160 | struct intel_ring_buffer *ring = &dev_priv->ring[BCS]; | 6160 | struct intel_ring_buffer *ring = &dev_priv->ring[BCS]; |
6161 | uint32_t plane_bit = 0; | ||
6161 | int ret; | 6162 | int ret; |
6162 | 6163 | ||
6163 | ret = intel_pin_and_fence_fb_obj(dev, obj, ring); | 6164 | ret = intel_pin_and_fence_fb_obj(dev, obj, ring); |
6164 | if (ret) | 6165 | if (ret) |
6165 | goto err; | 6166 | goto err; |
6166 | 6167 | ||
6168 | switch(intel_crtc->plane) { | ||
6169 | case PLANE_A: | ||
6170 | plane_bit = MI_DISPLAY_FLIP_IVB_PLANE_A; | ||
6171 | break; | ||
6172 | case PLANE_B: | ||
6173 | plane_bit = MI_DISPLAY_FLIP_IVB_PLANE_B; | ||
6174 | break; | ||
6175 | case PLANE_C: | ||
6176 | plane_bit = MI_DISPLAY_FLIP_IVB_PLANE_C; | ||
6177 | break; | ||
6178 | default: | ||
6179 | WARN_ONCE(1, "unknown plane in flip command\n"); | ||
6180 | ret = -ENODEV; | ||
6181 | goto err; | ||
6182 | } | ||
6183 | |||
6167 | ret = intel_ring_begin(ring, 4); | 6184 | ret = intel_ring_begin(ring, 4); |
6168 | if (ret) | 6185 | if (ret) |
6169 | goto err_unpin; | 6186 | goto err_unpin; |
6170 | 6187 | ||
6171 | intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | (intel_crtc->plane << 19)); | 6188 | intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | plane_bit); |
6172 | intel_ring_emit(ring, (fb->pitches[0] | obj->tiling_mode)); | 6189 | intel_ring_emit(ring, (fb->pitches[0] | obj->tiling_mode)); |
6173 | intel_ring_emit(ring, (obj->gtt_offset)); | 6190 | intel_ring_emit(ring, (obj->gtt_offset)); |
6174 | intel_ring_emit(ring, (MI_NOOP)); | 6191 | intel_ring_emit(ring, (MI_NOOP)); |