Skip to content
This repository has been archived by the owner on Apr 23, 2019. It is now read-only.

Commit

Permalink
psb_video: make it work with libva 1.3.0
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
chivakker committed Apr 23, 2014
1 parent 5c17495 commit 63530d3
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/psb_drv_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/psb_drv_video.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/psb_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
3 changes: 3 additions & 0 deletions src/tng_VP8.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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) &&
Expand All @@ -418,6 +420,7 @@ static void tng_VP8_QueryConfigAttributes(
break;
}
}
#endif

}

Expand Down
4 changes: 4 additions & 0 deletions src/tng_hostcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/tng_yuv_processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 63530d3

Please sign in to comment.