From b692ab076a72be97bea6bc527ea1c2e55c5f4d3c Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 5 Mar 2020 19:26:03 +0100 Subject: [PATCH] panfrost: Ignore BO start addr when adjusting src_offset BOs are guaranteed to be aligned on 4K which inherently guarantees the 64 byte alignment. Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_context.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 0a010b99fc4..fda7b3fcb3d 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -225,15 +225,15 @@ panfrost_stage_attributes(struct panfrost_context *ctx) for (unsigned i = 0; i < so->num_elements; ++i) { unsigned vbi = so->pipe[i].vertex_buffer_index; struct pipe_vertex_buffer *buf = &ctx->vertex_buffers[vbi]; - struct panfrost_resource *rsrc = (struct panfrost_resource *) (buf->buffer.resource); - mali_ptr addr = rsrc->bo->gpu + buf->buffer_offset; /* Adjust by the masked off bits of the offset. Make sure we * read src_offset from so->hw (which is not GPU visible) * rather than target (which is) due to caching effects */ unsigned src_offset = so->pipe[i].src_offset; - src_offset += (addr & 63); + + /* BOs aligned to 4k so guaranteed aligned to 64 */ + src_offset += (buf->buffer_offset & 63); /* Also, somewhat obscurely per-instance data needs to be * offset in response to a delayed start in an indexed draw */ -- 2.30.2