From: Boris Brezillon Date: Thu, 5 Mar 2020 18:26:03 +0000 (+0100) Subject: panfrost: Ignore BO start addr when adjusting src_offset X-Git-Tag: upstream/20.1.8~2600 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b692ab076a72be97bea6bc527ea1c2e55c5f4d3c;p=platform%2Fupstream%2Fmesa.git 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: --- diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 0a010b9..fda7b3f 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 */