From 63530d3050f2bf5c6b6c6a23af3ad7dabf863016 Mon Sep 17 00:00:00 2001 From: Daniel Charles Date: Fri, 18 Apr 2014 15:23:58 -0700 Subject: [PATCH] psb_video: make it work with libva 1.3.0 All the functionality that is not yet merged to libva master branch is compiled out as it is not used on Chromium OS Entry points are dyamically obtained by the libva application the driver should not use EntrypointMax as a reference. To allocate memory a value is provided to accomodate all entrypoints possible. Signed-off-by: Daniel Charles --- src/psb_drv_video.c | 2 ++ src/psb_drv_video.h | 3 ++- src/psb_output.c | 4 +++- src/tng_VP8.c | 3 +++ src/tng_hostcode.h | 4 ++++ src/tng_yuv_processor.c | 4 ++++ 6 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/psb_drv_video.c b/src/psb_drv_video.c index 2c83c6b..c516566 100644 --- a/src/psb_drv_video.c +++ b/src/psb_drv_video.c @@ -186,7 +186,9 @@ VAStatus psb_QueryConfigProfiles( profile_list[i++] = VAProfileH264Baseline; profile_list[i++] = VAProfileH264Main; profile_list[i++] = VAProfileH264High; +#ifndef BAYTRAIL profile_list[i++] = VAProfileH264StereoHigh; +#endif profile_list[i++] = VAProfileVC1Simple; profile_list[i++] = VAProfileVC1Main; profile_list[i++] = VAProfileVC1Advanced; diff --git a/src/psb_drv_video.h b/src/psb_drv_video.h index 0ba7c3c..0cd0a91 100644 --- a/src/psb_drv_video.h +++ b/src/psb_drv_video.h @@ -106,7 +106,8 @@ #define PSB_MAX_BUFFERTYPES VABufferTypeMax #else #define PSB_MAX_PROFILES 18 -#define PSB_MAX_ENTRYPOINTS VAEntrypointMax +#define PSB_MAX_ENTRYPOINTS 5 /* VLD, EncSlice VideoProc + entry points plus 2 open */ #define PSB_MAX_CONFIG_ATTRIBUTES 10 #define PSB_MAX_BUFFERTYPES VABufferTypeMax #endif diff --git a/src/psb_output.c b/src/psb_output.c index 4558f15..3f91ed4 100755 --- a/src/psb_output.c +++ b/src/psb_output.c @@ -395,11 +395,13 @@ VAStatus psb_CreateImage( obj_image->image.pitches[0] = pitch_pot; obj_image->image.pitches[1] = pitch_pot; obj_image->image.pitches[2] = pitch_pot; - obj_image->image.extra_pitch = pitch_pot; obj_image->image.offsets[0] = 0; obj_image->image.offsets[1] = pitch_pot * height; obj_image->image.offsets[2] = pitch_pot * height * 2; +#ifndef BAYTRAIL obj_image->image.extra_offset = pitch_pot * height * 3; + obj_image->image.extra_pitch = pitch_pot; +#endif obj_image->image.num_palette_entries = 0; obj_image->image.entry_bytes = 0; obj_image->image.component_order[0] = 'V'; diff --git a/src/tng_VP8.c b/src/tng_VP8.c index 631896d..3e3c49f 100644 --- a/src/tng_VP8.c +++ b/src/tng_VP8.c @@ -398,6 +398,7 @@ static void tng_VP8_QueryConfigAttributes( int i; drv_debug_msg(VIDEO_DEBUG_GENERAL, "tng_VP8_QueryConfigAttributes\n"); +#ifndef BAYTRAIL for (i = 0; i < num_attribs; i++) { switch (attrib_list[i].type) { case VAConfigAttribMaxPictureWidth: @@ -406,6 +407,7 @@ static void tng_VP8_QueryConfigAttributes( attrib_list[i].value = HW_SUPPORTED_MAX_PICTURE_WIDTH_VP8; else attrib_list[i].value = VA_ATTRIB_NOT_SUPPORTED; + break; case VAConfigAttribMaxPictureHeight: if ((entrypoint == VAEntrypointVLD) && @@ -418,6 +420,7 @@ static void tng_VP8_QueryConfigAttributes( break; } } +#endif } diff --git a/src/tng_hostcode.h b/src/tng_hostcode.h index 606ae1e..2c91241 100644 --- a/src/tng_hostcode.h +++ b/src/tng_hostcode.h @@ -38,7 +38,9 @@ #include "tng_cmdbuf.h" #include "tng_hostdefs.h" #include "tng_hostheader.h" +#ifndef BAYTRAIL #include "tng_jpegES.h" +#endif #include "tng_slotorder.h" #define tng__max(a, b) ((a)> (b)) ? (a) : (b) @@ -461,8 +463,10 @@ struct context_ENC_s { uint32_t jpeg_header_mem_size; uint32_t jpeg_header_interface_mem_size; +#ifndef BAYTRAIL //JPEG encode context data TOPAZHP_JPEG_ENCODER_CONTEXT *jpeg_ctx; +#endif /* Save actual H263 width/height */ IMG_UINT16 h263_actual_width; diff --git a/src/tng_yuv_processor.c b/src/tng_yuv_processor.c index 0e0979a..7e33702 100644 --- a/src/tng_yuv_processor.c +++ b/src/tng_yuv_processor.c @@ -227,7 +227,9 @@ static VAStatus tng__yuv_processor_execute(context_DEC_p dec_ctx, object_buffer_ ctx->coded_height = ctx->display_height; ctx->src_surface = obj_surface->psb_surface; +#ifndef BAYTRAIL dec_ctx->obj_context->msvdx_rotate = vpp_params->rotation_state; +#endif SET_SURFACE_INFO_rotate(rotate_surface, dec_ctx->obj_context->msvdx_rotate); ctx->proc_param = vpp_params; @@ -526,10 +528,12 @@ VAStatus ved_QueryVideoProcPipelineCaps( /* check filter buffer setting */ switch (base->type) { case VAProcFilterNone: +#ifndef BAYTRAIL pipeline_caps->rotation_flags = (1 << VA_ROTATION_NONE); pipeline_caps->rotation_flags |= (1 << VA_ROTATION_90); pipeline_caps->rotation_flags |= (1 << VA_ROTATION_180); pipeline_caps->rotation_flags |= (1 << VA_ROTATION_270); +#endif break; default: