diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/i830.h | 1 | ||||
-rw-r--r-- | src/i830_common.h | 9 | ||||
-rw-r--r-- | src/i830_dri.c | 25 | ||||
-rw-r--r-- | src/i830_driver.c | 6 |
4 files changed, 41 insertions, 0 deletions
@@ -427,6 +427,7 @@ extern void I830DRIUnmapScreenRegions(ScrnInfoPtr pScrn, drmI830Sarea *sarea); extern Bool I830DRIMapScreenRegions(ScrnInfoPtr pScrn, drmI830Sarea *sarea); extern void I830DRIUnlock(ScrnInfoPtr pScrn); extern Bool I830DRILock(ScrnInfoPtr pScrn); +extern Bool I830DRISetVBlankInterrupt (ScrnInfoPtr pScrn, Bool on); #endif extern Bool I830AccelInit(ScreenPtr pScreen); diff --git a/src/i830_common.h b/src/i830_common.h index 41b5cc3c..a27bc011 100644 --- a/src/i830_common.h +++ b/src/i830_common.h @@ -52,6 +52,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define DRM_I830_INIT_HEAP 0x0a #define DRM_I830_CMDBUFFER 0x0b #define DRM_I830_DESTROY_HEAP 0x0c +#define DRM_I830_SET_VBLANK_PIPE 0x0d +#define DRM_I830_GET_VBLANK_PIPE 0x0e + typedef struct { enum { @@ -193,5 +196,11 @@ typedef struct { int region; } drmI830MemDestroyHeap; +#define DRM_I830_VBLANK_PIPE_A 1 +#define DRM_I830_VBLANK_PIPE_B 2 + +typedef struct { + int pipe; +} drmI830VBlankPipe; #endif /* _I830_DRM_H_ */ diff --git a/src/i830_dri.c b/src/i830_dri.c index ed5e6851..7c65f656 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -1454,6 +1454,31 @@ I830UpdateDRIBuffers(ScrnInfoPtr pScrn, drmI830Sarea *sarea) } Bool +I830DRISetVBlankInterrupt (ScrnInfoPtr pScrn, Bool on) +{ + I830Ptr pI830 = I830PTR(pScrn); + drmI830VBlankPipe pipe; + + if (pI830->directRenderingEnabled && pI830->drmMinor >= 5) { + if (on) { + if (pI830->planeEnabled[1]) + pipe.pipe = DRM_I830_VBLANK_PIPE_B; + else + pipe.pipe = DRM_I830_VBLANK_PIPE_A; + } else { + pipe.pipe = 0; + } + if (drmCommandWrite(pI830->drmSubFD, DRM_I830_SET_VBLANK_PIPE, + &pipe, sizeof (pipe))) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I830 Vblank Pipe Setup Failed\n"); + return FALSE; + } + } + + return TRUE; +} + +Bool I830DRILock(ScrnInfoPtr pScrn) { I830Ptr pI830 = I830PTR(pScrn); diff --git a/src/i830_driver.c b/src/i830_driver.c index a4b891b6..907b2042 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -3826,6 +3826,9 @@ RestoreHWState(ScrnInfoPtr pScrn) DPRINTF(PFX, "RestoreHWState\n"); +#ifdef XF86DRI + I830DRISetVBlankInterrupt (pScrn, FALSE); +#endif if (I830IsPrimary(pScrn) && pI830->pipe != pI830->origPipe) SetBIOSPipe(pScrn, pI830->origPipe); else @@ -4411,6 +4414,9 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) #endif #ifdef XF86DRI + I830DRISetVBlankInterrupt (pScrn, TRUE); +#endif +#ifdef XF86DRI if (didLock) I830DRIUnlock(pScrn); #endif |