Commit cfa907ad authored by Daniel Vetter's avatar Daniel Vetter

XvMC: unify surface functions

Like for the subpicture stuff, share the "do-nothing" functions ...
And fix function name spelling, too.
Signed-off-by: Daniel Vetter's avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 036cd4bb
......@@ -210,34 +210,12 @@ static int i915_xvmc_create_context(ScrnInfoPtr scrn, XvMCContextPtr pContext,
return Success;
}
static int i915_xvmc_create_surface(ScrnInfoPtr scrn, XvMCSurfacePtr pSurf,
int *num_priv, long **priv)
{
intel_screen_private *intel = intel_get_screen_private(scrn);
if (!intel->XvMCEnabled) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"[XvMC] i915: XvMC disabled!\n");
return BadAlloc;
}
*priv = NULL;
*num_priv = 0;
return Success;
}
static void i915_xvmc_destroy_context(ScrnInfoPtr scrn,
XvMCContextPtr pContext)
{
return;
}
static void i915_xvmc_destroy_surface(ScrnInfoPtr scrn, XvMCSurfacePtr pSurf)
{
return;
}
static int create_subpicture(ScrnInfoPtr scrn, XvMCSubpicturePtr subpicture,
int *num_priv, CARD32 ** priv)
{
......@@ -248,6 +226,16 @@ static void destroy_subpicture(ScrnInfoPtr scrn, XvMCSubpicturePtr subpicture)
{
}
static int create_surface(ScrnInfoPtr scrn, XvMCSurfacePtr surface,
int *num_priv, CARD32 ** priv)
{
return Success;
}
static void destroy_surface(ScrnInfoPtr scrn, XvMCSurfacePtr surface)
{
}
/* Fill in the device dependent adaptor record.
* This is named "Intel(R) Textured Video" because this code falls under the
* XV extenstion, the name must match or it won't be used.
......@@ -265,10 +253,8 @@ static XF86MCAdaptorRec pAdapt = {
(xf86XvMCCreateContextProcPtr) i915_xvmc_create_context,
.DestroyContext =
(xf86XvMCDestroyContextProcPtr) i915_xvmc_destroy_context,
.CreateSurface =
(xf86XvMCCreateSurfaceProcPtr) i915_xvmc_create_surface,
.DestroySurface =
(xf86XvMCDestroySurfaceProcPtr) i915_xvmc_destroy_surface,
.CreateSurface = create_surface,
.DestroySurface = destroy_surface,
.CreateSubpicture = create_subpicture,
.DestroySubpicture = destroy_subpicture,
};
......@@ -330,16 +316,6 @@ static void destroy_context(ScrnInfoPtr scrn, XvMCContextPtr context)
Xfree(private_context);
}
static int create_surface(ScrnInfoPtr scrn, XvMCSurfacePtr surface,
int *num_priv, CARD32 ** priv)
{
return Success;
}
static void destory_surface(ScrnInfoPtr scrn, XvMCSurfacePtr surface)
{
}
static XF86MCSurfaceInfoRec yv12_mpeg2_vld_surface = {
FOURCC_YV12,
XVMC_CHROMA_FORMAT_420,
......@@ -403,7 +379,7 @@ static XF86MCAdaptorRec adaptor_vld = {
.CreateContext = create_context,
.DestroyContext = destroy_context,
.CreateSurface = create_surface,
.DestroySurface = destory_surface,
.DestroySurface = destroy_surface,
.CreateSubpicture = create_subpicture,
.DestroySubpicture = destroy_subpicture
};
......@@ -416,7 +392,7 @@ static XF86MCAdaptorRec adaptor = {
.CreateContext = create_context,
.DestroyContext = destroy_context,
.CreateSurface = create_surface,
.DestroySurface = destory_surface,
.DestroySurface = destroy_surface,
.CreateSubpicture = create_subpicture,
.DestroySubpicture = destroy_subpicture
};
......
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