Mesa (staging/21.1): frontend/dri: set PIPE_BIND_PROTECTED later
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat Jun 5 16:30:19 UTC 2021
Module: Mesa
Branch: staging/21.1
Commit: dd5aa66b9eab3e9c42c1a214b3cc38e73b6eab59
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dd5aa66b9eab3e9c42c1a214b3cc38e73b6eab59
Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date: Tue Jun 1 14:00:08 2021 +0200
frontend/dri: set PIPE_BIND_PROTECTED later
NV12, YUV, YUYV and UYVY handling checks !tex_usage so set
PIPE_BIND_PROTECTED after.
This fixes encrypted nv12 textures handling.
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11107>
(cherry picked from commit 5e6f92f82cb383ee106c5b446c6f0a70b5a32145)
---
.pick_status.json | 2 +-
src/gallium/frontends/dri/dri2.c | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index 7b414abb534..7aea7a33908 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -787,7 +787,7 @@
"description": "frontend/dri: set PIPE_BIND_PROTECTED later",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": null
},
diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c
index 59698719978..b6a05f47554 100644
--- a/src/gallium/frontends/dri/dri2.c
+++ b/src/gallium/frontends/dri/dri2.c
@@ -761,8 +761,6 @@ dri2_create_image_from_winsys(__DRIscreen *_screen,
if (pscreen->is_format_supported(pscreen, map->pipe_format, screen->target, 0, 0,
PIPE_BIND_SAMPLER_VIEW))
tex_usage |= PIPE_BIND_SAMPLER_VIEW;
- if (is_protected_content)
- tex_usage |= PIPE_BIND_PROTECTED;
/* For NV12, see if we have support for sampling r8_b8g8 */
if (!tex_usage && map->pipe_format == PIPE_FORMAT_NV12 &&
@@ -787,6 +785,9 @@ dri2_create_image_from_winsys(__DRIscreen *_screen,
if (!tex_usage)
return NULL;
+ if (is_protected_content)
+ tex_usage |= PIPE_BIND_PROTECTED;
+
img = CALLOC_STRUCT(__DRIimageRec);
if (!img)
return NULL;
More information about the mesa-commit
mailing list