diff options
author | Kristian Høgsberg <krh@redhat.com> | 2009-03-04 17:10:24 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2009-03-04 17:10:28 -0500 |
commit | 095a001f755201d3c19335b67a84c57b1d080a83 (patch) | |
tree | e2f406efecb23e812fbe18ed1a40c5e99c8a21de /src/i830_driver.c | |
parent | 14bb61e0c2e28725a2f6167d3263649bc845be18 (diff) |
Use drmSetMaster() and drmDropMaster() in enter/leave VT
This allows multiple X server to use DRI and makes it possible to run
multiple X servers under KMS. This requires a 2.6.29 kernel to work.
On older kernels it will just log a warning and DRI will fail to
initialize for the second X server.
Diffstat (limited to 'src/i830_driver.c')
-rw-r--r-- | src/i830_driver.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c index 342a0595..f80ca698 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -3536,6 +3536,7 @@ I830LeaveVT(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; I830Ptr pI830 = I830PTR(pScrn); + int ret; #ifndef HAVE_FREE_SHADOW xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int o; @@ -3629,6 +3630,13 @@ I830LeaveVT(int scrnIndex, int flags) if (pI830->AccelInfoRec) pI830->AccelInfoRec->NeedToSync = FALSE; + +#ifdef XF86DRI + ret = drmDropMaster(pI830->drmSubFD); + if (ret) + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "drmDropMaster failed: %s\n", strerror(ret)); +#endif } /* @@ -3639,9 +3647,17 @@ I830EnterVT(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; I830Ptr pI830 = I830PTR(pScrn); + int ret; DPRINTF(PFX, "Enter VT\n"); +#ifdef XF86DRI + ret = drmSetMaster(pI830->drmSubFD); + if (ret) + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "drmDropMaster failed: %s\n", strerror(ret)); +#endif + /* * Only save state once per server generation since that's what most * drivers do. Could change this to save state at each VT enter. |