From a5d80212f670bd41f31d09509b1fe98e56796d55 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Wed, 6 May 2026 12:04:43 +0200 Subject: [PATCH] asahi: fix dst range in buffer copy region agx_batch_writes_range takes the offset within the buffer, not the address Fixes: 4a3b905bb89 ("agx: move texture lowering into lib") --- src/gallium/drivers/asahi/agx_blit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/asahi/agx_blit.c b/src/gallium/drivers/asahi/agx_blit.c index 12901f71241..5d770ef1ab7 100644 --- a/src/gallium/drivers/asahi/agx_blit.c +++ b/src/gallium/drivers/asahi/agx_blit.c @@ -619,11 +619,12 @@ agx_resource_copy_region(struct pipe_context *pctx, struct pipe_resource *dst, assert(dst->format == src->format); unsigned bs = util_format_get_blocksize(dst->format); unsigned size = bs * src_box->width; - uint64_t dst_addr = agx_map_gpu(agx_resource(dst)) + dstx * bs; + unsigned dst_offset = dstx * bs; + uint64_t dst_addr = agx_map_gpu(agx_resource(dst)) + dst_offset; uint64_t src_addr = agx_map_gpu(agx_resource(src)) + src_box->x * bs; agx_batch_reads(batch, agx_resource(src)); - agx_batch_writes_range(batch, agx_resource(dst), dst_addr, size); + agx_batch_writes_range(batch, agx_resource(dst), dst_offset, size); /* Use vectorized copies for as much of the buffer as possible. This requires * that dst, src, and size are all properly aligned. Failing to check for * alignment on the buffers causes subtle and hard-to-debug issues!