Commit 95da3e74 authored by Gwenole Beauchesne's avatar Gwenole Beauchesne Committed by Austin Yuan

Make VADriverContext.vtable a pointer.

parent 96b62de6
......@@ -803,7 +803,7 @@ end:
/* ========================================================================= */
#define INVOKE(ctx, func, args) do { \
VADriverVTableGLXP vtable = (ctx)->vtable.glx; \
VADriverVTableGLXP vtable = (ctx)->vtable_glx; \
if (!vtable->va##func##GLX) \
return VA_STATUS_ERROR_UNIMPLEMENTED; \
\
......@@ -937,7 +937,7 @@ associate_surface(
return status;
x11_trap_errors();
status = ctx->vtable.vaPutSurface(
status = ctx->vtable->vaPutSurface(
ctx,
surface,
(void *)pSurfaceGLX->pixmap,
......@@ -962,7 +962,7 @@ sync_surface(VADriverContextP ctx, VASurfaceGLXP pSurfaceGLX)
if (pSurfaceGLX->surface == VA_INVALID_SURFACE)
return VA_STATUS_ERROR_INVALID_SURFACE;
return ctx->vtable.vaSyncSurface(ctx, pSurfaceGLX->surface);
return ctx->vtable->vaSyncSurface(ctx, pSurfaceGLX->surface);
}
static inline VAStatus
......@@ -1058,7 +1058,7 @@ VAStatus va_glx_init_context(VADriverContextP ctx)
if (glx_ctx->is_initialized)
return VA_STATUS_SUCCESS;
if (ctx->vtable.glx && ctx->vtable.glx->vaCopySurfaceGLX) {
if (ctx->vtable_glx && ctx->vtable_glx->vaCopySurfaceGLX) {
vtable->vaCreateSurfaceGLX = vaCreateSurfaceGLX_impl_driver;
vtable->vaDestroySurfaceGLX = vaDestroySurfaceGLX_impl_driver;
vtable->vaCopySurfaceGLX = vaCopySurfaceGLX_impl_driver;
......
This diff is collapsed.
......@@ -378,15 +378,28 @@ struct VADriverVTable
VADriverContextP ctx,
VASurfaceID surface
);
/* Optional: GLX support hooks */
struct VADriverVTableGLX *glx;
};
struct VADriverContext
{
void *pDriverData;
struct VADriverVTable vtable;
/**
* The core VA implementation hooks.
*
* This structure is allocated from libva with calloc().
*/
struct VADriverVTable *vtable;
/**
* The VA/GLX implementation hooks.
*
* This structure is intended for drivers that implement the
* VA/GLX API. The driver implementation is responsible for the
* allocation and deallocation of this structure.
*/
struct VADriverVTableGLX *vtable_glx;
void *vtable_tpi; /* the structure is malloc-ed */
void *native_dpy;
......
......@@ -285,7 +285,7 @@ VAStatus vaPutSurface (
destx, desty, destw, desth,
cliprects, number_cliprects, flags );
return ctx->vtable.vaPutSurface( ctx, surface, (void *)draw, srcx, srcy, srcw, srch,
return ctx->vtable->vaPutSurface( ctx, surface, (void *)draw, srcx, srcy, srcw, srch,
destx, desty, destw, desth,
cliprects, number_cliprects, flags );
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment