From b377da912259eceee06cf678938ea667a79137a7 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 1 Jun 2021 14:03:37 +0200 Subject: [PATCH] radeonsi: allow write-only mapping of encrypted textures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_texture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index f15ed38b6ec..6e23c1b828a 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -1728,7 +1728,7 @@ static void *si_texture_transfer_map(struct pipe_context *ctx, struct pipe_resou struct si_resource *buf; unsigned offset = 0; char *map; - bool use_staging_texture = false; + bool use_staging_texture = tex->buffer.flags & RADEON_FLAG_ENCRYPTED; assert(!(texture->flags & SI_RESOURCE_FLAG_FORCE_LINEAR)); assert(box->width && box->height && box->depth); @@ -1736,7 +1736,7 @@ static void *si_texture_transfer_map(struct pipe_context *ctx, struct pipe_resou if (tex->buffer.b.b.flags & SI_RESOURCE_AUX_PLANE) return NULL; - if (tex->buffer.flags & RADEON_FLAG_ENCRYPTED) + if ((tex->buffer.flags & RADEON_FLAG_ENCRYPTED) && usage & PIPE_MAP_READ) return NULL; if (tex->is_depth) {