OSDN Git Service

genX_mfd: do not scale dmv buffer with height
authorcarpalis <jerome.borsboom@carpalis.nl>
Sun, 22 Oct 2017 14:30:47 +0000 (16:30 +0200)
committerXiang, Haihao <haihao.xiang@intel.com>
Fri, 5 Jan 2018 06:57:31 +0000 (14:57 +0800)
PRM states that for VC-1 the direct motion vector buffer may be scaled
with frame height but should not be scaled with frame width. Hardware
assumes frame width is fixed at 128 MBs.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
src/gen75_mfd.c
src/gen7_mfd.c
src/gen8_mfd.c

index 4b15610..1768730 100644 (file)
@@ -1505,7 +1505,6 @@ gen75_mfd_init_vc1_surface(VADriverContextP ctx,
 {
     struct i965_driver_data *i965 = i965_driver_data(ctx);
     struct gen7_vc1_surface *gen7_vc1_surface = obj_surface->private_data;
-    int width_in_mbs = ALIGN(pic_param->coded_width, 16) / 16;
     int height_in_mbs = ALIGN(pic_param->coded_height, 16) / 16;
 
     obj_surface->free_private_data = gen75_mfd_free_vc1_surface;
@@ -1525,7 +1524,7 @@ gen75_mfd_init_vc1_surface(VADriverContextP ctx,
     if (gen7_vc1_surface->dmv == NULL) {
         gen7_vc1_surface->dmv = dri_bo_alloc(i965->intel.bufmgr,
                                              "direct mv w/r buffer",
-                                             width_in_mbs * height_in_mbs * 64,
+                                             128 * height_in_mbs * 64,
                                              0x1000);
     }
 }
index 52600a1..2780459 100644 (file)
@@ -1240,7 +1240,6 @@ gen7_mfd_init_vc1_surface(VADriverContextP ctx,
 {
     struct i965_driver_data *i965 = i965_driver_data(ctx);
     struct gen7_vc1_surface *gen7_vc1_surface = obj_surface->private_data;
-    int width_in_mbs = ALIGN(pic_param->coded_width, 16) / 16;
     int height_in_mbs = ALIGN(pic_param->coded_height, 16) / 16;
 
     obj_surface->free_private_data = gen7_mfd_free_vc1_surface;
@@ -1260,7 +1259,7 @@ gen7_mfd_init_vc1_surface(VADriverContextP ctx,
     if (gen7_vc1_surface->dmv == NULL) {
         gen7_vc1_surface->dmv = dri_bo_alloc(i965->intel.bufmgr,
                                              "direct mv w/r buffer",
-                                             width_in_mbs * height_in_mbs * 64,
+                                             128 * height_in_mbs * 64,
                                              0x1000);
     }
 }
index 5c5a0f4..bd0015a 100644 (file)
@@ -1281,7 +1281,6 @@ gen8_mfd_init_vc1_surface(VADriverContextP ctx,
 {
     struct i965_driver_data *i965 = i965_driver_data(ctx);
     struct gen7_vc1_surface *gen7_vc1_surface = obj_surface->private_data;
-    int width_in_mbs = ALIGN(pic_param->coded_width, 16) / 16;
     int height_in_mbs = ALIGN(pic_param->coded_height, 16) / 16;
 
     obj_surface->free_private_data = gen8_mfd_free_vc1_surface;
@@ -1304,7 +1303,7 @@ gen8_mfd_init_vc1_surface(VADriverContextP ctx,
     if (gen7_vc1_surface->dmv == NULL) {
         gen7_vc1_surface->dmv = dri_bo_alloc(i965->intel.bufmgr,
                                              "direct mv w/r buffer",
-                                             width_in_mbs * height_in_mbs * 64,
+                                             128 * height_in_mbs * 64,
                                              0x1000);
     }
 }