From e5392e3d5fb93327d67aec8ca3834e9eacd3380a Mon Sep 17 00:00:00 2001 From: jinmiliu Date: Thu, 16 Apr 2026 10:10:51 -0400 Subject: [PATCH] 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 Part-of: --- src/mesa/state_tracker/st_manager.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index a42d0c36896..0e5d465de8f 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -23,6 +23,9 @@ * * Authors: * Chia-I Wu + * + * 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;