xserver: Branch 'server-1.3-branch' - 2 commits
Keith Packard
keithp at kemper.freedesktop.org
Tue Apr 10 00:12:42 EEST 2007
GL/glx/glxdri.c | 6 +++++-
hw/xfree86/modes/xf86Crtc.c | 10 ++++++++--
hw/xfree86/modes/xf86RandR12.c | 22 ++++++++++++++++++++++
hw/xfree86/modes/xf86RandR12.h | 1 +
4 files changed, 36 insertions(+), 3 deletions(-)
New commits:
diff-tree dc6c4f6989f87149d8605604f4514f5cbf11de67 (from 7cf3a0e0b954cc3bfdf158cdc1ca145d1620fe0c)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Mon Apr 9 14:12:27 2007 -0700
Disable CRTC when SetSingleMode has no matching mode. Update RandR as well.
xf86SetSingleMode tries to resize all crtcs to match the selected mode. When
a CRTC has no matching mode, it now disables the CRTC (instead of crashing).
Also, poke the RandR extension when xf86SetSingleMode is done so that
appropriate events can be delivered, and so that future RandR queries return
correct information.
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 325fb64..eba32e4 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -233,8 +233,6 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, Displ
int saved_x, saved_y;
Rotation saved_rotation;
- adjusted_mode = xf86DuplicateMode(mode);
-
crtc->enabled = xf86CrtcInUse (crtc);
if (!crtc->enabled)
@@ -243,6 +241,8 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, Displ
return TRUE;
}
+ adjusted_mode = xf86DuplicateMode(mode);
+
didLock = crtc->funcs->lock (crtc);
saved_mode = crtc->mode;
@@ -1817,6 +1817,11 @@ xf86SetSingleMode (ScrnInfoPtr pScrn, Di
else
crtc_mode = xf86OutputFindClosestMode (output, desired);
}
+ if (!crtc_mode)
+ {
+ crtc->enabled = FALSE;
+ continue;
+ }
if (!xf86CrtcSetMode (crtc, crtc_mode, rotation, 0, 0))
ok = FALSE;
else
@@ -1828,6 +1833,7 @@ xf86SetSingleMode (ScrnInfoPtr pScrn, Di
}
}
xf86DisableUnusedFunctions(pScrn);
+ xf86RandR12TellChanged (pScrn->pScreen);
return ok;
}
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 6f52ee2..90de585 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -1048,6 +1048,28 @@ xf86RandR12CreateScreenResources12 (Scre
return TRUE;
}
+/*
+ * Something happened within the screen configuration due
+ * to DGA, VidMode or hot key. Tell RandR
+ */
+
+void
+xf86RandR12TellChanged (ScreenPtr pScreen)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+ XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
+ int c;
+
+ if (!randrp)
+ return;
+ xf86RandR12SetInfo12 (pScreen);
+ for (c = 0; c < config->num_crtc; c++)
+ xf86RandR12CrtcNotify (config->crtc[c]->randr_crtc);
+
+ RRTellChanged (pScreen);
+}
+
static void
xf86RandR12PointerMoved (int scrnIndex, int x, int y)
{
diff --git a/hw/xfree86/modes/xf86RandR12.h b/hw/xfree86/modes/xf86RandR12.h
index 8a4668b..0d3346a 100644
--- a/hw/xfree86/modes/xf86RandR12.h
+++ b/hw/xfree86/modes/xf86RandR12.h
@@ -33,5 +33,6 @@ Bool xf86RandR12SetConfig(ScreenPtr pScr
Rotation xf86RandR12GetRotation(ScreenPtr pScreen);
void xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y);
Bool xf86RandR12PreInit (ScrnInfoPtr pScrn);
+void xf86RandR12TellChanged (ScreenPtr pScreen);
#endif /* _XF86_RANDR_H_ */
diff-tree 7cf3a0e0b954cc3bfdf158cdc1ca145d1620fe0c (from 970cacb264a597573e0927410dde5a3d3aa6549b)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Mon Apr 9 12:30:31 2007 -0700
In AIGLX EnterVT processing, invoke driver EnterVT before resuming glx.
As the driver EnterVT function generally re-enables the hardware and
prepares it for rendering, it must be called before any gl functions are
called which could touch the hardware.
(cherry picked from commit f24391dbfd12a84253dfec794ee7884afd52e197)
diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c
index 36464a6..788b87d 100644
--- a/GL/glx/glxdri.c
+++ b/GL/glx/glxdri.c
@@ -815,12 +815,16 @@ static Bool
glxDRIEnterVT (int index, int flags)
{
__GLXDRIscreen *screen = (__GLXDRIscreen *) __glXgetActiveScreen(index);
+ Bool ret;
LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
+ if (!(*screen->enterVT) (index, flags))
+ return FALSE;
+
glxResumeClients();
- return (*screen->enterVT) (index, flags);
+ return TRUE;
}
static void
More information about the xorg-commit
mailing list