diff --git a/src/freedreno/drm/freedreno_priv.h b/src/freedreno/drm/freedreno_priv.h index 827ed1c3d27..8a5b292a5f4 100644 --- a/src/freedreno/drm/freedreno_priv.h +++ b/src/freedreno/drm/freedreno_priv.h @@ -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) /* diff --git a/src/freedreno/drm/freedreno_ringbuffer_sp.c b/src/freedreno/drm/freedreno_ringbuffer_sp.c index 35fb6999cfc..c83a8bacb4a 100644 --- a/src/freedreno/drm/freedreno_ringbuffer_sp.c +++ b/src/freedreno/drm/freedreno_ringbuffer_sp.c @@ -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)