History

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.

Daniel Vetter committed 14 years ago

Commit cb05d8d1 parent b7884eb2 files · +26 −1Browse files

Unified · Split

2 files
  1. drivers/gpu/drm/i915/i915_reg.h +8 −0
  2. drivers/gpu/drm/i915/intel_display.c +18 −1
drivers/gpu/drm/i915/i915_reg.h+8−0
@@ -210,6 +210,14 @@ · 209 unmodified lines
210210 #define MI_DISPLAY_FLIP MI_INSTR(0x14, 2)
211211 #define MI_DISPLAY_FLIP_I915 MI_INSTR(0x14, 1)
212212 #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+
213221 #define MI_SET_CONTEXT MI_INSTR(0x18, 0)
214222 #define MI_MM_SPACE_GTT (1<<8)
215223 #define MI_MM_SPACE_PHYSICAL (0<<8)
drivers/gpu/drm/i915/intel_display.c+18−1
@@ -6158,17 +6158,34 @@ static int intel_gen7_queue_flip(struct drm_device *dev, · 6157 unmodified lines
61586158 struct drm_i915_private *dev_priv = dev->dev_private;
61596159 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
61606160 struct intel_ring_buffer *ring = &dev_priv->ring[BCS];
6161+ uint32_t plane_bit = 0;
61616162 int ret;
61626163
61636164 ret = intel_pin_and_fence_fb_obj(dev, obj, ring);
61646165 if (ret)
61656166 goto err;
61666167
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+
61676184 ret = intel_ring_begin(ring, 4);
61686185 if (ret)
61696186 goto err_unpin;
61706187
6171− intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | (intel_crtc->plane << 19));
6188+ intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | plane_bit);
61726189 intel_ring_emit(ring, (fb->pitches[0] | obj->tiling_mode));
61736190 intel_ring_emit(ring, (obj->gtt_offset));
61746191 intel_ring_emit(ring, (MI_NOOP));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t