hardware/intel/common/vaapi
Revisión | 17bc8a0cb96b6ef02475ad598c626cd9e266a1cc (tree) |
---|---|
Tiempo | 2017-07-13 15:15:29 |
Autor | Xiang, Haihao <haihao.xiang@inte...> |
Commiter | Xiang, Haihao |
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>
@@ -1516,15 +1516,22 @@ i965_suface_external_memory(VADriverContextP ctx, | ||
1516 | 1516 | obj_surface->height = memory_attibute->data_size / obj_surface->width; |
1517 | 1517 | else |
1518 | 1518 | obj_surface->height = memory_attibute->offsets[1] / obj_surface->width; |
1519 | - ASSERT_RET(IS_ALIGNED(obj_surface->height, 16), VA_STATUS_ERROR_INVALID_PARAMETER); | |
1520 | - ASSERT_RET(obj_surface->height >= obj_surface->orig_height, VA_STATUS_ERROR_INVALID_PARAMETER); | |
1519 | + | |
1520 | + if (memory_attibute->num_planes > 1) { | |
1521 | + ASSERT_RET(IS_ALIGNED(obj_surface->height, 16), VA_STATUS_ERROR_INVALID_PARAMETER); | |
1522 | + ASSERT_RET(obj_surface->height >= obj_surface->orig_height, VA_STATUS_ERROR_INVALID_PARAMETER); | |
1523 | + } | |
1521 | 1524 | |
1522 | 1525 | if (tiling) { |
1523 | 1526 | ASSERT_RET(IS_ALIGNED(obj_surface->width, 128), VA_STATUS_ERROR_INVALID_PARAMETER); |
1524 | - ASSERT_RET(IS_ALIGNED(obj_surface->height, 32), VA_STATUS_ERROR_INVALID_PARAMETER); | |
1527 | + | |
1528 | + if (memory_attibute->num_planes > 1) | |
1529 | + ASSERT_RET(IS_ALIGNED(obj_surface->height, 32), VA_STATUS_ERROR_INVALID_PARAMETER); | |
1525 | 1530 | } else { |
1526 | 1531 | ASSERT_RET(IS_ALIGNED(obj_surface->width, i965->codec_info->min_linear_wpitch), VA_STATUS_ERROR_INVALID_PARAMETER); |
1527 | - ASSERT_RET(IS_ALIGNED(obj_surface->height, i965->codec_info->min_linear_hpitch), VA_STATUS_ERROR_INVALID_PARAMETER); | |
1532 | + | |
1533 | + if (memory_attibute->num_planes > 1) | |
1534 | + ASSERT_RET(IS_ALIGNED(obj_surface->height, i965->codec_info->min_linear_hpitch), VA_STATUS_ERROR_INVALID_PARAMETER); | |
1528 | 1535 | } |
1529 | 1536 | |
1530 | 1537 | obj_surface->x_cb_offset = 0; /* X offset is always 0 */ |