From 5e6f92f82cb383ee106c5b446c6f0a70b5a32145 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 1 Jun 2021 14:00:08 +0200 Subject: [PATCH] frontend/dri: set PIPE_BIND_PROTECTED later MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Cc: mesa-stable Part-of: --- src/gallium/frontends/dri/dri2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c index b664ad0dbe9..cb7d2478fe5 100644 --- a/src/gallium/frontends/dri/dri2.c +++ b/src/gallium/frontends/dri/dri2.c @@ -811,8 +811,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 && @@ -854,6 +852,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;