summaryrefslogtreecommitdiff
path: root/GL/glx/glxdri.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2006-09-07 15:35:16 -0400
committerKristian Høgsberg <krh@redhat.com>2006-09-07 15:35:16 -0400
commit86450998da616e3d00d4d6293acc35eccc2061e7 (patch)
tree82566dd3597d6827d3699dab270463e32df5e143 /GL/glx/glxdri.c
parent64479fffa22581cc7d753065c33eda5520b7db9a (diff)
Fix AIGLX VT switching.
See https://bugs.freedesktop.org/show_bug.cgi?id=7916 There may be a simpler, less intrusive fix that involves just rearranging DRI locking between 2D and 3D drivers around VT switch.
Diffstat (limited to 'GL/glx/glxdri.c')
-rw-r--r--GL/glx/glxdri.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c
index 41e49e225..b5723049d 100644
--- a/GL/glx/glxdri.c
+++ b/GL/glx/glxdri.c
@@ -73,6 +73,9 @@ struct __GLXDRIscreen {
__DRIscreen driScreen;
void *driver;
+ xf86EnterVTProc *enterVT;
+ xf86LeaveVTProc *leaveVT;
+
unsigned char glx_enable_bits[__GLX_EXT_BYTES];
};
@@ -622,8 +625,7 @@ static __DRIfuncPtr getProcAddress(const char *proc_name)
static __DRIscreen *findScreen(__DRInativeDisplay *dpy, int scrn)
{
- __GLXDRIscreen *screen =
- (__GLXDRIscreen *) __glXgetActiveScreen(scrn);
+ __GLXDRIscreen *screen = (__GLXDRIscreen *) __glXgetActiveScreen(scrn);
return &screen->driScreen;
}
@@ -817,6 +819,30 @@ static const __DRIinterfaceMethods interface_methods = {
static const char dri_driver_path[] = DRI_DRIVER_PATH;
+static Bool
+glxDRIEnterVT (int index, int flags)
+{
+ __GLXDRIscreen *screen = (__GLXDRIscreen *) __glXgetActiveScreen(index);
+
+ LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
+
+ glxResumeClients();
+
+ return (*screen->enterVT) (index, flags);
+}
+
+static void
+glxDRILeaveVT (int index, int flags)
+{
+ __GLXDRIscreen *screen = (__GLXDRIscreen *) __glXgetActiveScreen(index);
+
+ LogMessage(X_INFO, "AIGLX: Suspending AIGLX clients for VT switch\n");
+
+ glxSuspendClients();
+
+ return (*screen->leaveVT) (index, flags);
+}
+
static __GLXscreen *
__glXDRIscreenProbe(ScreenPtr pScreen)
{
@@ -842,6 +868,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
char filename[128];
Bool isCapable;
size_t buffer_size;
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable")) {
LogMessage(X_ERROR, "AIGLX: DRI module not loaded\n");
@@ -1029,6 +1056,11 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
__glXsetEnterLeaveServerFuncs(__glXDRIenterServer, __glXDRIleaveServer);
+ screen->enterVT = pScrn->EnterVT;
+ pScrn->EnterVT = glxDRIEnterVT;
+ screen->leaveVT = pScrn->LeaveVT;
+ pScrn->LeaveVT = glxDRILeaveVT;
+
LogMessage(X_INFO,
"AIGLX: Loaded and initialized %s\n", filename);