From 43009227c2f7410f8776a455a7e66fc88e01194c Mon Sep 17 00:00:00 2001 From: Carl Zhang Date: Wed, 19 Aug 2020 12:20:02 -0400 Subject: add a bufer type to adjust context priority dynamically Signed-off-by: Carl Zhang --- va/va.h | 32 +++++++++++++++++++++++++++++++- va/va_str.c | 1 + 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/va/va.h b/va/va.h index 6577cf5..2d0a624 100644 --- a/va/va.h +++ b/va/va.h @@ -792,6 +792,7 @@ typedef enum VAConfigAttribMultipleFrame = 40, /** \brief priority setting for the context. Read-Write * attribute value is \c VAConfigAttribValContextPriority + * this setting also could be update by \c VAContextParameterUpdateBuffer */ VAConfigAttribContextPriority = 41, /**@}*/ @@ -1152,7 +1153,7 @@ typedef union _VAConfigAttribValMultipleFrame { uint32_t value; }VAConfigAttribValMultipleFrame; -/** brief Attribute value VAConfigAttribValContestPriority */ +/** brief Attribute value VAConfigAttribValContextPriority */ typedef union _VAConfigAttribValContextPriority{ struct{ /** \brief the priority , for the Query operation (read) it represents highest priority @@ -1775,10 +1776,38 @@ typedef enum * entry_offset_to_subset_array in VAPictureParameterBufferHEVC data structure. */ VASubsetsParameterBufferType = 57, + /** \brief adjust context parameters dynamically + * + * this parameter is used to update context parameters, detail parameter is in + * \c VAContextParameterUpdateBuffer + */ + VAContextParameterUpdateBufferType = 58, VABufferTypeMax } VABufferType; +/** \brief update the context parameter + * this structure is used to update context parameters, such as priority of the context + * backend driver should keep the parameter unchanged if there no new + * parameter updated. + */ +typedef struct _VAContextParameterUpdateBuffer +{ + union{ + struct { + /** \brief indicate whether context priority changed */ + uint32_t context_priority_update :1; + /** \brief Reserved bits for future use, must be zero */ + uint32_t reserved :31; + } bits; + uint32_t value; + }flags; + /** \brief task/context priority */ + VAConfigAttribValContextPriority context_priority; + /** \brief Reserved bytes for future use, must be zero */ + uint32_t reserved[VA_PADDING_MEDIUM]; +} VAContextParameterUpdateBuffer; + /** * Processing rate parameter for encode. */ @@ -2547,6 +2576,7 @@ typedef struct _VAEncMiscParameterCustomRoundingControl uint32_t value; } rounding_offset_setting; } VAEncMiscParameterCustomRoundingControl; + /** * There will be cases where the bitstream buffer will not have enough room to hold * the data for the entire slice, and the following flags will be used in the slice diff --git a/va/va_str.c b/va/va_str.c index 4b631ca..d6c0fa5 100644 --- a/va/va_str.c +++ b/va/va_str.c @@ -179,6 +179,7 @@ const char *vaBufferTypeStr(VABufferType bufferType) TOSTR(VAEncFEICTBCmdBufferType); TOSTR(VAEncFEICURecordBufferType); TOSTR(VASubsetsParameterBufferType); + TOSTR(VAContextParameterUpdateBufferType); case VABufferTypeMax: break; } return ""; -- cgit v1.2.1