xserver: Branch 'master' - 3 commits
Eric Anholt
anholt at kemper.freedesktop.org
Tue Apr 10 23:00:08 EEST 2007
hw/xfree86/modes/xf86Crtc.c | 10 ++++++++--
hw/xfree86/modes/xf86RandR12.c | 22 ++++++++++++++++++++++
hw/xfree86/modes/xf86RandR12.h | 1 +
hw/xfree86/os-support/bsd/Makefile.am | 3 +--
hw/xfree86/os-support/bsd/ppc_video.c | 33 +++++++++++++++++++++++++++++++++
randr/rrscreen.c | 13 ++++++++++---
6 files changed, 75 insertions(+), 7 deletions(-)
New commits:
diff-tree 4aae2de74b9224bac2b2e2522637dac09abc3837 (from f77a8ea849d171a8ca00b2b7334866ace1ffbf73)
Author: Jared D. McNeill <jmcneill at netbsd.org>
Date: Tue Apr 10 12:57:15 2007 -0700
Add a real xf86EnableIO/xf86DisableIO for NetBSD/PPC.
diff --git a/hw/xfree86/os-support/bsd/Makefile.am b/hw/xfree86/os-support/bsd/Makefile.am
index 0992404..0432ba9 100644
--- a/hw/xfree86/os-support/bsd/Makefile.am
+++ b/hw/xfree86/os-support/bsd/Makefile.am
@@ -38,8 +38,7 @@ ARCH_SOURCES = i386_video.c
endif
if PPC_VIDEO
-ARCH_SOURCES = ppc_video.c \
- $(srcdir)/../shared/ioperm_noop.c
+ARCH_SOURCES = ppc_video.c
endif
if SPARC64_VIDEO
diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c
index ae65c8f..6a23b4e 100644
--- a/hw/xfree86/os-support/bsd/ppc_video.c
+++ b/hw/xfree86/os-support/bsd/ppc_video.c
@@ -56,6 +56,9 @@
static pointer ppcMapVidMem(int, unsigned long, unsigned long, int flags);
static void ppcUnmapVidMem(int, pointer, unsigned long);
+Bool xf86EnableIO(void);
+void xf86DisableIO(void);
+
void
xf86OSInitVidMem(VidMemInfoPtr pVidMem)
{
@@ -63,6 +66,7 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
pVidMem->mapMem = ppcMapVidMem;
pVidMem->unmapMem = ppcUnmapVidMem;
pVidMem->initialised = TRUE;
+ xf86EnableIO();
}
@@ -138,3 +142,32 @@ xf86EnableInterrupts()
return;
}
+
+Bool xf86EnableIO()
+{
+ int fd = xf86Info.screenFd;
+
+ xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd);
+ if (ioBase == MAP_FAILED)
+ {
+ ioBase=mmap(NULL, 0x10000, PROT_READ|PROT_WRITE, MAP_SHARED, fd,
+ 0xf2000000);
+ xf86MsgVerb(X_INFO, 3, "xf86EnableIO: %08x\n", ioBase);
+ if (ioBase == MAP_FAILED) {
+ xf86MsgVerb(X_WARNING, 3, "Can't map IO space!\n");
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+void xf86DisableIO()
+{
+
+ if (ioBase != MAP_FAILED)
+ {
+ munmap(__UNVOLATILE(ioBase), 0x10000);
+ ioBase = MAP_FAILED;
+ }
+}
+
diff-tree f77a8ea849d171a8ca00b2b7334866ace1ffbf73 (from bcf17df69a232e5e84609abacdca36274316e170)
Author: Keith Packard <keithp at neko.keithp.com>
Date: Mon Apr 9 14:29:46 2007 -0700
Rotate screen size as needed from RandR 1.1 change requests.
Screen size must reflect rotated mode size when setting rotated mode using
RandR 1.1 SetScreenConfig request.
(cherry picked from commit efcec7dbd3c2736c7b421d29c4d37e231aa681d2)
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index f83fce3..d92a0ff 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -741,6 +741,7 @@ ProcRRSetScreenConfig (ClientPtr client)
RRModePtr mode;
RR10DataPtr pData = NULL;
RRScreenSizePtr pSize;
+ int width, height;
UpdateCurrentTime ();
@@ -883,8 +884,14 @@ ProcRRSetScreenConfig (ClientPtr client)
* If the screen size is changing, adjust all of the other outputs
* to fit the new size, mirroring as much as possible
*/
- if (mode->mode.width != pScreen->width ||
- mode->mode.height != pScreen->height)
+ width = mode->mode.width;
+ height = mode->mode.height;
+ if (rotation & (RR_Rotate_90|RR_Rotate_270))
+ {
+ width = mode->mode.height;
+ height = mode->mode.width;
+ }
+ if (width != pScreen->width || height != pScreen->height)
{
int c;
@@ -898,7 +905,7 @@ ProcRRSetScreenConfig (ClientPtr client)
goto sendReply;
}
}
- if (!RRScreenSizeSet (pScreen, mode->mode.width, mode->mode.height,
+ if (!RRScreenSizeSet (pScreen, width, height,
pScreen->mmWidth, pScreen->mmHeight))
{
rep.status = RRSetConfigFailed;
diff-tree bcf17df69a232e5e84609abacdca36274316e170 (from 67e1c98895a566f927e1ae2384d56cfca104f971)
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.
(cherry picked from commit dc6c4f6989f87149d8605604f4514f5cbf11de67)
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 0fe03d3..7e7c7e7 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;
@@ -1833,6 +1833,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
@@ -1844,6 +1849,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_ */
More information about the xorg-commit
mailing list