From: Xiang, Haihao Date: Thu, 2 Feb 2012 03:09:40 +0000 (+0800) Subject: Fix the surface format in vaPutImage() X-Git-Tag: 1.0_branch~154 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f58a3196d2cc424027941d07c73aa86fd0e2fe66;p=profile%2Fivi%2Fvaapi-intel-driver.git Fix the surface format in vaPutImage() Set the format of surface format to the format of the input image if the usage is unknown Signed-off-by: Xiang, Haihao --- diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c index 5bfcaee..4db32f2 100644 --- a/src/i965_drv_video.c +++ b/src/i965_drv_video.c @@ -689,7 +689,18 @@ i965_PutImage(VADriverContextP ctx, dest_y + dest_height > obj_surface->orig_height) return VA_STATUS_ERROR_INVALID_PARAMETER; - i965_check_alloc_surface_bo(ctx, obj_surface, HAS_TILED_SURFACE(i965), VA_FOURCC('N', 'V', '1', '2'), SUBSAMPLE_YUV420); + if (!obj_surface->bo) { + unsigned int tiling, swizzle; + dri_bo_get_tiling(obj_image->bo, &tiling, &swizzle); + + i965_check_alloc_surface_bo(ctx, + obj_surface, + !!tiling, + obj_image->image.format.fourcc, + SUBSAMPLE_YUV420); + } + + assert(obj_surface->fourcc); src_surface.id = image; src_surface.type = I965_SURFACE_TYPE_IMAGE;