radeonsi: allow write-only mapping of encrypted textures

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11107>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2021-06-01 14:03:37 +02:00 committed by Marge Bot
parent fcdfe91efa
commit b377da9122

View file

@ -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) {