From 1fee3061d531a9f4068952209926ad518aab07ee Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Fri, 3 Apr 2015 02:25:58 -0400 Subject: [PATCH] freedreno: add a reading flag to indicate gpu is reading rsc Signed-off-by: Ilia Mirkin --- src/gallium/drivers/freedreno/freedreno_resource.c | 3 ++- src/gallium/drivers/freedreno/freedreno_resource.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index 407a3528aaa..6e7958d42dd 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -123,7 +123,8 @@ fd_resource_transfer_map(struct pipe_context *pctx, /* If the GPU is writing to the resource, or if it is reading from the * resource and we're trying to write to it, flush the renders. */ - if (rsc->dirty) + if (rsc->dirty || + ((ptrans->usage & PIPE_TRANSFER_WRITE) && rsc->reading)) fd_context_render(pctx); /* The GPU keeps track of how the various bo's are being used, and diff --git a/src/gallium/drivers/freedreno/freedreno_resource.h b/src/gallium/drivers/freedreno/freedreno_resource.h index bad36813461..1f246328969 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.h +++ b/src/gallium/drivers/freedreno/freedreno_resource.h @@ -66,7 +66,7 @@ struct fd_resource { uint32_t layer_size; struct fd_resource_slice slices[MAX_MIP_LEVELS]; uint32_t timestamp; - bool dirty; + bool dirty, reading; }; static INLINE struct fd_resource * -- 2.30.2