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

Commit

Permalink
add vaLockSurface/vaUnlockSurface support
Browse files Browse the repository at this point in the history
it is required to dump surface by va trace

Change-Id: I2cc8d67c15573b454c9aa04c64f9bc03bf69f0dd
  • Loading branch information
Zhao, Halley committed Apr 8, 2014
1 parent 6e9bade commit 1fe0520
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions src/wrapper_drv_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,50 @@ vawr_SetDisplayAttributes(VADriverContextP ctx,

}

VAStatus vawr_LockSurface(VADriverContextP ctx,
VASurfaceID surface,
unsigned int *fourcc, /* following are output argument */
unsigned int *luma_stride,
unsigned int *chroma_u_stride,
unsigned int *chroma_v_stride,
unsigned int *luma_offset,
unsigned int *chroma_u_offset,
unsigned int *chroma_v_offset,
unsigned int *buffer_name,
void **buffer)
{
VAStatus vaStatus;
struct vawr_driver_data *vawr = GET_VAWRDATA(ctx);
VASurfaceID vawr_render_target;
vawr_surface_lookup_t *surface_lookup;

GET_SURFACEID(vawr, surface_lookup, surface, vawr_render_target);

RESTORE_DRVDATA(ctx, vawr);
CALL_DRVVTABLE(vawr, vaStatus, vaLockSurface(ctx, vawr_render_target, fourcc, luma_stride, chroma_u_stride, chroma_v_stride, luma_offset, chroma_u_offset, chroma_v_offset, buffer_name, buffer));
RESTORE_VAWRDATA(ctx, vawr);

return vaStatus;
}


VAStatus vawr_UnlockSurface(VADriverContextP ctx,
VASurfaceID surface)
{
VAStatus vaStatus;
struct vawr_driver_data *vawr = GET_VAWRDATA(ctx);
VASurfaceID vawr_render_target;
vawr_surface_lookup_t *surface_lookup;

GET_SURFACEID(vawr, surface_lookup, surface, vawr_render_target);

RESTORE_DRVDATA(ctx, vawr);
CALL_DRVVTABLE(vawr, vaStatus, vaUnlockSurface( ctx, vawr_render_target));
RESTORE_VAWRDATA(ctx, vawr);

return vaStatus;
}

VAStatus DLL_EXPORT
__vaDriverInit_0_32(VADriverContextP ctx);

Expand Down Expand Up @@ -1180,6 +1224,8 @@ __vaDriverInit_0_32( VADriverContextP ctx )
vtable->vaQueryDisplayAttributes = vawr_QueryDisplayAttributes;
vtable->vaGetDisplayAttributes = vawr_GetDisplayAttributes;
vtable->vaSetDisplayAttributes = vawr_SetDisplayAttributes;
vtable->vaLockSurface = vawr_LockSurface;
vtable->vaUnlockSurface= vawr_UnlockSurface;
}

/* Store wrapper's private driver data*/
Expand Down

0 comments on commit 1fe0520

Please sign in to comment.