diff options
author | Dave Airlie <airlied@optimus.(none)> | 2007-10-17 16:35:29 +1000 |
---|---|---|
committer | Dave Airlie <airlied@optimus.(none)> | 2007-10-17 16:35:29 +1000 |
commit | c824c45e72908b5b3fa832fec91c7b47f305180c (patch) | |
tree | 2be4e53c4aad91ffa44117f49d9a219be31e4321 /src | |
parent | aa88d23e615e7f154cf850927a0a7bb9fbb0d2f9 (diff) |
intel: make block handler hook happen no matter what video is in use
This shouldn't make a difference now, but for upcoming EXA/batch changes it
will be more useful
Diffstat (limited to 'src')
-rw-r--r-- | src/i830_driver.c | 21 | ||||
-rw-r--r-- | src/i830_video.c | 24 | ||||
-rw-r--r-- | src/i830_video.h | 3 |
3 files changed, 34 insertions, 14 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c index 1d4e154e..44072413 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -197,6 +197,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "i830_display.h" #include "i830_debug.h" #include "i830_bios.h" +#include "i830_video.h" #ifdef XF86DRI #include "dri.h" @@ -2255,6 +2256,23 @@ IntelEmitInvarientState(ScrnInfoPtr pScrn) } } +static void +I830BlockHandler(int i, + pointer blockData, pointer pTimeout, pointer pReadmask) +{ + ScreenPtr pScreen = screenInfo.screens[i]; + ScrnInfoPtr pScrn = xf86Screens[i]; + I830Ptr pI830 = I830PTR(pScrn); + + pScreen->BlockHandler = pI830->BlockHandler; + + (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + + pScreen->BlockHandler = I830BlockHandler; + + I830VideoBlockHandler(i, blockData, pTimeout, pReadmask); +} + static Bool I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { @@ -2865,6 +2883,9 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "direct rendering: Not available\n"); #endif + pI830->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = I830BlockHandler; + pScreen->SaveScreen = xf86SaveScreen; pI830->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = I830CloseScreen; diff --git a/src/i830_video.c b/src/i830_video.c index 8c2d804a..255444be 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -105,8 +105,6 @@ static int I830QueryImageAttributesOverlay(ScrnInfoPtr, int, unsigned short *, static int I830QueryImageAttributesTextured(ScrnInfoPtr, int, unsigned short *, unsigned short *, int *, int *); -static void I830BlockHandler(int, pointer, pointer, pointer); - #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) static Atom xvBrightness, xvContrast, xvSaturation, xvColorKey, xvPipe, xvDoubleBuffer; @@ -866,9 +864,6 @@ I830SetupImageVideoOverlay(ScreenPtr pScreen) */ pPriv->overlayOK = TRUE; - pI830->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = I830BlockHandler; - xvColorKey = MAKE_ATOM("XV_COLORKEY"); xvBrightness = MAKE_ATOM("XV_BRIGHTNESS"); xvContrast = MAKE_ATOM("XV_CONTRAST"); @@ -2536,20 +2531,22 @@ I830QueryImageAttributesTextured(ScrnInfoPtr pScrn, return I830QueryImageAttributes(pScrn, id, w, h, pitches, offsets, TRUE); } -static void -I830BlockHandler(int i, - pointer blockData, pointer pTimeout, pointer pReadmask) +void +I830VideoBlockHandler(int i, pointer blockData, pointer pTimeout, + pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[i]; ScrnInfoPtr pScrn = xf86Screens[i]; I830Ptr pI830 = I830PTR(pScrn); - I830PortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn); + I830PortPrivPtr pPriv; - pScreen->BlockHandler = pI830->BlockHandler; + if (pI830->adaptor == NULL) + return; - (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + /* No overlay scaler on the 965. */ + if (IS_I965G(pI830)) + return; - pScreen->BlockHandler = I830BlockHandler; + pPriv = GET_PORT_PRIVATE(pScrn); if (pPriv->videoStatus & TIMER_MASK) { #if 1 @@ -2778,7 +2775,6 @@ I830DisplaySurface(XF86SurfacePtr surface, UpdateCurrentTime(); pI830Priv->videoStatus = FREE_TIMER; pI830Priv->freeTime = currentTime.milliseconds + FREE_DELAY; - pScrn->pScreen->BlockHandler = I830BlockHandler; } return Success; diff --git a/src/i830_video.h b/src/i830_video.h index 23954e15..e67831d8 100644 --- a/src/i830_video.h +++ b/src/i830_video.h @@ -90,3 +90,6 @@ void I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, short src_w, short src_h, short drw_w, short drw_h, PixmapPtr pPixmap); + +void I830VideoBlockHandler(int i, pointer blockData, pointer pTimeout, + pointer pReadmask); |