mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
freedreno/registers: Fix bo fields with low != 0
We need to add the missing left-shift. And a right-shift is negative! Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20456>
This commit is contained in:
parent
ffb77c8be6
commit
3fa2ce0890
3 changed files with 8 additions and 3 deletions
|
|
@ -193,7 +193,8 @@ class Bitset(object):
|
||||||
if f.type == "waddress":
|
if f.type == "waddress":
|
||||||
print(" .bo_write = true,")
|
print(" .bo_write = true,")
|
||||||
print(" .bo_offset = fields.bo_offset,")
|
print(" .bo_offset = fields.bo_offset,")
|
||||||
print(" .bo_shift = %d" % address.shr)
|
print(" .bo_shift = %d," % address.shr)
|
||||||
|
print(" .bo_low = %d," % address.low)
|
||||||
|
|
||||||
print(" };\n}\n")
|
print(" };\n}\n")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -457,6 +457,7 @@ struct tu_reg_value {
|
||||||
bool bo_write;
|
bool bo_write;
|
||||||
uint32_t bo_offset;
|
uint32_t bo_offset;
|
||||||
uint32_t bo_shift;
|
uint32_t bo_shift;
|
||||||
|
uint32_t bo_low;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define fd_reg_pair tu_reg_value
|
#define fd_reg_pair tu_reg_value
|
||||||
|
|
@ -479,6 +480,7 @@ struct tu_reg_value {
|
||||||
if (regs[i].bo) { \
|
if (regs[i].bo) { \
|
||||||
uint64_t v = regs[i].bo->iova + regs[i].bo_offset; \
|
uint64_t v = regs[i].bo->iova + regs[i].bo_offset; \
|
||||||
v >>= regs[i].bo_shift; \
|
v >>= regs[i].bo_shift; \
|
||||||
|
v <<= regs[i].bo_low; \
|
||||||
v |= regs[i].value; \
|
v |= regs[i].value; \
|
||||||
\
|
\
|
||||||
*p++ = v; \
|
*p++ = v; \
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ struct fd_reg_pair {
|
||||||
bool bo_write;
|
bool bo_write;
|
||||||
uint32_t bo_offset;
|
uint32_t bo_offset;
|
||||||
uint32_t bo_shift;
|
uint32_t bo_shift;
|
||||||
|
uint32_t bo_low;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define __bo_type struct fd_bo *
|
#define __bo_type struct fd_bo *
|
||||||
|
|
@ -62,8 +63,9 @@ struct fd_reg_pair {
|
||||||
__assert_eq(regs[0].reg + i, regs[i].reg); \
|
__assert_eq(regs[0].reg + i, regs[i].reg); \
|
||||||
if (regs[i].bo) { \
|
if (regs[i].bo) { \
|
||||||
uint64_t *p64 = (uint64_t *)p; \
|
uint64_t *p64 = (uint64_t *)p; \
|
||||||
*p64 = __reloc_iova(regs[i].bo, regs[i].bo_offset, regs[i].value, \
|
*p64 = (__reloc_iova(regs[i].bo, regs[i].bo_offset, 0, \
|
||||||
regs[i].bo_shift); \
|
-regs[i].bo_shift) << regs[i].bo_low) | \
|
||||||
|
regs[i].value; \
|
||||||
p += 2; \
|
p += 2; \
|
||||||
fd_ringbuffer_attach_bo(ring, regs[i].bo); \
|
fd_ringbuffer_attach_bo(ring, regs[i].bo); \
|
||||||
} else { \
|
} else { \
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue