nv50,nvc0: hold references to the framebuffer surfaces
[mesa.git] / src / gallium / drivers / nv50 / nv50_pc_print.c
index c2c3eb25bcb85662372377e031affb36a645d7c7..dabbb836aa4f146dcd752cd14fd4d9e469396d70 100644 (file)
@@ -59,7 +59,7 @@ static const char *nv_opcode_names[NV_OP_COUNT + 1] = {
    "shl",
    "shr",
    "rcp",
-   "(undefined)",
+   "undef",
    "rsqrt",
    "lg2",
    "sin",
@@ -95,13 +95,16 @@ static const char *nv_opcode_names[NV_OP_COUNT + 1] = {
    "nop",
    "select",
    "export",
+   "join",
+   "round",
    "BAD_OP"
 };
 
 static const char *nv_cond_names[] =
 {
    "never", "lt" , "eq" , "le" , "gt" , "ne" , "ge" , "",
-   "never", "ltu", "equ", "leu", "gtu", "neu", "geu", ""
+   "never", "ltu", "equ", "leu", "gtu", "neu", "geu", "",
+   "o", "c", "a", "s"
 };
 
 static const char *nv_modifier_strings[] =
@@ -143,7 +146,7 @@ nv_type_name(ubyte type)
 static INLINE const char *
 nv_cond_name(ubyte cc)
 {
-   return nv_cond_names[MIN2(cc, 15)];
+   return nv_cond_names[MIN2(cc, 19)];
 }
 
 static INLINE const char *
@@ -169,21 +172,25 @@ nv_value_allocated(struct nv_value *value)
 static INLINE void
 nv_print_address(const char c, int buf, struct nv_value *a, int offset)
 {
+   const char ac =  (a && nv_value_allocated(a)) ? '$' : '%';
+
    if (buf >= 0)
       PRINT(" %s%c%i[", cyan, c, buf);
    else
       PRINT(" %s%c[", cyan, c);
    if (a)
-      PRINT("%s$a%i%s+", mgta, nv_value_id(a), cyan);
+      PRINT("%s%ca%i%s+", mgta, ac, nv_value_id(a), cyan);
    PRINT("%s0x%x%s]", orng, offset, cyan);
 }
 
 static INLINE void
 nv_print_cond(struct nv_instruction *nvi)
 {
-   PRINT("%s%s %s$c%i ",
+   char pfx = nv_value_allocated(nvi->flags_src->value->join) ? '$' : '%';
+
+   PRINT("%s%s %s%cc%i ",
          gree, nv_cond_name(nvi->cc),
-         mgta, nv_value_id(nvi->flags_src->value));
+         mgta, pfx, nv_value_id(nvi->flags_src->value));
 }
 
 static INLINE void
@@ -197,8 +204,8 @@ nv_print_value(struct nv_value *value, struct nv_value *ind, ubyte type)
    if (value->reg.file != NV_FILE_FLAGS)
       PRINT(" %s%s", gree, nv_type_name(type));
 
-   if (!nv_value_allocated(value))
-      reg_pfx = nv_value_allocated(value->join) ? '&' : '%';
+   if (!nv_value_allocated(value->join))
+      reg_pfx = '%';
 
    switch (value->reg.file) {
    case NV_FILE_GPR:
@@ -213,6 +220,9 @@ nv_print_value(struct nv_value *value, struct nv_value *ind, ubyte type)
    case NV_FILE_FLAGS:
       PRINT(" %s%cc%i", mgta, reg_pfx, nv_value_id(value));
       break;
+   case NV_FILE_MEM_L:
+      nv_print_address('l', -1, ind, nv_value_id(value));
+      break;
    case NV_FILE_MEM_S:
       nv_print_address('s', -1, ind, 4 * nv_value_id(value));
       break;
@@ -301,7 +311,7 @@ nv_print_instruction(struct nv_instruction *i)
          continue;
 
       if (i->src[j]->mod)
-         PRINT(" %s", nv_modifier_string(i->src[j]->mod));
+         PRINT(" %s%s", gree, nv_modifier_string(i->src[j]->mod));
 
       nv_print_ref(i->src[j],
                    (j == nv50_indirect_opnd(i)) ?