summaryrefslogtreecommitdiff
path: root/src/i915_hwmc.c
diff options
context:
space:
mode:
authorZhenyu Wang <zhenyu.z.wang@intel.com>2007-11-29 22:56:13 +0800
committerZhenyu Wang <zhenyu.z.wang@intel.com>2007-11-29 22:56:13 +0800
commit6da4b7a80cdf730018435fe84485ecdad62bc860 (patch)
treed02f7c77ef7ebf8d39951773ee98b25ca4bbb9da /src/i915_hwmc.c
parentdf47b7ba57f3e7dc8bac1898679186d9d48639ac (diff)
xvmc: move batch buffer init/fini code into generic
Diffstat (limited to 'src/i915_hwmc.c')
-rw-r--r--src/i915_hwmc.c37
1 files changed, 2 insertions, 35 deletions
diff --git a/src/i915_hwmc.c b/src/i915_hwmc.c
index 9e28d16f..262c63bd 100644
--- a/src/i915_hwmc.c
+++ b/src/i915_hwmc.c
@@ -805,39 +805,6 @@ static int i915_xvmc_put_image_size(ScrnInfoPtr pScrn)
return sizeof(I915XvMCCommandBuffer);
}
-static Bool i915_xvmc_init_batch(ScrnInfoPtr pScrn)
-{
- I830Ptr pI830 = I830PTR(pScrn);
-
- if (!i830_allocate_xvmc_buffer(pScrn, "[XvMC] batch buffer",
- &(xvmc_driver->batch), 8 * 1024,
- ALIGN_BOTH_ENDS))
- return FALSE;
-
- if (drmAddMap(pI830->drmSubFD,
- (drm_handle_t)(xvmc_driver->batch->offset+pI830->LinearAddr),
- xvmc_driver->batch->size, DRM_AGP, 0,
- &xvmc_driver->batch_handle) < 0) {
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "[drm] drmAddMap(batchbuffer_handle) failed!\n");
- return FALSE;
- }
- return TRUE;
-}
-
-static void i915_xvmc_fini_batch(ScrnInfoPtr pScrn)
-{
- I830Ptr pI830 = I830PTR(pScrn);
-
- if (xvmc_driver->batch_handle) {
- drmRmMap(pI830->drmSubFD, xvmc_driver->batch_handle);
- xvmc_driver->batch_handle = 0;
- }
- if (xvmc_driver->batch) {
- i830_free_memory(pScrn, xvmc_driver->batch);
- xvmc_driver->batch = NULL;
- }
-}
static Bool i915_xvmc_init(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr XvAdapt)
{
@@ -850,7 +817,7 @@ static Bool i915_xvmc_init(ScrnInfoPtr pScrn, XF86VideoAdaptorPtr XvAdapt)
return FALSE;
}
xvmc_driver->devPrivate = (void*)pXvMC;
- if (!i915_xvmc_init_batch(pScrn)) {
+ if (!intel_xvmc_init_batch(pScrn)) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"[XvMC] fail to init batch buffer\n");
xfree(pXvMC);
@@ -869,7 +836,7 @@ static void i915_xvmc_fini(ScrnInfoPtr pScrn)
I915XvMCPtr pXvMC = (I915XvMCPtr)xvmc_driver->devPrivate;
cleanupI915XvMC(pXvMC);
- i915_xvmc_fini_batch(pScrn);
+ intel_xvmc_fini_batch(pScrn);
xfree(xvmc_driver->devPrivate);
}