libXvMC: unify DestroySurface
Surface bo's can be freed by the common code, then there's nothing driver specific left. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
5f64122551
commit
16e5edde4d
|
|
@ -1011,25 +1011,6 @@ static Status i915_xvmc_mc_create_surface(Display * display,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int i915_xvmc_mc_destroy_surface(Display * display,
|
||||
XvMCSurface * surface)
|
||||
{
|
||||
struct intel_xvmc_surface *intel_surf;
|
||||
i915XvMCContext *pI915XvMC;
|
||||
|
||||
if (!display || !surface)
|
||||
return BadValue;
|
||||
|
||||
if (!(intel_surf = surface->privData))
|
||||
return XvMCBadSurface;
|
||||
|
||||
drm_intel_bo_unreference(intel_surf->bo);
|
||||
|
||||
free(intel_surf);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
static int i915_xvmc_alloc_render_state_buffers(i915XvMCContext *pI915XvMC)
|
||||
{
|
||||
pI915XvMC->sis_bo = drm_intel_bo_alloc(xvmc_driver->bufmgr,
|
||||
|
|
@ -1289,6 +1270,5 @@ struct _intel_xvmc_driver i915_xvmc_mc_driver = {
|
|||
.create_context = i915_xvmc_mc_create_context,
|
||||
.destroy_context = i915_xvmc_mc_destroy_context,
|
||||
.create_surface = i915_xvmc_mc_create_surface,
|
||||
.destroy_surface = i915_xvmc_mc_destroy_surface,
|
||||
.render_surface = i915_xvmc_mc_render_surface,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -271,15 +271,6 @@ static Status create_surface(Display * display,
|
|||
return Success;
|
||||
}
|
||||
|
||||
static Status destroy_surface(Display * display, XvMCSurface * surface)
|
||||
{
|
||||
struct intel_xvmc_surface *priv_surface = surface->privData;
|
||||
XSync(display, False);
|
||||
drm_intel_bo_unreference(priv_surface->bo);
|
||||
free(priv_surface);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static void flush()
|
||||
{
|
||||
struct brw_mi_flush flush;
|
||||
|
|
@ -899,6 +890,5 @@ struct _intel_xvmc_driver i965_xvmc_mc_driver = {
|
|||
.create_context = create_context,
|
||||
.destroy_context = destroy_context,
|
||||
.create_surface = create_surface,
|
||||
.destroy_surface = destroy_surface,
|
||||
.render_surface = render_surface,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -524,7 +524,9 @@ _X_EXPORT Status XvMCDestroySurface(Display * display, XvMCSurface * surface)
|
|||
if (intel_surf->gc_init)
|
||||
XFreeGC(display, intel_surf->gc);
|
||||
|
||||
(xvmc_driver->destroy_surface) (display, surface);
|
||||
drm_intel_bo_unreference(intel_surf->bo);
|
||||
|
||||
free(intel_surf);
|
||||
|
||||
_xvmc_destroy_surface(display, surface);
|
||||
|
||||
|
|
|
|||
|
|
@ -173,8 +173,6 @@ typedef struct _intel_xvmc_driver {
|
|||
XvMCSurface * surface, int priv_count,
|
||||
CARD32 * priv_data);
|
||||
|
||||
Status(*destroy_surface) (Display * display, XvMCSurface * surface);
|
||||
|
||||
Status(*render_surface) (Display * display, XvMCContext * context,
|
||||
unsigned int picture_structure,
|
||||
XvMCSurface * target_surface,
|
||||
|
|
|
|||
|
|
@ -636,15 +636,6 @@ static Status create_surface(Display * display,
|
|||
return Success;
|
||||
}
|
||||
|
||||
static Status destroy_surface(Display * display, XvMCSurface * surface)
|
||||
{
|
||||
struct intel_xvmc_surface *priv_surface = surface->privData;
|
||||
XSync(display, False);
|
||||
drm_intel_bo_unreference(priv_surface->bo);
|
||||
free(priv_surface);
|
||||
return Success;
|
||||
}
|
||||
|
||||
static Status load_qmatrix(Display * display, XvMCContext * context,
|
||||
const XvMCQMatrix * qmx)
|
||||
{
|
||||
|
|
@ -1244,7 +1235,6 @@ struct _intel_xvmc_driver xvmc_vld_driver = {
|
|||
.create_context = create_context,
|
||||
.destroy_context = destroy_context,
|
||||
.create_surface = create_surface,
|
||||
.destroy_surface = destroy_surface,
|
||||
.load_qmatrix = load_qmatrix,
|
||||
.begin_surface = begin_surface,
|
||||
.render_surface = render_surface,
|
||||
|
|
|
|||
Loading…
Reference in New Issue