haswell: fix max PS threads shift value.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Mon, 7 May 2012 07:09:48 +0000 (09:09 +0200)
committerXiang, Haihao <haihao.xiang@intel.com>
Tue, 23 Oct 2012 05:50:28 +0000 (13:50 +0800)
The maximum number of threads is now a 9-bit value. Thus, one more bit
towards LSB was re-used. i.e. bit position is now 23 instead of 24 on
Ivy Bridge.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
src/i965_defines.h
src/i965_render.c

index 7fd61a6..3e64a5e 100755 (executable)
 # define GEN7_PS_FLOATING_POINT_MODE_ALT                (1 << 16)
 /* DW3: scratch space */
 /* DW4 */
-# define GEN7_PS_MAX_THREADS_SHIFT                      24
+# define GEN7_PS_MAX_THREADS_SHIFT_IVB                  24
+# define GEN7_PS_MAX_THREADS_SHIFT_HSW                  23
 # define GEN7_PS_PUSH_CONSTANT_ENABLE                   (1 << 11)
 # define GEN7_PS_ATTRIBUTE_ENABLE                       (1 << 10)
 # define GEN7_PS_OMASK_TO_RENDER_TARGET                 (1 << 9)
index 628da71..f9d2ac7 100644 (file)
@@ -2730,6 +2730,11 @@ gen7_emit_wm_state(VADriverContextP ctx, int kernel)
     struct i965_driver_data *i965 = i965_driver_data(ctx);
     struct intel_batchbuffer *batch = i965->batch;
     struct i965_render_state *render_state = &i965->render_state;
+    unsigned int max_threads_shift = GEN7_PS_MAX_THREADS_SHIFT_IVB;
+
+    if (IS_HASWELL(i965->intel.device_id)) {
+        max_threads_shift = GEN7_PS_MAX_THREADS_SHIFT_HSW;
+    }
 
     BEGIN_BATCH(batch, 3);
     OUT_BATCH(batch, GEN6_3DSTATE_WM | (3 - 2));
@@ -2763,7 +2768,7 @@ gen7_emit_wm_state(VADriverContextP ctx, int kernel)
               (5 << GEN7_PS_BINDING_TABLE_ENTRY_COUNT_SHIFT));
     OUT_BATCH(batch, 0); /* scratch space base offset */
     OUT_BATCH(batch, 
-              ((86 - 1) << GEN7_PS_MAX_THREADS_SHIFT) |
+              ((86 - 1) << max_threads_shift) |
               GEN7_PS_PUSH_CONSTANT_ENABLE |
               GEN7_PS_ATTRIBUTE_ENABLE |
               GEN7_PS_16_DISPATCH_ENABLE);