pan/midgard: Fix flipped register bias fields

We mixed up component_lo and full, which made it appear that we had
less freedom in RA than we actually do. Fix this to fix some
disassemblies as well as prepare for RA with the bias field.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
Alyssa Rosenzweig
2019-07-25 10:55:09 -07:00
parent be56840d5a
commit b3cab85606
3 changed files with 6 additions and 23 deletions
+1 -6
View File
@@ -1206,14 +1206,9 @@ print_texture_word(uint32_t *word, unsigned tabs)
uint8_t raw = texture->bias;
memcpy(&sel, &raw, sizeof(raw));
unsigned c = (sel.component_hi << 1) | sel.component_lo;
printf("lod %c ", lod_operand);
print_texture_reg(sel.full, sel.select, sel.upper);
printf(".%c, ", components[c]);
if (!sel.component_hi)
printf(" /* gradient? */");
printf(".%c, ", components[sel.component]);
if (texture->bias_int)
printf(" /* bias_int = 0x%X */", texture->bias_int);
+4 -13
View File
@@ -516,11 +516,8 @@ midgard_load_store;
typedef struct
__attribute__((__packed__))
{
/* Combines with component_hi to form 2-bit component select out of
* xyzw, as the component for bias/LOD and the starting component of a
* gradient vector */
unsigned component_lo : 1;
/* 32-bit register, clear for half-register */
unsigned full : 1;
/* Register select between r28/r29 */
unsigned select : 1;
@@ -528,14 +525,8 @@ __attribute__((__packed__))
/* For a half-register, selects the upper half */
unsigned upper : 1;
/* Specifies a full-register, clear for a half-register. Mutually
* exclusive with upper. */
unsigned full : 1;
/* Higher half of component_lo. Always seen to be set for LOD/bias
* and clear for processed gradients, but I'm not sure if that's a
* hardware requirement. */
unsigned component_hi : 1;
/* Indexes into the register */
unsigned component : 2;
/* Padding to make this 8-bit */
unsigned zero : 3;
+1 -4
View File
@@ -1650,10 +1650,7 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr,
midgard_tex_register_select sel = {
.select = in_reg,
.full = 1,
/* w */
.component_lo = 1,
.component_hi = 1
.component = COMPONENT_W,
};
uint8_t packed;