Commit c9aaaed8 authored by Daniel Vetter's avatar Daniel Vetter

libXvMC: unify PutSurface

Now that the drm bo is in the common structure, do the PutImage
handling in common code, too.
Signed-off-by: Daniel Vetter's avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 4edff6c9
......@@ -1297,32 +1297,6 @@ static int i915_xvmc_mc_render_surface(Display * display, XvMCContext * context,
return 0;
}
static int i915_xvmc_mc_put_surface(Display * display, XvMCSurface * surface,
Drawable draw, short srcx, short srcy,
unsigned short srcw, unsigned short srch,
short destx, short desty,
unsigned short destw, unsigned short desth,
int flags, uint32_t *gem_handle)
{
i915XvMCContext *pI915XvMC;
i915XvMCSurface *pI915Surface;
i915XvMCSubpicture *pI915SubPic;
if (!(pI915Surface = surface->privData))
return XvMCBadSurface;
if (!(pI915XvMC = pI915Surface->privContext))
return XvMCBadSurface;
PPTHREAD_MUTEX_LOCK();
drm_intel_bo_flink(pI915Surface->comm.bo, gem_handle);
PPTHREAD_MUTEX_UNLOCK();
return 0;
}
static int i915_xvmc_mc_get_surface_status(Display * display,
XvMCSurface * surface, int *stat)
{
......@@ -1352,6 +1326,5 @@ struct _intel_xvmc_driver i915_xvmc_mc_driver = {
.create_surface = i915_xvmc_mc_create_surface,
.destroy_surface = i915_xvmc_mc_destroy_surface,
.render_surface = i915_xvmc_mc_render_surface,
.put_surface = i915_xvmc_mc_put_surface,
.get_surface_status = i915_xvmc_mc_get_surface_status,
};
......@@ -877,20 +877,6 @@ static Status render_surface(Display * display,
return Success;
}
static Status put_surface(Display * display, XvMCSurface * surface,
Drawable draw, short srcx, short srcy,
unsigned short srcw, unsigned short srch,
short destx, short desty,
unsigned short destw, unsigned short desth,
int flags, uint32_t *gem_handle)
{
struct intel_xvmc_surface *private_surface = surface->privData;
drm_intel_bo_flink(private_surface->bo, gem_handle);
return Success;
}
static Status get_surface_status(Display * display,
XvMCSurface * surface, int *stats)
{
......@@ -922,6 +908,5 @@ struct _intel_xvmc_driver i965_xvmc_mc_driver = {
.create_surface = create_surface,
.destroy_surface = destroy_surface,
.render_surface = render_surface,
.put_surface = put_surface,
.get_surface_status = get_surface_status,
};
......@@ -719,14 +719,9 @@ _X_EXPORT Status XvMCPutSurface(Display * display, XvMCSurface * surface,
intel_surf->gc = XCreateGC(display, draw, 0, NULL);
}
intel_surf->last_draw = draw;
ret = (xvmc_driver->put_surface) (display, surface, draw, srcx, srcy,
srcw, srch, destx, desty, destw,
desth, flags,
&intel_surf->gem_handle);
if (ret) {
XVMC_ERR("put surface fail\n");
return ret;
}
drm_intel_bo_flink(intel_surf->bo, &intel_surf->gem_handle);
ret = XvPutImage(display, context->port, draw, intel_surf->gc,
intel_surf->image, srcx, srcy, srcw, srch, destx,
desty, destw, desth);
......
......@@ -186,13 +186,6 @@ typedef struct _intel_xvmc_driver {
XvMCMacroBlockArray * macroblock_array,
XvMCBlockArray * blocks);
Status(*put_surface) (Display * display, XvMCSurface * surface,
Drawable draw, short srcx, short srcy,
unsigned short srcw, unsigned short srch,
short destx, short desty,
unsigned short destw, unsigned short desth,
int flags, uint32_t *gem_handle);
Status(*get_surface_status) (Display * display, XvMCSurface * surface,
int *stat);
......
......@@ -1046,19 +1046,6 @@ static Status put_slice2(Display * display, XvMCContext * context,
return Success;
}
static Status put_surface(Display * display, XvMCSurface * surface,
Drawable draw, short srcx, short srcy,
unsigned short srcw, unsigned short srch,
short destx, short desty,
unsigned short destw, unsigned short desth,
int flags, uint32_t *gem_handle)
{
struct intel_xvmc_surface *private_surface = surface->privData;
drm_intel_bo_flink(private_surface->bo, gem_handle);
return Success;
}
static Status render_surface(Display * display,
XvMCContext * context,
unsigned int picture_structure,
......@@ -1269,7 +1256,6 @@ struct _intel_xvmc_driver xvmc_vld_driver = {
.get_surface_status = get_surface_status,
.begin_surface = begin_surface,
.render_surface = render_surface,
.put_surface = put_surface,
.put_slice = put_slice,
.put_slice2 = put_slice2
};
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