From f58a3196d2cc424027941d07c73aa86fd0e2fe66 Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Thu, 2 Feb 2012 11:09:40 +0800 Subject: [PATCH] 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 --- src/i965_drv_video.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; -- 2.7.4