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:
@@ -193,7 +193,8 @@ class Bitset(object):
|
||||
if f.type == "waddress":
|
||||
print(" .bo_write = true,")
|
||||
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")
|
||||
|
||||
|
@@ -457,6 +457,7 @@ struct tu_reg_value {
|
||||
bool bo_write;
|
||||
uint32_t bo_offset;
|
||||
uint32_t bo_shift;
|
||||
uint32_t bo_low;
|
||||
};
|
||||
|
||||
#define fd_reg_pair tu_reg_value
|
||||
@@ -479,6 +480,7 @@ struct tu_reg_value {
|
||||
if (regs[i].bo) { \
|
||||
uint64_t v = regs[i].bo->iova + regs[i].bo_offset; \
|
||||
v >>= regs[i].bo_shift; \
|
||||
v <<= regs[i].bo_low; \
|
||||
v |= regs[i].value; \
|
||||
\
|
||||
*p++ = v; \
|
||||
|
@@ -34,6 +34,7 @@ struct fd_reg_pair {
|
||||
bool bo_write;
|
||||
uint32_t bo_offset;
|
||||
uint32_t bo_shift;
|
||||
uint32_t bo_low;
|
||||
};
|
||||
|
||||
#define __bo_type struct fd_bo *
|
||||
@@ -62,8 +63,9 @@ struct fd_reg_pair {
|
||||
__assert_eq(regs[0].reg + i, regs[i].reg); \
|
||||
if (regs[i].bo) { \
|
||||
uint64_t *p64 = (uint64_t *)p; \
|
||||
*p64 = __reloc_iova(regs[i].bo, regs[i].bo_offset, regs[i].value, \
|
||||
regs[i].bo_shift); \
|
||||
*p64 = (__reloc_iova(regs[i].bo, regs[i].bo_offset, 0, \
|
||||
-regs[i].bo_shift) << regs[i].bo_low) | \
|
||||
regs[i].value; \
|
||||
p += 2; \
|
||||
fd_ringbuffer_attach_bo(ring, regs[i].bo); \
|
||||
} else { \
|
||||
|
Reference in New Issue
Block a user