Mesa (7.10): i965: Fix the VS thread limits for GT1, and clarify the WM limits on both.

Ian Romanick idr at kemper.freedesktop.org
Thu Apr 21 10:38:26 PDT 2011


Module: Mesa
Branch: 7.10
Commit: 510fb3269e5d66c03497b647aed3178290c7624d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=510fb3269e5d66c03497b647aed3178290c7624d

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 29 13:22:13 2011 -0700

i965: Fix the VS thread limits for GT1, and clarify the WM limits on both.

(cherry picked from commit 904b8ba1bb604b2eaaa22f7f074d236011fe213f)

---

 src/mesa/drivers/dri/i965/brw_context.c   |   13 +++++++++++--
 src/mesa/drivers/dri/i965/gen6_vs_state.c |    3 ++-
 src/mesa/drivers/dri/i965/gen6_wm_state.c |    2 +-
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 9483ec6..a74ba5c 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -183,8 +183,17 @@ GLboolean brwCreateContext( int api,
    /* WM maximum threads is number of EUs times number of threads per EU. */
    if (intel->gen >= 6) {
       brw->urb.size = 1024;
-      brw->vs_max_threads = 60;
-      brw->wm_max_threads = 80;
+      if (IS_GT2(intel->intelScreen->deviceID)) {
+	 /* This could possibly be 80, but is supposed to require
+	  * disabling of WIZ hashing (bit 6 of GT_MODE, 0x20d0) and a
+	  * GPU reset to change.
+	  */
+	 brw->wm_max_threads = 40;
+	 brw->vs_max_threads = 60;
+      } else {
+	 brw->wm_max_threads = 40;
+	 brw->vs_max_threads = 24;
+      }
    } else if (intel->gen == 5) {
       brw->urb.size = 1024;
       brw->vs_max_threads = 72;
diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c
index ed132bd..4deba46 100644
--- a/src/mesa/drivers/dri/i965/gen6_vs_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c
@@ -136,7 +136,8 @@ upload_vs_state(struct brw_context *brw)
    OUT_BATCH((1 << GEN6_VS_DISPATCH_START_GRF_SHIFT) |
 	     (brw->vs.prog_data->urb_read_length << GEN6_VS_URB_READ_LENGTH_SHIFT) |
 	     (0 << GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT));
-   OUT_BATCH((0 << GEN6_VS_MAX_THREADS_SHIFT) |
+
+   OUT_BATCH(((brw->vs_max_threads - 1) << GEN6_VS_MAX_THREADS_SHIFT) |
 	     GEN6_VS_STATISTICS_ENABLE |
 	     GEN6_VS_ENABLE);
    ADVANCE_BATCH();
diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c
index 2ae0c09..c8a7134 100644
--- a/src/mesa/drivers/dri/i965/gen6_wm_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c
@@ -144,7 +144,7 @@ upload_wm_state(struct brw_context *brw)
    dw4 |= (brw->wm.prog_data->first_curbe_grf <<
 	   GEN6_WM_DISPATCH_START_GRF_SHIFT_0);
 
-   dw5 |= (40 - 1) << GEN6_WM_MAX_THREADS_SHIFT;
+   dw5 |= (brw->wm_max_threads - 1) << GEN6_WM_MAX_THREADS_SHIFT;
 
    /* CACHE_NEW_WM_PROG */
    if (brw->wm.prog_data->dispatch_width == 8)



More information about the mesa-commit mailing list