parent
b820034d32
commit
4f7f8e056e
@ -0,0 +1,567 @@
|
|||||||
|
From 7ae60470cdb0bea4548a0f5e8271b359f9450c79 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jeffrey Kardatzke <jkardatzke@google.com>
|
||||||
|
Date: Fri, 5 Feb 2021 03:33:58 +0000
|
||||||
|
Subject: [PATCH] vaapi: Update for libva forwards compatibility
|
||||||
|
|
||||||
|
There was a downstream patch applied for protected content for libva.
|
||||||
|
This patch is now upstreamed, but is not compatible with the downstream
|
||||||
|
version. This change will allow us to update libva in ChromeOS to an
|
||||||
|
intermediate version that'll be compatible with both downstream and
|
||||||
|
upstream. Then we can shift Chrome to the upstream API, and then remove
|
||||||
|
the downstream compatibility layer from ChromeOS after that and be on
|
||||||
|
upstream.
|
||||||
|
|
||||||
|
BUG=b:174951211
|
||||||
|
TEST=Chrome builds, protected content plays back
|
||||||
|
|
||||||
|
Change-Id: Id06b21daf19a54b340236b354b5f4a828e2362de
|
||||||
|
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2672690
|
||||||
|
Reviewed-by: Andres Calderon Jaramillo <andrescj@chromium.org>
|
||||||
|
Reviewed-by: J Kardatzke <jkardatzke@chromium.org>
|
||||||
|
Commit-Queue: J Kardatzke <jkardatzke@chromium.org>
|
||||||
|
Cr-Commit-Position: refs/heads/master@{#850949}
|
||||||
|
---
|
||||||
|
.../h264_vaapi_video_decoder_delegate.cc | 7 +
|
||||||
|
.../vaapi/h265_vaapi_video_decoder_delegate.h | 7 +
|
||||||
|
media/gpu/vaapi/va_prot.sigs | 1 -
|
||||||
|
media/gpu/vaapi/vaapi_utils.h | 7 +
|
||||||
|
.../gpu/vaapi/vaapi_video_decoder_delegate.cc | 11 +-
|
||||||
|
.../gpu/vaapi/vaapi_video_decoder_delegate.h | 7 +
|
||||||
|
media/gpu/vaapi/vaapi_wrapper.cc | 30 +--
|
||||||
|
media/gpu/vaapi/vaapi_wrapper.h | 7 +
|
||||||
|
.../va_protected_content.h | 225 ++----------------
|
||||||
|
tools/metrics/histograms/enums.xml | 2 +-
|
||||||
|
10 files changed, 75 insertions(+), 229 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.cc b/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.cc
|
||||||
|
index 6e82506082ede..22fa594610540 100644
|
||||||
|
--- a/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.cc
|
||||||
|
+++ b/media/gpu/vaapi/h264_vaapi_video_decoder_delegate.cc
|
||||||
|
@@ -4,6 +4,13 @@
|
||||||
|
|
||||||
|
#include "media/gpu/vaapi/h264_vaapi_video_decoder_delegate.h"
|
||||||
|
|
||||||
|
+// TODO(jkardatzke): Remove this once the transition to the new upstream
|
||||||
|
+// protected content API is complete. This is used to bridge a transition
|
||||||
|
+// between the libva pull request we used, and what actually landed upstream.
|
||||||
|
+#ifndef LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
+#define LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#include <va/va.h>
|
||||||
|
|
||||||
|
#include "base/memory/aligned_memory.h"
|
||||||
|
diff --git a/media/gpu/vaapi/h265_vaapi_video_decoder_delegate.h b/media/gpu/vaapi/h265_vaapi_video_decoder_delegate.h
|
||||||
|
index d152c3df8a90a..986c2b530076e 100644
|
||||||
|
--- a/media/gpu/vaapi/h265_vaapi_video_decoder_delegate.h
|
||||||
|
+++ b/media/gpu/vaapi/h265_vaapi_video_decoder_delegate.h
|
||||||
|
@@ -5,6 +5,13 @@
|
||||||
|
#ifndef MEDIA_GPU_VAAPI_H265_VAAPI_VIDEO_DECODER_DELEGATE_H_
|
||||||
|
#define MEDIA_GPU_VAAPI_H265_VAAPI_VIDEO_DECODER_DELEGATE_H_
|
||||||
|
|
||||||
|
+// TODO(jkardatzke): Remove this once the transition to the new upstream
|
||||||
|
+// protected content API is complete. This is used to bridge a transition
|
||||||
|
+// between the libva pull request we used, and what actually landed upstream.
|
||||||
|
+#ifndef LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
+#define LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#include <va/va.h>
|
||||||
|
|
||||||
|
#include "base/memory/scoped_refptr.h"
|
||||||
|
diff --git a/media/gpu/vaapi/va_prot.sigs b/media/gpu/vaapi/va_prot.sigs
|
||||||
|
index 1ffcd61778d11..dd13dafef1add 100644
|
||||||
|
--- a/media/gpu/vaapi/va_prot.sigs
|
||||||
|
+++ b/media/gpu/vaapi/va_prot.sigs
|
||||||
|
@@ -9,5 +9,4 @@ VAStatus vaCreateProtectedSession(VADisplay dpy, VAConfigID config_id, VAProtect
|
||||||
|
VAStatus vaDestroyProtectedSession(VADisplay dpy, VAProtectedSessionID protected_session);
|
||||||
|
VAStatus vaAttachProtectedSession(VADisplay dpy, VAContextID reserved, VAProtectedSessionID protected_session);
|
||||||
|
VAStatus vaDetachProtectedSession(VADisplay dpy, VAContextID reserved);
|
||||||
|
-VAStatus vaProtectedSessionHwUpdate(VADisplay dpy, VAProtectedSessionID protected_session, VABufferID buf_id);
|
||||||
|
VAStatus vaProtectedSessionExecute(VADisplay dpy, VAProtectedSessionID protected_session, VABufferID buf_id);
|
||||||
|
\ No newline at end of file
|
||||||
|
diff --git a/media/gpu/vaapi/vaapi_utils.h b/media/gpu/vaapi/vaapi_utils.h
|
||||||
|
index 9bcee23ce96d1..fd42ad2a148e3 100644
|
||||||
|
--- a/media/gpu/vaapi/vaapi_utils.h
|
||||||
|
+++ b/media/gpu/vaapi/vaapi_utils.h
|
||||||
|
@@ -5,6 +5,13 @@
|
||||||
|
#ifndef MEDIA_GPU_VAAPI_VAAPI_UTILS_H_
|
||||||
|
#define MEDIA_GPU_VAAPI_VAAPI_UTILS_H_
|
||||||
|
|
||||||
|
+// TODO(jkardatzke): Remove this once the transition to the new upstream
|
||||||
|
+// protected content API is complete. This is used to bridge a transition
|
||||||
|
+// between the libva pull request we used, and what actually landed upstream.
|
||||||
|
+#ifndef LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
+#define LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#include <va/va.h>
|
||||||
|
|
||||||
|
#include "base/callback_forward.h"
|
||||||
|
diff --git a/media/gpu/vaapi/vaapi_video_decoder_delegate.cc b/media/gpu/vaapi/vaapi_video_decoder_delegate.cc
|
||||||
|
index 07b7b3ce03f1b..a0a8ea67bd8c6 100644
|
||||||
|
--- a/media/gpu/vaapi/vaapi_video_decoder_delegate.cc
|
||||||
|
+++ b/media/gpu/vaapi/vaapi_video_decoder_delegate.cc
|
||||||
|
@@ -133,11 +133,13 @@ VaapiVideoDecoderDelegate::SetupDecryptDecode(
|
||||||
|
DCHECK_EQ(protected_session_state_, ProtectedSessionState::kCreated);
|
||||||
|
|
||||||
|
if (encryption_scheme_ == EncryptionScheme::kCenc) {
|
||||||
|
- crypto_params->encryption_type =
|
||||||
|
- full_sample ? VA_ENCRYPTION_TYPE_CENC_CTR : VA_ENCRYPTION_TYPE_CTR_128;
|
||||||
|
+ crypto_params->encryption_type = full_sample
|
||||||
|
+ ? VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR
|
||||||
|
+ : VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR;
|
||||||
|
} else {
|
||||||
|
- crypto_params->encryption_type =
|
||||||
|
- full_sample ? VA_ENCRYPTION_TYPE_CENC_CBC : VA_ENCRYPTION_TYPE_CBC;
|
||||||
|
+ crypto_params->encryption_type = full_sample
|
||||||
|
+ ? VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC
|
||||||
|
+ : VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC;
|
||||||
|
}
|
||||||
|
|
||||||
|
// For multi-slice we may already have segment information in here, so
|
||||||
|
@@ -224,6 +226,7 @@ VaapiVideoDecoderDelegate::SetupDecryptDecode(
|
||||||
|
memcpy(crypto_params->wrapped_decrypt_blob,
|
||||||
|
hw_key_data_map_[decrypt_config_->key_id()].data(),
|
||||||
|
DecryptConfig::kDecryptionKeySize);
|
||||||
|
+ crypto_params->key_blob_size = DecryptConfig::kDecryptionKeySize;
|
||||||
|
crypto_params->segment_info = &segments->front();
|
||||||
|
#else // if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||||
|
protected_session_state_ = ProtectedSessionState::kFailed;
|
||||||
|
diff --git a/media/gpu/vaapi/vaapi_video_decoder_delegate.h b/media/gpu/vaapi/vaapi_video_decoder_delegate.h
|
||||||
|
index 1e222a41c543c..aeb48a75bd2c9 100644
|
||||||
|
--- a/media/gpu/vaapi/vaapi_video_decoder_delegate.h
|
||||||
|
+++ b/media/gpu/vaapi/vaapi_video_decoder_delegate.h
|
||||||
|
@@ -5,6 +5,13 @@
|
||||||
|
#ifndef MEDIA_GPU_VAAPI_VAAPI_VIDEO_DECODER_DELEGATE_H_
|
||||||
|
#define MEDIA_GPU_VAAPI_VAAPI_VIDEO_DECODER_DELEGATE_H_
|
||||||
|
|
||||||
|
+// TODO(jkardatzke): Remove this once the transition to the new upstream
|
||||||
|
+// protected content API is complete. This is used to bridge a transition
|
||||||
|
+// between the libva pull request we used, and what actually landed upstream.
|
||||||
|
+#ifndef LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
+#define LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc
|
||||||
|
index 696ffaf00d866..cd2ee37998fbd 100644
|
||||||
|
--- a/media/gpu/vaapi/vaapi_wrapper.cc
|
||||||
|
+++ b/media/gpu/vaapi/vaapi_wrapper.cc
|
||||||
|
@@ -133,7 +133,7 @@ enum class VaapiFunctions {
|
||||||
|
kVADestroyProtectedSession = 26,
|
||||||
|
kVAAttachProtectedSession = 27,
|
||||||
|
kVADetachProtectedSession = 28,
|
||||||
|
- kVAProtectedSessionHwUpdate = 29,
|
||||||
|
+ kVAProtectedSessionHwUpdate_Deprecated = 29,
|
||||||
|
kVAProtectedSessionExecute = 30,
|
||||||
|
// Anything else is captured in this last entry.
|
||||||
|
kOtherVAFunction = 31,
|
||||||
|
@@ -176,7 +176,7 @@ constexpr std::array<const char*,
|
||||||
|
"vaDestroyProtectedSession",
|
||||||
|
"vaAttachProtectedSession",
|
||||||
|
"vaDetachProtectedSession",
|
||||||
|
- "vaProtectedSessionHwUpdate",
|
||||||
|
+ "vaProtectedSessionHwUpdate (Deprecated)",
|
||||||
|
"vaProtectedSessionExecute",
|
||||||
|
"Other VA function"};
|
||||||
|
|
||||||
|
@@ -811,7 +811,7 @@ bool GetRequiredAttribs(const base::Lock* va_lock,
|
||||||
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||||
|
if (mode == VaapiWrapper::kDecodeProtected && profile != VAProfileProtected) {
|
||||||
|
required_attribs->push_back(
|
||||||
|
- {VAConfigAttribEncryption, VA_ENCRYPTION_TYPE_CTR_128});
|
||||||
|
+ {VAConfigAttribEncryption, VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR});
|
||||||
|
required_attribs->push_back(
|
||||||
|
{VAConfigAttribDecProcessing, VA_DEC_PROCESSING});
|
||||||
|
}
|
||||||
|
@@ -1852,13 +1852,14 @@ bool VaapiWrapper::CreateProtectedSession(
|
||||||
|
// We have to hold the VABuffer outside of the lock because its destructor
|
||||||
|
// will acquire the lock when it goes out of scope. We also must do this after
|
||||||
|
// we create the protected session.
|
||||||
|
- VAProtectedSessionHwUpdateBuffer hw_update_buf;
|
||||||
|
+ VAProtectedSessionExecuteBuffer hw_update_buf;
|
||||||
|
std::unique_ptr<ScopedVABuffer> hw_update = CreateVABuffer(
|
||||||
|
- VAProtectedSessionHwUpdateBufferType, sizeof(hw_update_buf));
|
||||||
|
+ VAProtectedSessionExecuteBufferType, sizeof(hw_update_buf));
|
||||||
|
{
|
||||||
|
base::AutoLock auto_lock(*va_lock_);
|
||||||
|
constexpr size_t kHwIdentifierMaxSize = 64;
|
||||||
|
memset(&hw_update_buf, 0, sizeof(hw_update_buf));
|
||||||
|
+ hw_update_buf.function_id = VA_TEE_EXEC_TEE_FUNCID_HW_UPDATE;
|
||||||
|
hw_update_buf.input.data_size = hw_config.size();
|
||||||
|
hw_update_buf.input.data =
|
||||||
|
static_cast<void*>(const_cast<uint8_t*>(hw_config.data()));
|
||||||
|
@@ -1868,22 +1869,22 @@ bool VaapiWrapper::CreateProtectedSession(
|
||||||
|
if (!MapAndCopy_Locked(
|
||||||
|
hw_update->id(),
|
||||||
|
{hw_update->type(), hw_update->size(), &hw_update_buf})) {
|
||||||
|
- LOG(ERROR) << "Failed mapping HwUpdate buf";
|
||||||
|
+ LOG(ERROR) << "Failed mapping Execute buf";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
- VAStatus va_res = vaProtectedSessionHwUpdate(
|
||||||
|
+ VAStatus va_res = vaProtectedSessionExecute(
|
||||||
|
va_display_, va_protected_session_id_, hw_update->id());
|
||||||
|
- VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAProtectedSessionHwUpdate,
|
||||||
|
+ VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAProtectedSessionExecute,
|
||||||
|
false);
|
||||||
|
|
||||||
|
ScopedVABufferMapping mapping(va_lock_, va_display_, hw_update->id());
|
||||||
|
if (!mapping.IsValid()) {
|
||||||
|
- LOG(ERROR) << "Failed mapping returned HwUpdate buf";
|
||||||
|
+ LOG(ERROR) << "Failed mapping returned Execute buf";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
auto* hw_update_buf_out =
|
||||||
|
- reinterpret_cast<VAProtectedSessionHwUpdateBuffer*>(mapping.data());
|
||||||
|
+ reinterpret_cast<VAProtectedSessionExecuteBuffer*>(mapping.data());
|
||||||
|
if (!hw_update_buf_out->output.data_size) {
|
||||||
|
LOG(ERROR) << "Received empty HW identifier";
|
||||||
|
return false;
|
||||||
|
@@ -1964,10 +1965,9 @@ bool VaapiWrapper::IsProtectedSessionDead() {
|
||||||
|
if (va_protected_session_id_ == VA_INVALID_ID)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
- constexpr uint32_t kVaTeeExecGpuFuncIdIsSessionAlive = 0x40000103;
|
||||||
|
uint8_t alive;
|
||||||
|
VAProtectedSessionExecuteBuffer tee_exec_buf = {};
|
||||||
|
- tee_exec_buf.function_id = kVaTeeExecGpuFuncIdIsSessionAlive;
|
||||||
|
+ tee_exec_buf.function_id = VA_TEE_EXEC_TEE_FUNCID_IS_SESSION_ALIVE;
|
||||||
|
tee_exec_buf.input.data_size = 0;
|
||||||
|
tee_exec_buf.input.data = nullptr;
|
||||||
|
tee_exec_buf.output.data_size = sizeof(alive);
|
||||||
|
@@ -2518,7 +2518,7 @@ std::unique_ptr<ScopedVABuffer> VaapiWrapper::CreateVABuffer(VABufferType type,
|
||||||
|
base::AutoLock auto_lock(*va_lock_);
|
||||||
|
TRACE_EVENT0("media,gpu", "VaapiWrapper::CreateVABufferLocked");
|
||||||
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||||
|
- VAContextID context_id = type == VAProtectedSessionHwUpdateBufferType
|
||||||
|
+ VAContextID context_id = type == VAProtectedSessionExecuteBufferType
|
||||||
|
? va_protected_session_id_
|
||||||
|
: va_context_id_;
|
||||||
|
#else
|
||||||
|
@@ -2807,8 +2807,8 @@ bool VaapiWrapper::Initialize(CodecMode mode,
|
||||||
|
for (auto& attrib : required_attribs) {
|
||||||
|
if (attrib.type == VAConfigAttribEncryption) {
|
||||||
|
attrib.value = (encryption_scheme == EncryptionScheme::kCbcs)
|
||||||
|
- ? VA_ENCRYPTION_TYPE_CBC
|
||||||
|
- : VA_ENCRYPTION_TYPE_CTR_128;
|
||||||
|
+ ? VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC
|
||||||
|
+ : VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/media/gpu/vaapi/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h
|
||||||
|
index 29b6864998240..f58723a0e852e 100644
|
||||||
|
--- a/media/gpu/vaapi/vaapi_wrapper.h
|
||||||
|
+++ b/media/gpu/vaapi/vaapi_wrapper.h
|
||||||
|
@@ -10,6 +10,13 @@
|
||||||
|
#ifndef MEDIA_GPU_VAAPI_VAAPI_WRAPPER_H_
|
||||||
|
#define MEDIA_GPU_VAAPI_VAAPI_WRAPPER_H_
|
||||||
|
|
||||||
|
+// TODO(jkardatzke): Remove this once the transition to the new upstream
|
||||||
|
+// protected content API is complete. This is used to bridge a transition
|
||||||
|
+// between the libva pull request we used, and what actually landed upstream.
|
||||||
|
+#ifndef LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
+#define LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <va/va.h>
|
||||||
|
diff --git a/third_party/libva_protected_content/va_protected_content.h b/third_party/libva_protected_content/va_protected_content.h
|
||||||
|
index dfea3ce94a285..c14a77da41389 100644
|
||||||
|
--- a/third_party/libva_protected_content/va_protected_content.h
|
||||||
|
+++ b/third_party/libva_protected_content/va_protected_content.h
|
||||||
|
@@ -46,6 +46,7 @@ extern "C" {
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
+#ifdef LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* A protected content function for processing cipher protected content.
|
||||||
|
@@ -97,16 +98,19 @@ extern "C" {
|
||||||
|
/** \brief Encryption parameters buffer for content protection usage */
|
||||||
|
#define VAEncryptionParameterBufferType ((VABufferType)0x20001)
|
||||||
|
|
||||||
|
+#endif // LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
+
|
||||||
|
/**\brief CENC status paramter, used for vendor content protection only.
|
||||||
|
* The buffer corresponds to #VACencStatusParameters for va/cp*/
|
||||||
|
#define VACencStatusParameterBufferType ((VABufferType)0x20002)
|
||||||
|
|
||||||
|
+#ifdef LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
/** attribute values for VAConfigAttribEncryption */
|
||||||
|
#define VA_ENCRYPTION_TYPE_NONE 0x00000000
|
||||||
|
-#define VA_ENCRYPTION_TYPE_CENC_CBC 0x00000002
|
||||||
|
-#define VA_ENCRYPTION_TYPE_CENC_CTR 0x00000008
|
||||||
|
-#define VA_ENCRYPTION_TYPE_CTR_128 0x00000010
|
||||||
|
-#define VA_ENCRYPTION_TYPE_CBC 0x00000020
|
||||||
|
+#define VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC 0x00000002
|
||||||
|
+#define VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR 0x00000008
|
||||||
|
+#define VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR 0x00000010
|
||||||
|
+#define VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC 0x00000020
|
||||||
|
|
||||||
|
/** attribute values for VAConfigAttribContentProtectionSessionMode */
|
||||||
|
#define VA_PC_SESSION_MODE_NONE 0x00000000
|
||||||
|
@@ -132,18 +136,11 @@ extern "C" {
|
||||||
|
#define VA_PC_SAMPLE_TYPE_FULLSAMPLE 0x00000001
|
||||||
|
#define VA_PC_SAMPLE_TYPE_SUBSAMPLE 0x00000002
|
||||||
|
|
||||||
|
-/** \brief TeeExec Function Codes. */
|
||||||
|
-typedef enum _VA_TEE_EXEC_FUNCTION_ID {
|
||||||
|
- VA_TEE_EXEC_TEE_FUNCID_PASS_THROUGH_NONE = 0x0,
|
||||||
|
-
|
||||||
|
- // 0x40000000~0x400000FFF reserved for TEE Exec GPU function
|
||||||
|
- VA_TEE_EXEC_GPU_FUNCID_ENCRYPTION_BLT = 0x40000000,
|
||||||
|
- VA_TEE_EXEC_GPU_FUNCID_DECRYPTION_BLT = 0x40000001,
|
||||||
|
+#endif // LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
|
||||||
|
- // 0x40001000~0x400001FFF reserved for TEE Exec TEE function
|
||||||
|
- VA_TEE_EXEC_TEE_FUNCID_PASS_THROUGH = 0x40001000,
|
||||||
|
-
|
||||||
|
-} VA_TEE_EXEC_FUNCTION_ID;
|
||||||
|
+/** \brief TeeExec Function Codes. */
|
||||||
|
+#define VA_TEE_EXEC_TEE_FUNCID_HW_UPDATE 0x40000002
|
||||||
|
+#define VA_TEE_EXEC_TEE_FUNCID_IS_SESSION_ALIVE 0x40000103
|
||||||
|
|
||||||
|
/** \brief values for the encryption return status. */
|
||||||
|
typedef enum {
|
||||||
|
@@ -159,6 +156,7 @@ typedef enum {
|
||||||
|
VA_ENCRYPTION_STATUS_UNSUPPORT
|
||||||
|
} VAEncryptionStatus;
|
||||||
|
|
||||||
|
+#ifdef LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
/** \brief structure for encrypted segment info. */
|
||||||
|
typedef struct _VAEncryptionSegmentInfo {
|
||||||
|
/** \brief The offset relative to the start of the bitstream input in
|
||||||
|
@@ -212,23 +210,12 @@ typedef struct _VAEncryptionParameters {
|
||||||
|
* encrypted, i.e. the CENC or CBC1 scheme is being used.
|
||||||
|
*/
|
||||||
|
uint32_t blocks_stripe_clear;
|
||||||
|
+ /* Forwards compatibility */
|
||||||
|
+ uint32_t key_blob_size;
|
||||||
|
/** \brief Reserved bytes for future use, must be zero */
|
||||||
|
- uint32_t va_reserved[VA_PADDING_MEDIUM];
|
||||||
|
+ uint32_t va_reserved[VA_PADDING_MEDIUM - sizeof(uint32_t)];
|
||||||
|
} VAEncryptionParameters;
|
||||||
|
-
|
||||||
|
-/** \brief structure for VA_TEE_EXEC_GPU_FUNCID_ENCRYPTION_BLT */
|
||||||
|
-typedef struct _VA_PROTECTED_BLT_PARAMS {
|
||||||
|
- uint8_t* src_resource; // The source resource which contains the clear data.
|
||||||
|
- uint8_t*
|
||||||
|
- dst_resource; // The Destination resource. This resource will contain the
|
||||||
|
- // encrypted data. It should be allocated by the caller.
|
||||||
|
- uint32_t width; // The width of the surface in Bytes.
|
||||||
|
- uint32_t height; // The height of the surface in Bytes (pay attention that
|
||||||
|
- // for NV12 the height(Bytes) = 1.5*height(Pixel)).
|
||||||
|
- VAEncryptionParameters*
|
||||||
|
- enc_params; // The encryption parameters as defined by application
|
||||||
|
- void* reserved_extension; // The reserved extension for future BLT operations
|
||||||
|
-} VA_PROTECTED_BLT_PARAMS;
|
||||||
|
+#endif // LEGACY_UPSTREAM_PROTECTED_LIBVA
|
||||||
|
|
||||||
|
/** \brief cenc status parameters, corresponding to
|
||||||
|
* #VACencStatusParameterBufferType*/
|
||||||
|
@@ -311,184 +298,6 @@ typedef struct _VACencSliceParameterBufferH264 {
|
||||||
|
uint32_t va_reserved[VA_PADDING_MEDIUM];
|
||||||
|
} VACencSliceParameterBufferH264;
|
||||||
|
|
||||||
|
-/**
|
||||||
|
- * \brief Slice parameter for HEVC cenc decode in main & main 10 profiles.
|
||||||
|
- *
|
||||||
|
- * This structure holds information for \c
|
||||||
|
- * slice_segment_header() and nal_unit_header() of the slice as
|
||||||
|
- * defined by the HEVC specification.
|
||||||
|
- *
|
||||||
|
- */
|
||||||
|
-typedef struct _VACencSliceParameterBufferHEVC {
|
||||||
|
- /** \brief Same as the HEVC bitstream syntax element. */
|
||||||
|
- uint8_t nal_unit_type;
|
||||||
|
- /** \brief Corresponds to the HEVC bitstream syntax element.
|
||||||
|
- * Same as nuh_temporal_id_plus1 - 1*/
|
||||||
|
- uint8_t nuh_temporal_id;
|
||||||
|
- /** \brief Slice type.
|
||||||
|
- * Corresponds to HEVC syntax element of the same name. */
|
||||||
|
- uint8_t slice_type;
|
||||||
|
- /** \brief Same as the HEVC bitstream syntax element. */
|
||||||
|
- uint16_t slice_pic_order_cnt_lsb;
|
||||||
|
- /** \brief Indicates EOS_NUT or EOB_NUT is detected in picture. */
|
||||||
|
- uint16_t has_eos_or_eob;
|
||||||
|
-
|
||||||
|
- union {
|
||||||
|
- struct {
|
||||||
|
- /** \brief Same as the HEVC bitstream syntax element */
|
||||||
|
- uint32_t no_output_of_prior_pics_flag : 1;
|
||||||
|
- /** \brief Same as the HEVC bitstream syntax element */
|
||||||
|
- uint32_t pic_output_flag : 1;
|
||||||
|
- /** \brief Same as the HEVC bitstream syntax element */
|
||||||
|
- uint32_t colour_plane_id : 2;
|
||||||
|
- /** \brief Reserved for future use, must be zero */
|
||||||
|
- uint32_t reserved : 19;
|
||||||
|
- } bits;
|
||||||
|
- uint32_t value;
|
||||||
|
- } slice_fields;
|
||||||
|
-
|
||||||
|
- /** \brief Parameters for driver reference frame set */
|
||||||
|
- /**@{*/
|
||||||
|
-
|
||||||
|
- /** \brief number of entries as current before in short-term rps
|
||||||
|
- * Corresponds to NumPocStCurrBefore as the HEVC specification. */
|
||||||
|
- uint8_t num_of_curr_before;
|
||||||
|
- /** \brief number of entries as current after in short-term rps
|
||||||
|
- * Corresponds to NumPocStCurrAfter as the HEVC specification. */
|
||||||
|
- uint8_t num_of_curr_after;
|
||||||
|
- /** \brief number of entries as current total in short-term rps*/
|
||||||
|
- uint8_t num_of_curr_total;
|
||||||
|
- /** \brief number of entries as foll in short-term rps
|
||||||
|
- * Corresponds to NumPocStFoll as the HEVC specification.*/
|
||||||
|
- uint8_t num_of_foll_st;
|
||||||
|
- /** \brief number of entries as current in long-term rps
|
||||||
|
- * Corresponds to NumPocLtCurr as the HEVC specification. */
|
||||||
|
- uint8_t num_of_curr_lt;
|
||||||
|
- /** \brief number of entries as foll in long-term rps
|
||||||
|
- * Corresponds to NumPocLtFoll as the HEVC specification.*/
|
||||||
|
- uint8_t num_of_foll_lt;
|
||||||
|
- /** \brief delta poc as short-term current before
|
||||||
|
- * Corresponds to PocStCurrBefore as the HEVC specification. */
|
||||||
|
- int32_t delta_poc_curr_before[8];
|
||||||
|
- /** \brief delta poc as short-term current after
|
||||||
|
- * Corresponds to PocStCurrAfter, as the HEVC specification.*/
|
||||||
|
- int32_t delta_poc_curr_after[8];
|
||||||
|
- /** \brief delta poc as short-term current total */
|
||||||
|
- int32_t delta_poc_curr_total[8];
|
||||||
|
- /** \brief delta poc as short-term foll
|
||||||
|
- * Corresponds to PocStFoll as the HEVC specification.*/
|
||||||
|
- int32_t delta_poc_foll_st[16];
|
||||||
|
- /** \brief delta poc as long-term current
|
||||||
|
- * Corresponds to PocLtCurr as the HEVC specification.*/
|
||||||
|
- int32_t delta_poc_curr_lt[8];
|
||||||
|
- /** \brief delta poc as long-term foll
|
||||||
|
- * Corresponds to PocLtFoll, as the HEVC specification.*/
|
||||||
|
- int32_t delta_poc_foll_lt[16];
|
||||||
|
- /** \brief delta poc msb present flag
|
||||||
|
- * Same as the HEVC bitstream syntax element. */
|
||||||
|
- uint8_t delta_poc_msb_present_flag[16];
|
||||||
|
- /** \brief long-term reference RPS is used for reference by current picture*/
|
||||||
|
- uint8_t is_lt_curr_total[8];
|
||||||
|
- /** \brief index of reference picture list. [0] is for P and B slice, [1] is
|
||||||
|
- * for B slice*/
|
||||||
|
- uint8_t ref_list_idx[2][16];
|
||||||
|
- /**@}*/
|
||||||
|
- /** \brief Pointer to the next #VACencSliceParameterBufferHEVC element,
|
||||||
|
- * or \c nullptr if there is none.*/
|
||||||
|
- void* next;
|
||||||
|
-
|
||||||
|
- /** \brief Reserved bytes for future use, must be zero */
|
||||||
|
- uint32_t va_reserved[VA_PADDING_MEDIUM];
|
||||||
|
-} VACencSliceParameterBufferHEVC;
|
||||||
|
-
|
||||||
|
-/**
|
||||||
|
- * \brief uncompressed header for VP9 cenc decode
|
||||||
|
- *
|
||||||
|
- * This structure holds information for \c
|
||||||
|
- * uncompressed_header() as defined by the VP9 specification.
|
||||||
|
- *
|
||||||
|
- */
|
||||||
|
-typedef struct _VACencSliceParameterBufferVP9 {
|
||||||
|
- union {
|
||||||
|
- struct {
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint32_t profile : 2;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint32_t show_existing_frame_flag : 1;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint32_t frame_to_show_map_idx : 3;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint32_t frame_type : 1;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint32_t show_frame : 1;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint32_t error_resilient_mode : 1;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint32_t intra_only : 1;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint32_t ten_or_twelve_bit : 1;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint32_t color_space : 3;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint32_t color_range : 1;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint32_t subsampling_x : 1;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint32_t subsampling_y : 1;
|
||||||
|
- /** \brief Corresponds to ref_frame_idx[0]
|
||||||
|
- * as the VP9 specification */
|
||||||
|
- uint32_t ref_frame_idx0 : 3;
|
||||||
|
- /** \brief Corresponds to ref_frame_sign_bias[LAST_FRAME]
|
||||||
|
- * as the VP9 specification */
|
||||||
|
- uint32_t ref_frame_sign_bias0 : 1;
|
||||||
|
- /** \brief Corresponds to ref_frame_idx[1]
|
||||||
|
- * as the VP9 specification */
|
||||||
|
- uint32_t ref_frame_idx1 : 3;
|
||||||
|
- /** \brief Corresponds to ref_frame_sign_bias[GOLDEN_FRAME]
|
||||||
|
- * as the VP9 specification */
|
||||||
|
- uint32_t ref_frame_sign_bias1 : 1;
|
||||||
|
- /** \brief Corresponds to ref_frame_idx[2]
|
||||||
|
- * as the VP9 specification */
|
||||||
|
- uint32_t ref_frame_idx2 : 3;
|
||||||
|
- /** \brief Corresponds to ref_frame_sign_bias[ALTREF_FRAME]
|
||||||
|
- * as the VP9 specification */
|
||||||
|
- uint32_t ref_frame_sign_bias2 : 1;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint32_t frame_parallel_decoding_mode : 1;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint32_t render_and_frame_size_different : 1;
|
||||||
|
- /** \brief Reserved for future use, must be zero */
|
||||||
|
- uint32_t reserved : 1;
|
||||||
|
- } bits;
|
||||||
|
- uint32_t value;
|
||||||
|
- } header_fields;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint16_t frame_width_minus1;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint16_t frame_height_minus1;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint16_t render_width_minus1;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint16_t render_height_minus1;
|
||||||
|
- /** \brief Same as the VP9 bitstream syntax element. */
|
||||||
|
- uint8_t refresh_frame_flags;
|
||||||
|
- /** \brief Parameters for super frame*/
|
||||||
|
- /**@{*/
|
||||||
|
- /** \brief Superframe index, from 0 to frames_in_superframe_minus_1.
|
||||||
|
- * as the VP9 specification */
|
||||||
|
- uint8_t sf_index;
|
||||||
|
- /** \brief Superframe size, corresponds to frame_sizes[ sf_index ]
|
||||||
|
- * as the VP9 specification */
|
||||||
|
- uint32_t sf_frame_size;
|
||||||
|
- /**@}*/
|
||||||
|
- /** \brief Pointer to the next #VACencSliceParameterBufferVP9 element,
|
||||||
|
- * or \c nullptr if there is none.*/
|
||||||
|
- void* next;
|
||||||
|
-
|
||||||
|
- /** \brief Reserved bytes for future use, must be zero */
|
||||||
|
- uint32_t va_reserved[VA_PADDING_MEDIUM];
|
||||||
|
-} VACencSliceParameterBufferVP9;
|
||||||
|
-
|
||||||
|
/** \brief Cenc Slice Buffer Type*/
|
||||||
|
typedef enum {
|
||||||
|
/** \brief Parsed slice parameters \c VACencSliceParameterBuffer* */
|
||||||
|
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
|
||||||
|
index e88db8a3f1201..c1bd0d7db925f 100644
|
||||||
|
--- a/tools/metrics/histograms/enums.xml
|
||||||
|
+++ b/tools/metrics/histograms/enums.xml
|
||||||
|
@@ -77050,7 +77050,7 @@ Full version information for the fingerprint enum values:
|
||||||
|
<int value="26" label="vaDestroyProtectedSession()"/>
|
||||||
|
<int value="27" label="vaAttachProtectedSession()"/>
|
||||||
|
<int value="28" label="vaDetachProtectedSession()"/>
|
||||||
|
- <int value="29" label="vaProtectedSessionHwUpdate()"/>
|
||||||
|
+ <int value="29" label="vaProtectedSessionHwUpdate() (deprecated)"/>
|
||||||
|
<int value="30" label="kVAProtectedSessionExecute()"/>
|
||||||
|
<int value="31" label="Other VA functions"/>
|
||||||
|
</enum>
|
Loading…
Reference in new issue