[PATCH 03/11] drm/i915: Implement execbuffer wait for all planes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrj?l? <ville.syrjala at linux.intel.com>

Add the MI_WAIT_FOR_EVENT bits for sprites, and fix up the whole thing
for IVB which moved most of the bits around.

Not tested at all!

Signed-off-by: Ville Syrj?l? <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |   44 +++++++++++++++++++++++++--
 drivers/gpu/drm/i915/i915_reg.h            |    9 ++++++
 2 files changed, 49 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 91d43d5..2b56354 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -625,10 +625,46 @@ i915_gem_execbuffer_wait_for_flips(struct intel_ring_buffer *ring, u32 flips)
 		if (((flips >> plane) & 1) == 0)
 			continue;
 
-		if (plane)
-			flip_mask = MI_WAIT_FOR_PLANE_B_FLIP;
-		else
-			flip_mask = MI_WAIT_FOR_PLANE_A_FLIP;
+		if (IS_GEN7(ring->dev)) {
+			switch (plane) {
+			case 0:
+				flip_mask = MI_WAIT_FOR_PLANE_A_FLIP_IVB;
+				break;
+			case 1:
+				flip_mask = MI_WAIT_FOR_PLANE_B_FLIP_IVB;
+				break;
+			case 2:
+				flip_mask = MI_WAIT_FOR_PLANE_C_FLIP_IVB;
+				break;
+			case 16:
+				flip_mask = MI_WAIT_FOR_SPRITE_A_FLIP_IVB;
+				break;
+			case 17:
+				flip_mask = MI_WAIT_FOR_SPRITE_B_FLIP_IVB;
+				break;
+			case 18:
+				flip_mask = MI_WAIT_FOR_SPRITE_C_FLIP_IVB;
+				break;
+			}
+		} else {
+			switch (plane) {
+			case 0:
+				flip_mask = MI_WAIT_FOR_PLANE_A_FLIP;
+				break;
+			case 1:
+				flip_mask = MI_WAIT_FOR_PLANE_B_FLIP;
+				break;
+			case 2:
+				flip_mask = MI_WAIT_FOR_PLANE_C_FLIP;
+				break;
+			case 16:
+				flip_mask = MI_WAIT_FOR_SPRITE_A_FLIP;
+				break;
+			case 17:
+				flip_mask = MI_WAIT_FOR_SPRITE_B_FLIP;
+				break;
+			}
+		}
 
 		ret = intel_ring_begin(ring, 2);
 		if (ret)
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 2555986..99894ff 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -189,7 +189,16 @@
 #define MI_NOOP			MI_INSTR(0, 0)
 #define MI_USER_INTERRUPT	MI_INSTR(0x02, 0)
 #define MI_WAIT_FOR_EVENT       MI_INSTR(0x03, 0)
+#define   MI_WAIT_FOR_SPRITE_C_FLIP_IVB	(1<<20)
+#define   MI_WAIT_FOR_PLANE_C_FLIP_IVB	(1<<15)
+#define   MI_WAIT_FOR_SPRITE_B_FLIP_IVB	(1<<10)
+#define   MI_WAIT_FOR_PLANE_B_FLIP_IVB	(1<<9)
+#define   MI_WAIT_FOR_SPRITE_A_FLIP_IVB	(1<<2)
+#define   MI_WAIT_FOR_PLANE_A_FLIP_IVB	(1<<1)
 #define   MI_WAIT_FOR_OVERLAY_FLIP	(1<<16)
+#define   MI_WAIT_FOR_SPRITE_B_FLIP	(1<<16)
+#define   MI_WAIT_FOR_SPRITE_A_FLIP	(1<<8)
+#define   MI_WAIT_FOR_PLANE_C_FLIP	(1<<8)
 #define   MI_WAIT_FOR_PLANE_B_FLIP      (1<<6)
 #define   MI_WAIT_FOR_PLANE_A_FLIP      (1<<2)
 #define   MI_WAIT_FOR_PLANE_A_SCANLINES (1<<1)
-- 
1.7.8.6



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux