diff --git a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h index f90112f25d9..6a166f15fcb 100644 --- a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h +++ b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h @@ -39,6 +39,7 @@ DRI_CONF_SECTION_DEBUG DRI_CONF_OVERRIDE_VRAM_SIZE() DRI_CONF_GLX_EXTENSION_OVERRIDE() DRI_CONF_INDIRECT_GL_EXTENSION_OVERRIDE() + DRI_CONF_DISABLE_PROTECTED_CONTENT_CHECK(false) DRI_CONF_SECTION_END DRI_CONF_SECTION_MISCELLANEOUS diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c index b464eaba6ee..6571b34cf6b 100644 --- a/src/gallium/frontends/dri/dri2.c +++ b/src/gallium/frontends/dri/dri2.c @@ -833,7 +833,9 @@ dri2_create_image_from_winsys(__DRIscreen *_screen, /* Reject image creation if there's an inconsistency between * content protection status of tex and img. */ - if ((tex->bind & PIPE_BIND_PROTECTED) != is_protected_content) { + const struct driOptionCache *optionCache = &screen->dev->option_cache; + if (!driQueryOptionb(optionCache, "disable_protected_content_check") && + (tex->bind & PIPE_BIND_PROTECTED) != is_protected_content) { pipe_resource_reference(&img->texture, NULL); pipe_resource_reference(&tex, NULL); FREE(img); diff --git a/src/util/driconf.h b/src/util/driconf.h index 60d1314f888..7f838cdf6ad 100644 --- a/src/util/driconf.h +++ b/src/util/driconf.h @@ -225,6 +225,9 @@ DRI_CONF_OPT_S(indirect_gl_extension_override, def, \ "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") /** * \brief Image quality-related options