summaryrefslogtreecommitdiff
path: root/src/radeon_dri.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2007-06-03 17:10:49 +1000
committerDave Airlie <airlied@linux.ie>2007-06-03 17:10:49 +1000
commitdcb64a4d3947e5a9fbda4b72e29a5b6102370f07 (patch)
treeefcd0a201b16d1cfa611e85d751226def78b3dad /src/radeon_dri.c
parent4c61c0ee91a2ffeefce30972a584486f1df1d1ae (diff)
radeon: disable vbl interrupts when no 3d is running on a new enough drm
Diffstat (limited to 'src/radeon_dri.c')
-rw-r--r--src/radeon_dri.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/radeon_dri.c b/src/radeon_dri.c
index 39393f5..63c35b4 100644
--- a/src/radeon_dri.c
+++ b/src/radeon_dri.c
@@ -1352,6 +1352,25 @@ Bool RADEONDRIGetVersion(ScrnInfoPtr pScrn)
return TRUE;
}
+Bool RADEONDRISetVBlankInterrupt(ScrnInfoPtr pScrn, Bool on)
+{
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ int value = 0;
+
+ if (info->directRenderingEnabled && info->pKernelDRMVersion->version_minor >= 28) {
+ /* we could do something with mergedfb here I'm sure */
+ if (on)
+ 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 +2048,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 +2090,9 @@ static void RADEONDRITransitionTo2d(ScreenPtr pScreen)
RADEONChangeSurfaces(pScrn);
+ info->want_vblank_interrupts = FALSE;
+ RADEONDRISetVBlankInterrupt(pScrn, FALSE);
+
if (info->cursor)
xf86ForceHWCursor (pScreen, FALSE);
}