From 3cf862717688aa679b5e667cd041ddd6f5db0b58 Mon Sep 17 00:00:00 2001 From: Zhenyu Wang Date: Thu, 29 Nov 2007 23:12:16 +0800 Subject: xvmc: add "XvMC" option, default is false. --- src/i830_driver.c | 12 ++++++++++++ src/i830_hwmc.c | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/i830_driver.c b/src/i830_driver.c index 0a059348..d2d405d4 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -301,6 +301,9 @@ typedef enum { OPTION_INTELTEXPOOL, #endif OPTION_TRIPLEBUFFER, +#ifdef XvMCExtension + OPTION_XVMC, +#endif } I830Opts; static OptionInfoRec I830Options[] = { @@ -323,6 +326,9 @@ static OptionInfoRec I830Options[] = { {OPTION_INTELTEXPOOL,"Legacy3D", OPTV_BOOLEAN, {0}, FALSE}, #endif {OPTION_TRIPLEBUFFER, "TripleBuffer", OPTV_BOOLEAN, {0}, FALSE}, +#ifdef XvMCExtension + {OPTION_XVMC, "XvMC", OPTV_BOOLEAN, {0}, FALSE}, +#endif {-1, NULL, OPTV_NONE, {0}, FALSE} }; /* *INDENT-ON* */ @@ -1588,6 +1594,12 @@ I830PreInit(ScrnInfoPtr pScrn, int flags) pI830->TripleBuffer ? "en" : "dis"); #endif +#ifdef XvMCExtension + pI830->XvMCEnabled = xf86ReturnOptValBool(pI830->Options, OPTION_XVMC, FALSE); + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Intel XvMC decoder %sabled\n", + pI830->XvMCEnabled ? "en" : "dis"); +#endif + /* * If the driver can do gamma correction, it should call xf86SetGamma() here. */ diff --git a/src/i830_hwmc.c b/src/i830_hwmc.c index 721616c1..189c2e56 100644 --- a/src/i830_hwmc.c +++ b/src/i830_hwmc.c @@ -52,6 +52,9 @@ Bool intel_xvmc_probe(ScrnInfoPtr pScrn) I830Ptr pI830 = I830PTR(pScrn); Bool ret = FALSE; + if (!pI830->XvMCEnabled) + return FALSE; + if (IS_I9XX(pI830)) { if (!IS_I965G(pI830)) ret = intel_xvmc_set_driver(&i915_xvmc_driver); @@ -101,7 +104,6 @@ Bool intel_xvmc_screen_init(ScreenPtr pScreen) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[XvMC] %s driver initialized.\n", xvmc_driver->name); - pI830->XvMCEnabled = TRUE; } else { intel_xvmc_finish(pScrn); pI830->XvMCEnabled = FALSE; -- cgit v1.2.3