Commit 3dff0c30 authored by Rob Clark's avatar Rob Clark 💬 Committed by Marge Bot
Browse files

freedreno/headergen2: Fix compile warnings with CP_DRAW_INDIRECT_MULTI



Using stripes to deal with the different packet layout variants resulted
in redefining "register" offsets with different values, so use "prefix"
to add a suffix to disambiguate.

  drivers/gpu/drm/msm/adreno/adreno_pm4.xml.h:1066: warning: "REG_A6XX_CP_DRAW_INDIRECT_MULTI_INDIRECT" redefined
   1066 | #define REG_A6XX_CP_DRAW_INDIRECT_MULTI_INDIRECT  0x00000006
        |
  drivers/gpu/drm/msm/adreno/adreno_pm4.xml.h:1057: note: this is the location of the previous definition
   1057 | #define REG_A6XX_CP_DRAW_INDIRECT_MULTI_INDIRECT  0x00000003
        |

(Admittedly it isn't really a "prefix" but that was the field in the
schema available to use, and REG_INDEXED_CP_DRAW_INDIRECT_MULTI_STRIDE
sounds somewhat more funny.)
Signed-off-by: Rob Clark's avatarRob Clark <robdclark@chromium.org>
Part-of: <!10944>
parent ff5e17f1
Pipeline #329658 waiting for manual action with stages
......@@ -831,18 +831,18 @@ opcode: CP_LOAD_STATE4 (30) (4 dwords)
<reg64 offset="3" name="INDIRECT" type="address"/>
<reg32 offset="5" name="STRIDE" type="uint"/>
</stripe>
<stripe varset="a6xx_draw_indirect_opcode" variants="INDIRECT_OP_INDEXED">
<stripe varset="a6xx_draw_indirect_opcode" variants="INDIRECT_OP_INDEXED" prefix="INDEXED">
<reg64 offset="3" name="INDEX" type="address"/>
<reg32 offset="5" name="MAX_INDICES" type="uint"/>
<reg64 offset="6" name="INDIRECT" type="address"/>
<reg32 offset="8" name="STRIDE" type="uint"/>
</stripe>
<stripe varset="a6xx_draw_indirect_opcode" variants="INDIRECT_OP_INDIRECT_COUNT">
<stripe varset="a6xx_draw_indirect_opcode" variants="INDIRECT_OP_INDIRECT_COUNT" prefix="INDIRECT">
<reg64 offset="3" name="INDIRECT" type="address"/>
<reg64 offset="5" name="INDIRECT_COUNT" type="address"/>
<reg32 offset="7" name="STRIDE" type="uint"/>
</stripe>
<stripe varset="a6xx_draw_indirect_opcode" variants="INDIRECT_OP_INDIRECT_COUNT_INDEXED">
<stripe varset="a6xx_draw_indirect_opcode" variants="INDIRECT_OP_INDIRECT_COUNT_INDEXED" prefix="INDIRECT_INDEXED">
<reg64 offset="3" name="INDEX" type="address"/>
<reg32 offset="5" name="MAX_INDICES" type="uint"/>
<reg64 offset="6" name="INDIRECT" type="address"/>
......
......@@ -231,7 +231,7 @@ static void printbitfield (struct rnnbitfield *bf, int shift) {
printtypeinfo (&bf->typeinfo, bf, bf->fullname, bf->file);
}
static void printdelem (struct rnndelem *elem, uint64_t offset) {
static void printdelem (struct rnndelem *elem, uint64_t offset, const char *str) {
int use_offset_fxn;
char *offsetfn = NULL;
......@@ -251,7 +251,11 @@ static void printdelem (struct rnndelem *elem, uint64_t offset) {
if (elem->name) {
char *regname;
asprintf(&regname, "REG_%s", elem->fullname);
if (str) {
asprintf(&regname, "REG_%s_%s", elem->fullname, str);
} else {
asprintf(&regname, "REG_%s", elem->fullname);
}
if (elemsnum) {
int len;
FILE *dst = findfout(elem->file);
......@@ -333,7 +337,7 @@ static void printdelem (struct rnndelem *elem, uint64_t offset) {
fprintf (findfout(elem->file), "\n");
int j;
for (j = 0; j < elem->subelemsnum; j++) {
printdelem(elem->subelems[j], offset + elem->offset);
printdelem(elem->subelems[j], offset + elem->offset, elem->varinfo.prefixstr);
}
if (elem->length != 1) {
elemsnum--;
......@@ -492,7 +496,7 @@ int main(int argc, char **argv) {
printdef (db->domains[i]->fullname, "SIZE", 0, db->domains[i]->size, db->domains[i]->file);
int j;
for (j = 0; j < db->domains[i]->subelemsnum; j++) {
printdelem(db->domains[i]->subelems[j], 0);
printdelem(db->domains[i]->subelems[j], 0, NULL);
}
}
for(i = 0; i < foutsnum; ++i) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment