On 22 December 2011 16:54, Eric Anholt <span dir="ltr">&lt;<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



Reviewed-by: Kenneth Graunke &lt;<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>&gt;<br>
---<br>
 src/mesa/drivers/dri/i965/brw_defines.h |   76 ++++++++++++++++++++++++++++++-<br>
 src/mesa/drivers/dri/intel/intel_reg.h  |   15 ++++++<br>
 2 files changed, 89 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h<br>
index 4edfaf7..4bb7f00 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_defines.h<br>
+++ b/src/mesa/drivers/dri/i965/brw_defines.h<br>
@@ -1307,6 +1307,42 @@ enum brw_wm_barycentric_interp_mode {<br>
 #define _3DSTATE_CONSTANT_HS                  0x7819 /* GEN7+ */<br>
 #define _3DSTATE_CONSTANT_DS                  0x781A /* GEN7+ */<br>
<br>
+#define _3DSTATE_STREAMOUT                    0x781e /* GEN7+ */<br>
+/* DW1 */<br>
+# define SO_FUNCTION_ENABLE                            (1 &lt;&lt; 31)<br>
+# define SO_RENDERING_DISABLE                          (1 &lt;&lt; 30)<br>
+/* This selects which incoming rendering stream goes down the pipeline.  The<br>
+ * rendering stream is 0 if not defined by special cases in the GS state.<br>
+ */<br>
+# define SO_RENDER_STREAM_SELECT_SHIFT                 27<br>
+# define SO_RENDER_STREAM_SELECT_MASK                  INTEL_MASK(28, 27)<br>
+/* Controls reordering of TRISTRIP_* elements in stream output (not rendering).<br>
+ */<br>
+# define SO_REORDER_TRAILING                           (1 &lt;&lt; 26)<br>
+/* Controls SO_NUM_PRIMS_WRITTEN_* and SO_PRIM_STORAGE_* */<br>
+# define SO_STATISTICS_ENABLE                          (1 &lt;&lt; 25)<br>
+# define SO_BUFFER_ENABLE_3                            (1 &lt;&lt; 11)<br>
+# define SO_BUFFER_ENABLE_2                            (1 &lt;&lt; 10)<br>
+# define SO_BUFFER_ENABLE_1                            (1 &lt;&lt; 9)<br>
+# define SO_BUFFER_ENABLE_0                            (1 &lt;&lt; 8)<br></blockquote><div><br>Considering how these are used in patch 6/7, I&#39;d prefer if we did this:<br><br>#define SO_BUFFER_ENABLE(n)  (1 &lt;&lt; (8 + (n)))<br>

<br>Then in patch 6/7 we could do<br><br>dw1 |= SO_BUFFER_ENABLE(i);<br><br>instead of<br><br>dw1 |= SO_BUFFER_ENABLE_0 &lt;&lt; i;<br>
 </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

+/* DW2 */<br>
+# define SO_STREAM_3_VERTEX_READ_OFFSET_SHIFT          29<br>
+# define SO_STREAM_3_VERTEX_READ_OFFSET_MASK           INTEL_MASK(29, 29)<br>
+# define SO_STREAM_3_VERTEX_READ_LENGTH_SHIFT          24<br>
+# define SO_STREAM_3_VERTEX_READ_LENGTH_MASK           INTEL_MASK(28, 24)<br>
+# define SO_STREAM_2_VERTEX_READ_OFFSET_SHIFT          21<br>
+# define SO_STREAM_2_VERTEX_READ_OFFSET_MASK           INTEL_MASK(21, 21)<br>
+# define SO_STREAM_2_VERTEX_READ_LENGTH_SHIFT          16<br>
+# define SO_STREAM_2_VERTEX_READ_LENGTH_MASK           INTEL_MASK(20, 16)<br>
+# define SO_STREAM_1_VERTEX_READ_OFFSET_SHIFT          13<br>
+# define SO_STREAM_1_VERTEX_READ_OFFSET_MASK           INTEL_MASK(13, 13)<br>
+# define SO_STREAM_1_VERTEX_READ_LENGTH_SHIFT          8<br>
+# define SO_STREAM_1_VERTEX_READ_LENGTH_MASK           INTEL_MASK(12, 8)<br>
+# define SO_STREAM_0_VERTEX_READ_OFFSET_SHIFT          5<br>
+# define SO_STREAM_0_VERTEX_READ_OFFSET_MASK           INTEL_MASK(5, 5)<br>
+# define SO_STREAM_0_VERTEX_READ_LENGTH_SHIFT          0<br>
+# define SO_STREAM_0_VERTEX_READ_LENGTH_MASK           INTEL_MASK(4, 0)<br>
+<br>
 /* 3DSTATE_WM for Gen7 */<br>
 /* DW1 */<br>
 # define GEN7_WM_STATISTICS_ENABLE                     (1 &lt;&lt; 31)<br>
@@ -1373,8 +1409,6 @@ enum brw_wm_barycentric_interp_mode {<br>
 /* DW6: kernel 1 pointer */<br>
 /* DW7: kernel 2 pointer */<br>
<br>
-#define _3DSTATE_STREAMOUT                      0x781e /* GEN7+ */<br>
-<br>
 #define _3DSTATE_SAMPLE_MASK                   0x7818 /* GEN6+ */<br>
<br>
 #define _3DSTATE_DRAWING_RECTANGLE             0x7900<br>
@@ -1414,6 +1448,44 @@ enum brw_wm_barycentric_interp_mode {<br>
 # define DEPTH_CLEAR_VALID                             (1 &lt;&lt; 15)<br>
 /* DW1: depth clear value */<br>
<br>
+#define _3DSTATE_SO_DECL_LIST                  0x7917 /* GEN7+ */<br>
+/* DW1 */<br>
+# define SO_STREAM_TO_BUFFER_SELECTS_3_SHIFT           12<br>
+# define SO_STREAM_TO_BUFFER_SELECTS_3_MASK            INTEL_MASK(15, 12)<br>
+# define SO_STREAM_TO_BUFFER_SELECTS_2_SHIFT           8<br>
+# define SO_STREAM_TO_BUFFER_SELECTS_2_MASK            INTEL_MASK(11, 8)<br>
+# define SO_STREAM_TO_BUFFER_SELECTS_1_SHIFT           4<br>
+# define SO_STREAM_TO_BUFFER_SELECTS_1_MASK            INTEL_MASK(7, 4)<br>
+# define SO_STREAM_TO_BUFFER_SELECTS_0_SHIFT           0<br>
+# define SO_STREAM_TO_BUFFER_SELECTS_0_MASK            INTEL_MASK(3, 0)<br>
+/* DW2 */<br>
+# define SO_NUM_ENTRIES_3_SHIFT                                24<br>
+# define SO_NUM_ENTRIES_3_MASK                         INTEL_MASK(31, 24)<br>
+# define SO_NUM_ENTRIES_2_SHIFT                                16<br>
+# define SO_NUM_ENTRIES_2_MASK                         INTEL_MASK(23, 16)<br>
+# define SO_NUM_ENTRIES_1_SHIFT                                8<br>
+# define SO_NUM_ENTRIES_1_MASK                         INTEL_MASK(15, 8)<br>
+# define SO_NUM_ENTRIES_0_SHIFT                                0<br>
+# define SO_NUM_ENTRIES_0_MASK                         INTEL_MASK(7, 0)<br>
+<br>
+/* SO_DECL DW0 */<br>
+# define SO_DECL_OUTPUT_BUFFER_SLOT_SHIFT              12<br>
+# define SO_DECL_OUTPUT_BUFFER_SLOT_MASK               INTEL_MASK(13, 12)<br>
+# define SO_DECL_HOLE_FLAG                             (1 &lt;&lt; 11)<br>
+# define SO_DECL_REGISTER_INDEX_SHIFT                  4<br>
+# define SO_DECL_REGISTER_INDEX_MASK                   INTEL_MASK(9, 4)<br>
+# define SO_DECL_COMPONENT_MASK_SHIFT                  0<br>
+# define SO_DECL_COMPONENT_MASK_MASK                   INTEL_MASK(3, 0)<br>
+<br>
+#define _3DSTATE_SO_BUFFER                    0x7918 /* GEN7+ */<br>
+/* DW1 */<br>
+# define SO_BUFFER_INDEX_SHIFT                         29<br>
+# define SO_BUFFER_INDEX_MASK                          INTEL_MASK(30, 29)<br>
+# define SO_BUFFER_PITCH_SHIFT                         0<br>
+# define SO_BUFFER_PITCH_MASK                          INTEL_MASK(11, 0)<br>
+/* DW2: start address */<br>
+/* DW3: end address. */<br>
+<br>
 #define CMD_PIPE_CONTROL              0x7a00<br>
<br>
 #define CMD_MI_FLUSH                  0x0200<br>
diff --git a/src/mesa/drivers/dri/intel/intel_reg.h b/src/mesa/drivers/dri/intel/intel_reg.h<br>
index a98a669..e2a6ee2 100644<br>
--- a/src/mesa/drivers/dri/intel/intel_reg.h<br>
+++ b/src/mesa/drivers/dri/intel/intel_reg.h<br>
@@ -44,6 +44,9 @@<br>
 #define MI_WAIT_FOR_PLANE_B_FLIP        (1&lt;&lt;6)<br>
 #define MI_WAIT_FOR_PLANE_A_FLIP        (1&lt;&lt;2)<br>
<br>
+#define MI_STORE_REGISTER_MEM          (CMD_MI | (0x24 &lt;&lt; 23))<br>
+# define MI_STORE_REGISTER_MEM_USE_GGTT                (1 &lt;&lt; 22)<br>
+<br>
 /* p189 */<br>
 #define _3DSTATE_LOAD_STATE_IMMEDIATE_1   (CMD_3D | (0x1d&lt;&lt;24) | (0x04&lt;&lt;16))<br>
 #define I1_LOAD_S(n)                      (1&lt;&lt;(4+n))<br>
@@ -260,3 +263,15 @@<br>
 #define FENCE_LINEAR 0<br>
 #define FENCE_XMAJOR 1<br>
 #define FENCE_YMAJOR 2<br>
+<br>
+#define SO_NUM_PRIM_STORAGE_NEEDED     0x2280<br>
+#define SO_PRIM_STORAGE_NEEDED0_IVB    0x5240<br>
+#define SO_PRIM_STORAGE_NEEDED1_IVB    0x5248<br>
+#define SO_PRIM_STORAGE_NEEDED2_IVB    0x5250<br>
+#define SO_PRIM_STORAGE_NEEDED3_IVB    0x5258<br>
+<br>
+#define SO_NUM_PRIMS_WRITTEN           0x2288<br>
+#define SO_NUM_PRIMS_WRITTEN0_IVB      0x5200<br>
+#define SO_NUM_PRIMS_WRITTEN1_IVB      0x5208<br>
+#define SO_NUM_PRIMS_WRITTEN2_IVB      0x5210<br>
+#define SO_NUM_PRIMS_WRITTEN3_IVB      0x5218<br>
<span><font color="#888888">--<br>
1.7.7.3<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br>