panfrost: Always shadow vertex elements buffers

Submitted by Alyssa Rosenzweig on March 15, 2019, 2:39 p.m.

Details

Message ID 20190315143939.4545-1-alyssa@rosenzweig.io
State New
Headers show
Series "panfrost: Always shadow vertex elements buffers" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Alyssa Rosenzweig March 15, 2019, 2:39 p.m.
There is no BO tracking for vertex buffers yet, so it is not safe to
directly map even when we can according to alignment restrictions. For
now, always create a shadow buffer.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
---
 src/gallium/drivers/panfrost/pan_context.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index b6cf5302cae..a255e09b886 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -691,7 +691,10 @@  panfrost_emit_vertex_data(struct panfrost_context *ctx)
 
                 mali_ptr effective_address = (rsrc->bo->gpu[0] + buf->buffer_offset);
 
-                if (effective_address & 0x3F) {
+                /* Due to lack of BO waits and such, it's not safe to direct
+                 * map ever yet, so always do a shadow buffer */
+
+                if (/*effective_address & 0x3F*/1) {
                         attrs[i].elements = panfrost_upload_transient(ctx, rsrc->bo->cpu[0] + buf->buffer_offset, attrs[i].size) | 1;
                 } else {
                         attrs[i].elements = effective_address | 1;