OSDN Git Service

only re-caculate surface width&height for tiled surface
authorpeng.chen <peng.c.chen@intel.com>
Thu, 7 Jan 2016 00:54:34 +0000 (08:54 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 11 Jan 2016 08:34:43 +0000 (16:34 +0800)
fix Bug 93499 - daf8f6c762874 introduced display corruption on i3 330M
https://bugs.freedesktop.org/show_bug.cgi?id=93499

Signed-off-by: peng.chen <peng.c.chen@intel.com>
src/i965_drv_video.c

index 7b7bdf6..db82b27 100644 (file)
@@ -3819,22 +3819,22 @@ i965_check_alloc_surface_bo(VADriverContextP ctx,
 
     int bpp_1stplane = bpp_1stplane_by_fourcc(fourcc);
 
-    if (obj_surface->user_h_stride_set) {
-        ASSERT_RET(IS_ALIGNED(obj_surface->width, 128), VA_STATUS_ERROR_INVALID_PARAMETER);
-    } else
-        obj_surface->width = ALIGN(obj_surface->orig_width * bpp_1stplane, 128);
-
-    if (obj_surface->user_v_stride_set) {
-        ASSERT_RET(IS_ALIGNED(obj_surface->height, 32), VA_STATUS_ERROR_INVALID_PARAMETER);
-    } else
-        obj_surface->height = ALIGN(obj_surface->orig_height, 32);
-
     if ((tiled && !obj_surface->user_disable_tiling)) {
         ASSERT_RET(fourcc != VA_FOURCC_I420 &&
                fourcc != VA_FOURCC_IYUV &&
                fourcc != VA_FOURCC_YV12,
                VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT);
 
+        if (obj_surface->user_h_stride_set) {
+           ASSERT_RET(IS_ALIGNED(obj_surface->width, 128), VA_STATUS_ERROR_INVALID_PARAMETER);
+        } else
+          obj_surface->width = ALIGN(obj_surface->orig_width * bpp_1stplane, 128);
+
+        if (obj_surface->user_v_stride_set) {
+          ASSERT_RET(IS_ALIGNED(obj_surface->height, 32), VA_STATUS_ERROR_INVALID_PARAMETER);
+        }else
+          obj_surface->height = ALIGN(obj_surface->orig_height, 32);
+
         region_height = obj_surface->height;
 
         switch (fourcc) {