summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2016-06-27 12:08:26 +0800
committerZhao, Yakui <yakui.zhao@intel.com>2016-06-28 10:35:58 +0800
commitbcde10dac40cbc4c8502fa519404c9379372184b (patch)
tree23304ad6825cd5ab939921e105843add9f4c02c5
parentf47e513dcd8557b84463379d52d7156adef121a9 (diff)
Downgrade the alignment requirement for linear surface on BDW+
When sharing the YUY2/UYVY buffer with other driver, the current alignment is too strict, which causes that it is not handled correctly by other driver.(The current alignment is considered based on I420/YV12) https://bugs.freedesktop.org/show_bug.cgi?id=96689 Tested-by: Cheah, Vincent Beng Keat<vincent.beng.keat.cheah@intel.com> Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
-rw-r--r--src/i965_device_info.c10
-rw-r--r--src/i965_drv_video.c4
2 files changed, 9 insertions, 5 deletions
diff --git a/src/i965_device_info.c b/src/i965_device_info.c
index 239961c..47fd50a 100644
--- a/src/i965_device_info.c
+++ b/src/i965_device_info.c
@@ -239,7 +239,7 @@ static struct hw_codec_info bdw_hw_codec_info = {
.max_width = 4096,
.max_height = 4096,
- .min_linear_wpitch = 128,
+ .min_linear_wpitch = 64,
.min_linear_hpitch = 16,
.h264_mvc_dec_profiles = (VA_PROFILE_MASK(H264StereoHigh) |
@@ -282,7 +282,7 @@ static struct hw_codec_info chv_hw_codec_info = {
.max_width = 4096,
.max_height = 4096,
- .min_linear_wpitch = 128,
+ .min_linear_wpitch = 64,
.min_linear_hpitch = 16,
.h264_mvc_dec_profiles = (VA_PROFILE_MASK(H264StereoHigh) |
@@ -332,7 +332,7 @@ static struct hw_codec_info skl_hw_codec_info = {
.max_width = 4096, /* default. See max_resolution */
.max_height = 4096, /* default. See max_resolution */
- .min_linear_wpitch = 128,
+ .min_linear_wpitch = 64,
.min_linear_hpitch = 16,
.h264_mvc_dec_profiles = (VA_PROFILE_MASK(H264StereoHigh) |
@@ -384,7 +384,7 @@ static struct hw_codec_info bxt_hw_codec_info = {
.max_width = 4096, /* default. See max_resolution */
.max_height = 4096, /* default. See max_resolution */
- .min_linear_wpitch = 128,
+ .min_linear_wpitch = 64,
.min_linear_hpitch = 16,
.h264_mvc_dec_profiles = (VA_PROFILE_MASK(H264StereoHigh) |
@@ -437,7 +437,7 @@ static struct hw_codec_info kbl_hw_codec_info = {
.max_width = 4096, /* default. See max_resolution */
.max_height = 4096, /* default. See max_resolution */
- .min_linear_wpitch = 128,
+ .min_linear_wpitch = 64,
.min_linear_hpitch = 16,
.h264_mvc_dec_profiles = (VA_PROFILE_MASK(H264StereoHigh) |
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index 66cdb9e..ad48f22 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -4162,10 +4162,12 @@ i965_check_alloc_surface_bo(VADriverContextP ctx,
case VA_FOURCC_YV16:
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
+ obj_surface->width = ALIGN(obj_surface->cb_cr_width, i965->codec_info->min_linear_wpitch) * 2;
obj_surface->cb_cr_height = obj_surface->orig_height;
obj_surface->y_cr_offset = obj_surface->height;
obj_surface->y_cb_offset = obj_surface->y_cr_offset + ALIGN(obj_surface->cb_cr_height, 32) / 2;
obj_surface->cb_cr_pitch = obj_surface->width / 2;
+ region_width = obj_surface->width;
region_height = obj_surface->height + ALIGN(obj_surface->cb_cr_height, 32);
break;
@@ -4180,8 +4182,10 @@ i965_check_alloc_surface_bo(VADriverContextP ctx,
}
obj_surface->cb_cr_width = obj_surface->orig_width / 2;
+ obj_surface->width = ALIGN(obj_surface->cb_cr_width, i965->codec_info->min_linear_wpitch) * 2;
obj_surface->cb_cr_height = obj_surface->orig_height / 2;
obj_surface->cb_cr_pitch = obj_surface->width / 2;
+ region_width = obj_surface->width;
region_height = obj_surface->height + obj_surface->height / 2;
break;