i965: Store absolute thread count in max_wm_threads on Broadwell.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 5 Feb 2014 06:18:03 +0000 (22:18 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 20 Feb 2014 23:50:08 +0000 (15:50 -0800)
In the past, 3DSTATE_PS took an absolute number of threads.  Conversely,
on Broadwell you always program 64, and it implicitly scales based on
the GT-level with no special programming.  So, I stored 64 in
brw_device_info::max_wm_threads.

However, I didn't realize that we also use max_wm_threads to compute the
size of the scratch space buffer.  In that case, we really need the
absolute number of threads.

This patch hardcodes 3DSTATE_PS to use the value it expects, and changes
max_wm_threads back to a (completely fake) absolute thread count (once
again copied from Haswell).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_device_info.c
src/mesa/drivers/dri/i965/gen8_ps_state.c

index d931091ee6edf812379b1e4990c1ce103761d794..e4c110da036f4d47e0f9bf04a3ea15fd9daf63a3 100644 (file)
@@ -201,7 +201,7 @@ static const struct brw_device_info brw_device_info_hsw_gt3 = {
    .has_pln = true,                                 \
    .max_vs_threads = 280,                           \
    .max_gs_threads = 256,                           \
-   .max_wm_threads = 64,  /* threads per PSD */     \
+   .max_wm_threads = 408,                           \
    .urb = {                                         \
       .size = 128,                                  \
       .min_vs_entries = 64,                         \
index c2810bb21b9ba72ee07f17fe19fd102785927e86..561fc96e7d317ab8efd7912bee49784d5137a842 100644 (file)
@@ -174,7 +174,10 @@ upload_ps_state(struct brw_context *brw)
    if (ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT] == NULL)
       dw3 |= GEN7_PS_FLOATING_POINT_MODE_ALT;
 
-   dw6 |= (brw->max_wm_threads - 2) << HSW_PS_MAX_THREADS_SHIFT;
+   /* 3DSTATE_PS expects the number of threads per PSD, which is always 64;
+    * it implicitly scales for different GT levels (which have some # of PSDs).
+    */
+   dw6 |= (64 - 2) << HSW_PS_MAX_THREADS_SHIFT;
 
    /* CACHE_NEW_WM_PROG */
    if (brw->wm.prog_data->base.nr_params > 0)