From 172082f235b5b55372c0efdf1182db2abd565f08 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Tue, 22 Jun 2021 14:55:10 -0700 Subject: [PATCH] freedreno: Update comments about PIPE_BUFFER shadowing. Part-of: --- src/gallium/drivers/freedreno/freedreno_resource.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index 89d27504286..56df34f769e 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -395,7 +395,11 @@ fd_try_shadow_resource(struct fd_context *ctx, struct fd_resource *rsc, if (!is_renderable(prsc)) fallback = true; - /* do shadowing back-blits on the cpu for buffers: */ + /* do shadowing back-blits on the cpu for buffers -- requires about a page of + * DMA to make GPU copies worth it according to robclark. Note, if you + * decide to do it on the GPU then you'll need to update valid_buffer_range + * in the swap()s below. + */ if (prsc->target == PIPE_BUFFER) fallback = true; @@ -437,7 +441,6 @@ fd_try_shadow_resource(struct fd_context *ctx, struct fd_resource *rsc, DBG("shadow: %p (%d, %p) -> %p (%d, %p)", rsc, rsc->b.b.reference.count, rsc->track, shadow, shadow->b.b.reference.count, shadow->track); - /* TODO valid_buffer_range?? */ swap(rsc->bo, shadow->bo); swap(rsc->layout, shadow->layout); rsc->seqno = p_atomic_inc_return(&ctx->screen->rsc_seqno);