gallium/dri2: make protected buffer checks opt-in

This check is an infinite source of issues when testing protected
content, so make it opt-in (eg for developers of applications dealing
with protected content buffers).

On AMD and Intel importing a protected buffer as non-protected will cause
the display to be incorrect (= garbage).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11449>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2022-08-02 11:54:13 +02:00
committed by Marge Bot
parent 1862923849
commit 1d64308fe9
3 changed files with 5 additions and 5 deletions
@@ -46,7 +46,7 @@ DRI_CONF_SECTION_DEBUG
DRI_CONF_GLX_EXTENSION_OVERRIDE()
DRI_CONF_MESA_EXTENSION_OVERRIDE()
DRI_CONF_INDIRECT_GL_EXTENSION_OVERRIDE()
DRI_CONF_DISABLE_PROTECTED_CONTENT_CHECK(false)
DRI_CONF_FORCE_PROTECTED_CONTENT_CHECK(false)
DRI_CONF_IGNORE_MAP_UNSYNCHRONIZED(false)
DRI_CONF_FORCE_DIRECT_GLX_CONTEXT(false)
DRI_CONF_ALLOW_INVALID_GLX_DESTROY_WINDOW(false)
+1 -1
View File
@@ -957,7 +957,7 @@ dri2_create_image_from_winsys(__DRIscreen *_screen,
* content protection status of tex and img.
*/
const struct driOptionCache *optionCache = &screen->dev->option_cache;
if (!driQueryOptionb(optionCache, "disable_protected_content_check") &&
if (driQueryOptionb(optionCache, "force_protected_content_check") &&
(tex->bind & PIPE_BIND_PROTECTED) != (bind & PIPE_BIND_PROTECTED)) {
pipe_resource_reference(&img->texture, NULL);
pipe_resource_reference(&tex, NULL);
+3 -3
View File
@@ -282,9 +282,9 @@
DRI_CONF_OPT_S_NODEF(indirect_gl_extension_override, \
"Allow enabling/disabling a list of indirect-GL extensions")
#define DRI_CONF_DISABLE_PROTECTED_CONTENT_CHECK(def) \
DRI_CONF_OPT_B(disable_protected_content_check, def, \
"Don't reject image import if protected_content attribute doesn't match")
#define DRI_CONF_FORCE_PROTECTED_CONTENT_CHECK(def) \
DRI_CONF_OPT_B(force_protected_content_check, def, \
"Reject image import if protected_content attribute doesn't match")
#define DRI_CONF_IGNORE_MAP_UNSYNCHRONIZED(def) \
DRI_CONF_OPT_B(ignore_map_unsynchronized, def, \