diff options
author | Keith Packard <keithp@keithp.com> | 2008-11-04 00:10:08 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2008-11-24 13:24:35 -0800 |
commit | 9c7ac47b871a71e42d2f6933749ca462f1a65b40 (patch) | |
tree | a7909a89698952e148c8cdbc5dceab674dc2b522 /hw/xfree86/dri/dri.c | |
parent | 554592cd70543f87cd8bee5ff47cc8281511e041 (diff) |
Notify DRI when crtc regions change
Drivers that care about crtc positions on the screen to ensure that vblank
works correctly need to be notified when crtcs are changed.
Provide a hook in the mode setting code that is invoked whenever any
configuration is done to the screen.
Use this new hook in the DRI code so that DRI clients are notified and
receive updated information.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw/xfree86/dri/dri.c')
-rw-r--r-- | hw/xfree86/dri/dri.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index 37136590b..1a3e09111 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -302,6 +302,18 @@ DRIOpenDRMMaster(ScrnInfoPtr pScrn, return FALSE; } +static void +DRIClipNotifyAllDrawables(ScreenPtr pScreen); + +static void +dri_crtc_notify(ScreenPtr pScreen) +{ + DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); + DRIClipNotifyAllDrawables(pScreen); + xf86_unwrap_crtc_notify(pScreen, pDRIPriv->xf86_crtc_notify); + xf86_crtc_notify(pScreen); + pDRIPriv->xf86_crtc_notify = xf86_wrap_crtc_notify(pScreen, dri_crtc_notify); +} Bool DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) @@ -605,6 +617,9 @@ DRIFinishScreenInit(ScreenPtr pScreen) pDRIPriv->DestroyWindow = pScreen->DestroyWindow; pScreen->DestroyWindow = DRIDestroyWindow; + pDRIPriv->xf86_crtc_notify = xf86_wrap_crtc_notify(pScreen, + dri_crtc_notify); + if (pDRIInfo->wrap.CopyWindow) { pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow; pScreen->CopyWindow = pDRIInfo->wrap.CopyWindow; @@ -658,6 +673,9 @@ DRICloseScreen(ScreenPtr pScreen) pScreen->DestroyWindow = pDRIPriv->DestroyWindow; pDRIPriv->DestroyWindow = NULL; } + + xf86_unwrap_crtc_notify(pScreen, pDRIPriv->xf86_crtc_notify); + if (pDRIInfo->wrap.CopyWindow) { pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow; pDRIPriv->wrap.CopyWindow = NULL; @@ -671,6 +689,7 @@ DRICloseScreen(ScreenPtr pScreen) pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame; pDRIPriv->wrap.AdjustFrame = NULL; } + pDRIPriv->wrapped = FALSE; } |