i965: Make some EU emit code for DP read/write messages non-static.
authorEric Anholt <eric@anholt.net>
Sun, 7 Aug 2011 20:16:06 +0000 (13:16 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 16 Aug 2011 20:04:42 +0000 (13:04 -0700)
We keep building these strange interfaces for DP read/write where
there's a helper function with some partially-specific,
partially-general controls, which is used in exactly one place in code
generation.  Making these public will let us set up those instructions
in the one place they're to be generated.

src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_eu_emit.c

index 38dd99b693d4f0b35e1833a6cbab1737b6673087..af50305fc2bf80508effb69be1883e341f2b396b 100644 (file)
@@ -801,6 +801,12 @@ void brw_init_compile(struct brw_context *, struct brw_compile *p,
                      void *mem_ctx);
 const GLuint *brw_get_program( struct brw_compile *p, GLuint *sz );
 
+struct brw_instruction *brw_next_insn(struct brw_compile *p, GLuint opcode);
+void brw_set_dest(struct brw_compile *p, struct brw_instruction *insn,
+                 struct brw_reg dest);
+void brw_set_src0(struct brw_compile *p, struct brw_instruction *insn,
+                 struct brw_reg reg);
+
 
 /* Helpers for regular instructions:
  */
@@ -855,6 +861,27 @@ ROUND(RNDE)
 
 /* Helpers for SEND instruction:
  */
+void brw_set_dp_read_message(struct brw_compile *p,
+                            struct brw_instruction *insn,
+                            GLuint binding_table_index,
+                            GLuint msg_control,
+                            GLuint msg_type,
+                            GLuint target_cache,
+                            GLuint msg_length,
+                            GLuint response_length);
+
+void brw_set_dp_write_message(struct brw_compile *p,
+                             struct brw_instruction *insn,
+                             GLuint binding_table_index,
+                             GLuint msg_control,
+                             GLuint msg_type,
+                             GLuint msg_length,
+                             GLboolean header_present,
+                             GLuint pixel_scoreboard_clear,
+                             GLuint response_length,
+                             GLuint end_of_thread,
+                             GLuint send_commit_msg);
+
 void brw_urb_WRITE(struct brw_compile *p,
                   struct brw_reg dest,
                   GLuint msg_reg_nr,
index e7370f360643052437159f7f3ab04f91eb70ed3d..b08906426e4a73b2a57a0455812240d0c26421e0 100644 (file)
@@ -89,9 +89,9 @@ gen7_convert_mrf_to_grf(struct brw_compile *p, struct brw_reg *reg)
 }
 
 
-static void brw_set_dest(struct brw_compile *p,
-                        struct brw_instruction *insn,
-                        struct brw_reg dest)
+void
+brw_set_dest(struct brw_compile *p, struct brw_instruction *insn,
+            struct brw_reg dest)
 {
    if (dest.file != BRW_ARCHITECTURE_REGISTER_FILE &&
        dest.file != BRW_MESSAGE_REGISTER_FILE)
@@ -221,9 +221,9 @@ validate_reg(struct brw_instruction *insn, struct brw_reg reg)
    /* 10. Check destination issues. */
 }
 
-static void brw_set_src0(struct brw_compile *p,
-                        struct brw_instruction *insn,
-                        struct brw_reg reg)
+void
+brw_set_src0(struct brw_compile *p, struct brw_instruction *insn,
+            struct brw_reg reg)
 {
    if (reg.type != BRW_ARCHITECTURE_REGISTER_FILE)
       assert(reg.nr < 128);
@@ -504,17 +504,18 @@ static void brw_set_urb_message( struct brw_compile *p,
     }
 }
 
-static void brw_set_dp_write_message( struct brw_compile *p,
-                                     struct brw_instruction *insn,
-                                     GLuint binding_table_index,
-                                     GLuint msg_control,
-                                     GLuint msg_type,
-                                     GLuint msg_length,
-                                     GLboolean header_present,
-                                     GLuint pixel_scoreboard_clear,
-                                     GLuint response_length,
-                                     GLuint end_of_thread,
-                                     GLuint send_commit_msg)
+void
+brw_set_dp_write_message(struct brw_compile *p,
+                        struct brw_instruction *insn,
+                        GLuint binding_table_index,
+                        GLuint msg_control,
+                        GLuint msg_type,
+                        GLuint msg_length,
+                        GLboolean header_present,
+                        GLuint pixel_scoreboard_clear,
+                        GLuint response_length,
+                        GLuint end_of_thread,
+                        GLuint send_commit_msg)
 {
    struct brw_context *brw = p->brw;
    struct intel_context *intel = &brw->intel;
@@ -570,7 +571,7 @@ static void brw_set_dp_write_message( struct brw_compile *p,
    }
 }
 
-static void
+void
 brw_set_dp_read_message(struct brw_compile *p,
                        struct brw_instruction *insn,
                        GLuint binding_table_index,
@@ -709,9 +710,9 @@ static void brw_set_sampler_message(struct brw_compile *p,
 }
 
 
-
-static struct brw_instruction *next_insn( struct brw_compile *p, 
-                                         GLuint opcode )
+#define next_insn brw_next_insn
+struct brw_instruction *
+brw_next_insn(struct brw_compile *p, GLuint opcode)
 {
    struct brw_instruction *insn;
 
@@ -732,7 +733,6 @@ static struct brw_instruction *next_insn( struct brw_compile *p,
    return insn;
 }
 
-
 static struct brw_instruction *brw_alu1( struct brw_compile *p,
                                         GLuint opcode,
                                         struct brw_reg dest,