From 33c47da3fe513ea5e18169b2a668c95d59f53a3e Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 21 Jan 2025 10:34:28 +0100 Subject: [PATCH] frontends/va: Add CreateContext flag to enable protected context Reviewed-by: David (Ming Qiang) Wu Part-of: --- src/gallium/frontends/va/context.c | 3 +++ src/gallium/frontends/va/va_private.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/gallium/frontends/va/context.c b/src/gallium/frontends/va/context.c index 000369d2093..15cb2b70ae1 100644 --- a/src/gallium/frontends/va/context.c +++ b/src/gallium/frontends/va/context.c @@ -344,6 +344,9 @@ vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width, context->templat.height = picture_height; context->templat.expect_chunked_decode = true; + if (config->entrypoint == PIPE_VIDEO_ENTRYPOINT_BITSTREAM) + context->desc.base.protected_playback = flag & VL_VA_CREATE_CONTEXT_PROTECTED; + switch (u_reduce_video_profile(context->templat.profile)) { case PIPE_VIDEO_FORMAT_MPEG12: case PIPE_VIDEO_FORMAT_VC1: diff --git a/src/gallium/frontends/va/va_private.h b/src/gallium/frontends/va/va_private.h index 36b7e0b68cc..b32b6c9177d 100644 --- a/src/gallium/frontends/va/va_private.h +++ b/src/gallium/frontends/va/va_private.h @@ -100,6 +100,9 @@ VA_ENC_PACKED_HEADER_MISC | \ VA_ENC_PACKED_HEADER_RAW_DATA) +/* vaCreateContext flags */ +#define VL_VA_CREATE_CONTEXT_PROTECTED (1 << 16) + static inline enum pipe_video_chroma_format ChromaToPipe(int format) {