summaryrefslogtreecommitdiff
path: root/src/i830_dri.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@neko.keithp.com>2006-06-19 13:47:28 -0700
committerKeith Packard <keithp@neko.keithp.com>2006-06-19 13:47:28 -0700
commit8a6edba33213911cc2210b5e903428b81d45862f (patch)
treecf1ff10a7d2ca15319a286ef932dad91dc594acf /src/i830_dri.c
parenta73ab7f0e6e3b0462e05c0031ffd602ed3e2bcd4 (diff)
Set vblank interrupt configuration to match pipe configuration
New i915 drm ioctl (in version 1.5) allows the X server to select which pipe drives vblank interrupts. Use this to drive from the 'preferred' pipe. Yes, per-window vblanks would be nice in a shared fb environment. Maybe someday. (cherry picked from 2fb375b665f4802819b89f2277fd6154006c11ee commit)
Diffstat (limited to 'src/i830_dri.c')
-rw-r--r--src/i830_dri.c25
1 files changed, 25 insertions, 0 deletions
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);