freedreno/drm: Fix suballoc alignment

IBO/etc descriptors need to be aligned to 64.. this was handled
correctly in the stateobj case (for tex descriptors) but not in
the streaming case (for IBO).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19710>
This commit is contained in:
Rob Clark
2022-11-12 15:34:08 -08:00
committed by Marge Bot
parent cf6b2699ca
commit edca30efbf
2 changed files with 4 additions and 3 deletions
+2
View File
@@ -54,6 +54,8 @@
extern simple_mtx_t table_lock;
#define SUBALLOC_SIZE (32 * 1024)
/* Maximum known alignment requirement is a6xx's TEX_CONST at 16 dwords */
#define SUBALLOC_ALIGNMENT 64
#define RING_FLAGS (FD_BO_GPUREADONLY | FD_BO_CACHED_COHERENT | _FD_BO_RING)
/*
+2 -3
View File
@@ -99,7 +99,7 @@ fd_submit_suballoc_ring_bo(struct fd_submit *submit,
suballoc_offset =
fd_ringbuffer_size(fd_submit->suballoc_ring) + suballoc_ring->offset;
suballoc_offset = align(suballoc_offset, 0x10);
suballoc_offset = align(suballoc_offset, SUBALLOC_ALIGNMENT);
if ((size + suballoc_offset) > suballoc_bo->size) {
suballoc_bo = NULL;
@@ -657,8 +657,7 @@ fd_ringbuffer_sp_new_object(struct fd_pipe *pipe, uint32_t size)
*/
simple_mtx_lock(&dev->suballoc_lock);
/* Maximum known alignment requirement is a6xx's TEX_CONST at 16 dwords */
fd_ring->offset = align(dev->suballoc_offset, 64);
fd_ring->offset = align(dev->suballoc_offset, SUBALLOC_ALIGNMENT);
if (!dev->suballoc_bo ||
fd_ring->offset + size > fd_bo_size(dev->suballoc_bo)) {
if (dev->suballoc_bo)