diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2018-01-19 11:01:29 +0800 |
---|---|---|
committer | U. Artie Eoff <ullysses.a.eoff@intel.com> | 2018-01-22 10:23:53 -0800 |
commit | f4637d72cf4b14b741876afe0ababa204270d0e5 (patch) | |
tree | 4f860ebb18de3fa4e79c47cc59fd47b66633b0ad | |
parent | 597ea67c104ab95a71c0a89d63ad33c219935c4b (diff) | |
download | libva-intel-driver-f4637d72cf4b14b741876afe0ababa204270d0e5.tar.gz |
Check decoding mode
VA_DEC_SLICE_MODE_NORMAL is supported only for decoding
This fixes https://github.com/01org/intel-vaapi-driver/issues/336
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
-rw-r--r-- | src/i965_drv_video.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c index 729bd081..fa7c390b 100644 --- a/src/i965_drv_video.c +++ b/src/i965_drv_video.c @@ -1112,7 +1112,8 @@ i965_GetConfigAttributes(VADriverContextP ctx, break; case VAConfigAttribDecSliceMode: - attrib_list[i].value = VA_DEC_SLICE_MODE_NORMAL; + if (entrypoint == VAEntrypointVLD) + attrib_list[i].value = VA_DEC_SLICE_MODE_NORMAL; break; case VAConfigAttribEncROI: @@ -1428,6 +1429,17 @@ i965_CreateConfig(VADriverContextP ctx, vaStatus = i965_append_config_attribute(obj_config, &attrib); } + if (vaStatus == VA_STATUS_SUCCESS) { + VAConfigAttrib *attrib_found; + + attrib_found = i965_lookup_config_attribute(obj_config, VAConfigAttribDecSliceMode); + + if (attrib_found && + (entrypoint != VAEntrypointVLD || + attrib_found->value != VA_DEC_SLICE_MODE_NORMAL)) + vaStatus = VA_STATUS_ERROR_INVALID_VALUE; + } + if ((vaStatus == VA_STATUS_SUCCESS) && (profile == VAProfileVP9Profile0) && (entrypoint == VAEntrypointVLD) && |