summaryrefslogtreecommitdiff
path: root/src/xvmc
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2010-03-10 16:51:10 +0100
committerOwain G. Ainsworth <oga@openbsd.org>2010-05-16 19:59:29 +0100
commitb55d91b7c81c13fd6383efd938e6f12500881c7e (patch)
treeb89d19e81df23bb3cc00cb17ea00aa362aa3fd97 /src/xvmc
parent705c508da5d94d8ccebfa34d35a0f7887c530794 (diff)
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> (cherry picked from commit 16e5edde4d97e1818e0dbfbc165bd8199f697336) Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
Diffstat (limited to 'src/xvmc')
-rw-r--r--src/xvmc/i915_xvmc.c20
-rw-r--r--src/xvmc/i965_xvmc.c10
-rw-r--r--src/xvmc/intel_xvmc.c4
-rw-r--r--src/xvmc/intel_xvmc.h2
-rw-r--r--src/xvmc/xvmc_vld.c10
5 files changed, 3 insertions, 43 deletions
diff --git a/src/xvmc/i915_xvmc.c b/src/xvmc/i915_xvmc.c
index 0773c2ed..55d81960 100644
--- a/src/xvmc/i915_xvmc.c
+++ b/src/xvmc/i915_xvmc.c
@@ -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,
};
diff --git a/src/xvmc/i965_xvmc.c b/src/xvmc/i965_xvmc.c
index 31e61843..91086ee6 100644
--- a/src/xvmc/i965_xvmc.c
+++ b/src/xvmc/i965_xvmc.c
@@ -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,
};
diff --git a/src/xvmc/intel_xvmc.c b/src/xvmc/intel_xvmc.c
index f5d9b183..0b778c84 100644
--- a/src/xvmc/intel_xvmc.c
+++ b/src/xvmc/intel_xvmc.c
@@ -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);
diff --git a/src/xvmc/intel_xvmc.h b/src/xvmc/intel_xvmc.h
index 21b7b816..23af6bb8 100644
--- a/src/xvmc/intel_xvmc.h
+++ b/src/xvmc/intel_xvmc.h
@@ -174,8 +174,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,
diff --git a/src/xvmc/xvmc_vld.c b/src/xvmc/xvmc_vld.c
index 7942569a..f314a4f3 100644
--- a/src/xvmc/xvmc_vld.c
+++ b/src/xvmc/xvmc_vld.c
@@ -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,