[Mesa-dev] [PATCH 11/11] st/va: add config support for 10bit decoding
Christian König
deathsimple at vodafone.de
Wed Mar 8 12:29:50 UTC 2017
From: Christian König <christian.koenig at amd.com>
Advertise 10bpp support if the driver supports decoding to a P016 surface.
Signed-off-by: Christian König <christian.koenig at amd.com>
---
src/gallium/state_trackers/va/config.c | 15 +++++++++++++--
src/gallium/state_trackers/va/va_private.h | 1 +
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/gallium/state_trackers/va/config.c b/src/gallium/state_trackers/va/config.c
index 15beb6c..167d606 100644
--- a/src/gallium/state_trackers/va/config.c
+++ b/src/gallium/state_trackers/va/config.c
@@ -108,17 +108,24 @@ VAStatus
vlVaGetConfigAttributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint,
VAConfigAttrib *attrib_list, int num_attribs)
{
+ struct pipe_screen *pscreen;
int i;
if (!ctx)
return VA_STATUS_ERROR_INVALID_CONTEXT;
+ pscreen = VL_VA_PSCREEN(ctx);
+
for (i = 0; i < num_attribs; ++i) {
unsigned int value;
if (entrypoint == VAEntrypointVLD) {
switch (attrib_list[i].type) {
case VAConfigAttribRTFormat:
value = VA_RT_FORMAT_YUV420;
+ if (pscreen->is_video_format_supported(pscreen, PIPE_FORMAT_P016,
+ ProfileToPipe(profile),
+ PIPE_VIDEO_ENTRYPOINT_BITSTREAM))
+ value |= VA_RT_FORMAT_YUV420_10BPP;
break;
default:
value = VA_ATTRIB_NOT_SUPPORTED;
@@ -146,6 +153,7 @@ vlVaGetConfigAttributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint en
switch (attrib_list[i].type) {
case VAConfigAttribRTFormat:
value = (VA_RT_FORMAT_YUV420 |
+ VA_RT_FORMAT_YUV420_10BPP |
VA_RT_FORMAT_RGB32);
break;
default:
@@ -187,7 +195,9 @@ vlVaCreateConfig(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoin
config->profile = PIPE_VIDEO_PROFILE_UNKNOWN;
for (int i = 0; i < num_attribs; i++) {
if (attrib_list[i].type == VAConfigAttribRTFormat) {
- if (attrib_list[i].value & (VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_RGB32)) {
+ if (attrib_list[i].value & (VA_RT_FORMAT_YUV420 |
+ VA_RT_FORMAT_YUV420_10BPP |
+ VA_RT_FORMAT_RGB32)) {
config->rt_format = attrib_list[i].value;
} else {
FREE(config);
@@ -198,7 +208,8 @@ vlVaCreateConfig(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoin
/* Default value if not specified in the input attributes. */
if (!config->rt_format)
- config->rt_format = VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_RGB32;
+ config->rt_format = VA_RT_FORMAT_YUV420 | VA_RT_FORMAT_YUV420_10BPP |
+ VA_RT_FORMAT_RGB32;
mtx_lock(&drv->mutex);
*config_id = handle_table_add(drv->htab, config);
diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h
index 7216aba4..9c32c08 100644
--- a/src/gallium/state_trackers/va/va_private.h
+++ b/src/gallium/state_trackers/va/va_private.h
@@ -57,6 +57,7 @@ ChromaToPipe(int format)
{
switch (format) {
case VA_RT_FORMAT_YUV420:
+ case VA_RT_FORMAT_YUV420_10BPP:
return PIPE_VIDEO_CHROMA_FORMAT_420;
case VA_RT_FORMAT_YUV422:
return PIPE_VIDEO_CHROMA_FORMAT_422;
--
2.7.4
More information about the mesa-dev
mailing list