OSDN Git Service

Downgrade the alignment requirement for linear surface on BDW+
authorZhao Yakui <yakui.zhao@intel.com>
Mon, 27 Jun 2016 04:08:26 +0000 (12:08 +0800)
committerZhao, Yakui <yakui.zhao@intel.com>
Tue, 28 Jun 2016 02:35:58 +0000 (10:35 +0800)
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>
src/i965_device_info.c
src/i965_drv_video.c

index 239961c..47fd50a 100644 (file)
@@ -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) |
index 66cdb9e..ad48f22 100644 (file)
@@ -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;