diff options
author | Dave Airlie <airlied@linux.ie> | 2007-06-03 16:49:14 +1000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2007-06-03 16:49:14 +1000 |
commit | 63f0d4ed0a98830ecbe18c6e4174689111a59b68 (patch) | |
tree | 12883bb4c2296c49b756624c10ffba14ac57bcfa /src/radeon_dri.c | |
parent | d7775c1b38b5bdc439a27ec2c3c3a03a5b24cf57 (diff) |
randr-1.2: add support for vblank on both heads
Also disable vbl when 3D isn't running
Diffstat (limited to 'src/radeon_dri.c')
-rw-r--r-- | src/radeon_dri.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/radeon_dri.c b/src/radeon_dri.c index 39393f54..97ed357f 100644 --- a/src/radeon_dri.c +++ b/src/radeon_dri.c @@ -1352,6 +1352,29 @@ Bool RADEONDRIGetVersion(ScrnInfoPtr pScrn) return TRUE; } +Bool RADEONDRISetVBlankInterrupt(ScrnInfoPtr pScrn, Bool on) +{ + RADEONInfoPtr info = RADEONPTR(pScrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + int value = 0; + + if (info->directRenderingEnabled && info->pKernelDRMVersion->version_minor >= 28) { + if (on) { + if (xf86_config->num_crtc > 1 && xf86_config->crtc[1]->enabled) + value = DRM_RADEON_VBLANK_CRTC1 | DRM_RADEON_VBLANK_CRTC2; + else + value = DRM_RADEON_VBLANK_CRTC1; + } + + if (RADEONDRISetParam(pScrn, RADEON_SETPARAM_VBLANK_CRTC, value)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "RADEON Vblank Crtc Setup Failed %d\n", value); + return FALSE; + } + } + return TRUE; +} + + /* Initialize the screen-specific data structures for the DRI and the * Radeon. This is the main entry point to the device-specific * initialization code. It calls device-independent DRI functions to @@ -2029,6 +2052,9 @@ static void RADEONDRITransitionTo3d(ScreenPtr pScreen) RADEONChangeSurfaces(pScrn); RADEONEnablePageFlip(pScreen); + + info->want_vblank_interrupts = TRUE; + RADEONDRISetVBlankInterrupt(pScrn, TRUE); if (info->cursor) xf86ForceHWCursor (pScreen, TRUE); @@ -2068,6 +2094,9 @@ static void RADEONDRITransitionTo2d(ScreenPtr pScreen) RADEONChangeSurfaces(pScrn); + info->want_vblank_interrupts = FALSE; + RADEONDRISetVBlankInterrupt(pScrn, FALSE); + if (info->cursor) xf86ForceHWCursor (pScreen, FALSE); } |