diff options
author | Wang, Tiantian <tiantian.wang@intel.com> | 2017-04-10 02:12:24 -0400 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2017-04-13 13:37:49 +0800 |
commit | aa77cb71b3a052cffc085aedcdf437a320fb7377 (patch) | |
tree | 71d4a3d2e91efa68ca9f66ff22469c96eb3e4dd3 /src/i965_post_processing.c | |
parent | fd5213792a28f770d0f563abd931ce717961d266 (diff) | |
download | libva-intel-driver-aa77cb71b3a052cffc085aedcdf437a320fb7377.tar.gz |
Check and allocate (if not exist) bo for dst_obj_surface in vpp
This fixes #20
https://github.com/01org/intel-vaapi-driver/issues/20
Signed-off-by: Wang Tiantian <tiantian.wang@intel.com>
Diffstat (limited to 'src/i965_post_processing.c')
-rwxr-xr-x | src/i965_post_processing.c | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c index b8551238..61da7616 100755 --- a/src/i965_post_processing.c +++ b/src/i965_post_processing.c @@ -5852,6 +5852,9 @@ i965_proc_picture_fast(VADriverContextP ctx, if (!src_obj_surface->fourcc) return VA_STATUS_ERROR_INVALID_IMAGE_FORMAT; + if (!src_obj_surface->bo) + return VA_STATUS_ERROR_INVALID_SURFACE; + if (pipeline_param->surface_region) { src_rect.x = pipeline_param->surface_region->x; src_rect.y = pipeline_param->surface_region->y; @@ -5959,16 +5962,40 @@ i965_proc_picture(VADriverContextP ctx, unsigned int tiling = 0, swizzle = 0; int in_width, in_height; - status = i965_proc_picture_fast(ctx, proc_context, proc_state); - if (status != VA_STATUS_ERROR_UNIMPLEMENTED) - return status; - if (pipeline_param->surface == VA_INVALID_ID || proc_state->current_render_target == VA_INVALID_ID) { status = VA_STATUS_ERROR_INVALID_SURFACE; goto error; } + obj_surface = SURFACE(proc_state->current_render_target); + if (!obj_surface) + return VA_STATUS_ERROR_INVALID_SURFACE; + + if (!obj_surface->bo) { + unsigned int expected_format = obj_surface->expected_format; + int fourcc = 0; + int subsample = 0; + int tiling = HAS_TILED_SURFACE(i965); + switch (expected_format) { + case VA_RT_FORMAT_YUV420: + fourcc = VA_FOURCC_NV12; + subsample = SUBSAMPLE_YUV420; + break; + case VA_RT_FORMAT_YUV420_10BPP: + fourcc = VA_FOURCC_P010; + subsample = SUBSAMPLE_YUV420; + break; + case VA_RT_FORMAT_RGB32: + fourcc = VA_FOURCC_RGBA; + subsample = SUBSAMPLE_RGBX; + break; + default: + return VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT; + } + i965_check_alloc_surface_bo(ctx, obj_surface, tiling, fourcc, subsample); + } + obj_surface = SURFACE(pipeline_param->surface); if (!obj_surface) { @@ -5986,6 +6013,10 @@ i965_proc_picture(VADriverContextP ctx, goto error; } + status = i965_proc_picture_fast(ctx, proc_context, proc_state); + if (status != VA_STATUS_ERROR_UNIMPLEMENTED) + return status; + in_width = obj_surface->orig_width; in_height = obj_surface->orig_height; dri_bo_get_tiling(obj_surface->bo, &tiling, &swizzle); |