summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2017-07-12 09:44:11 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2017-10-17 00:43:43 +0800
commitba42d60f09cd9eb5b4298cc0023ee4539793e9bd (patch)
tree5e6cf0364d7b81d241600db81fc7bd62bf6bb701
parentc2cb106e3085cd8d62549eda78bad59708e2acc9 (diff)
downloadlibva-intel-driver-ba42d60f09cd9eb5b4298cc0023ee4539793e9bd.tar.gz
Don't check the stride in the y direction for a single plane surface
obj_surface->height is used to calculate the offset for U/V plane. for a surface with single plane, the check is unnecessary This fixes https://github.com/01org/intel-vaapi-driver/issues/222 Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com> Reviewed-by: Daniel Charles <daniel.charles@intel.com> Tested-by: Daniel Charles <daniel.charles@intel.com> (cherry picked from commit 17bc8a0cb96b6ef02475ad598c626cd9e266a1cc)
-rw-r--r--src/i965_drv_video.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index aab16e8b..b550d0dc 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -1504,15 +1504,22 @@ i965_suface_external_memory(VADriverContextP ctx,
obj_surface->height = memory_attibute->data_size / obj_surface->width;
else
obj_surface->height = memory_attibute->offsets[1] / obj_surface->width;
- ASSERT_RET(IS_ALIGNED(obj_surface->height, 16), VA_STATUS_ERROR_INVALID_PARAMETER);
- ASSERT_RET(obj_surface->height >= obj_surface->orig_height, VA_STATUS_ERROR_INVALID_PARAMETER);
+
+ if (memory_attibute->num_planes > 1) {
+ ASSERT_RET(IS_ALIGNED(obj_surface->height, 16), VA_STATUS_ERROR_INVALID_PARAMETER);
+ ASSERT_RET(obj_surface->height >= obj_surface->orig_height, VA_STATUS_ERROR_INVALID_PARAMETER);
+ }
if (tiling) {
ASSERT_RET(IS_ALIGNED(obj_surface->width, 128), VA_STATUS_ERROR_INVALID_PARAMETER);
- ASSERT_RET(IS_ALIGNED(obj_surface->height, 32), VA_STATUS_ERROR_INVALID_PARAMETER);
+
+ if (memory_attibute->num_planes > 1)
+ ASSERT_RET(IS_ALIGNED(obj_surface->height, 32), VA_STATUS_ERROR_INVALID_PARAMETER);
} else {
ASSERT_RET(IS_ALIGNED(obj_surface->width, i965->codec_info->min_linear_wpitch), VA_STATUS_ERROR_INVALID_PARAMETER);
- ASSERT_RET(IS_ALIGNED(obj_surface->height, i965->codec_info->min_linear_hpitch), VA_STATUS_ERROR_INVALID_PARAMETER);
+
+ if (memory_attibute->num_planes > 1)
+ ASSERT_RET(IS_ALIGNED(obj_surface->height, i965->codec_info->min_linear_hpitch), VA_STATUS_ERROR_INVALID_PARAMETER);
}
obj_surface->x_cb_offset = 0; /* X offset is always 0 */