mesa/st: Set protected content context flag based on pipe context attributes

If the PIPE_CONTEXT_PROTECTED flag is set in the context attributes,
propagate this by enabling GL_CONTEXT_FLAG_PROTECTED_CONTENT_BIT_EXT
on the corresponding Mesa GL context.

Signed-off-by: jinmiliu <jinming.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40998>
This commit is contained in:
jinmiliu 2026-04-16 10:10:51 -04:00 committed by Marge Bot
parent 7a627fa8f3
commit e5392e3d5f

View file

@ -23,6 +23,9 @@
*
* Authors:
* Chia-I Wu <olv@lunarg.com>
*
* Modifications Copyright (C) 2025-2026 Advanced Micro Devices, Inc. All rights reserved.
*
*/
#include "main/mtypes.h"
@ -1020,6 +1023,9 @@ st_api_create_context(struct pipe_frontend_screen *fscreen,
return NULL;
}
if (attribs->context_flags & PIPE_CONTEXT_PROTECTED)
st->ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_PROTECTED_CONTENT_BIT_EXT;
if (attribs->flags & ST_CONTEXT_FLAG_DEBUG) {
if (!_mesa_set_debug_state_int(st->ctx, GL_DEBUG_OUTPUT, GL_TRUE)) {
*error = ST_CONTEXT_ERROR_NO_MEMORY;