From 1627af54497bee659ea30f2850b39cbbf576e22d Mon Sep 17 00:00:00 2001 From: Jonathan Lim Date: Fri, 26 Jan 2007 13:00:45 +0100 Subject: [PATCH 1/2] Call linuxPciOpenFile() for r/w access if applicable. Currently, the call to linuxPciOpenFile() is always made for read only access which causes the subsequent mmap call to fail when the memory is mapped read/write. Xorg #9692 --- hw/xfree86/os-support/bus/linuxPci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c index 03388f1ff..55ed87859 100644 --- a/hw/xfree86/os-support/bus/linuxPci.c +++ b/hw/xfree86/os-support/bus/linuxPci.c @@ -570,7 +570,8 @@ linuxMapPci(int ScreenNum, int Flags, PCITAG Tag, xf86InitVidMem(); - if (((fd = linuxPciOpenFile(Tag ,FALSE)) < 0) || + prot = ((Flags & VIDMEM_READONLY) == 0); + if (((fd = linuxPciOpenFile(Tag, prot)) < 0) || (ioctl(fd, mmap_ioctl, 0) < 0)) break; From 31f2d4a57e04f5ea635fbb50c508405c4fc37b65 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 29 Jan 2007 09:39:33 -0800 Subject: [PATCH 2/2] Bug #9680: Remove bogus blank length limiting in xf86SetModeCrtc(). Our modes typically come from EDID or default modes, and when the monitor asks for a specific mode, deciding to tweak it usually results in incorrect display. And if the user is specifying a mode by hand, tweaking it then is still pretty rude. Reviewed by: ajax --- hw/xfree86/common/xf86Mode.c | 39 ------------------------------------ 1 file changed, 39 deletions(-) diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c index 3cebac754..7f5ae362d 100644 --- a/hw/xfree86/common/xf86Mode.c +++ b/hw/xfree86/common/xf86Mode.c @@ -727,45 +727,6 @@ xf86SetModeCrtc(DisplayModePtr p, int adjustFlags) } p->CrtcHAdjusted = FALSE; p->CrtcVAdjusted = FALSE; - - /* - * XXX - * - * The following is taken from VGA, but applies to other cores as well. - */ - p->CrtcVBlankStart = min(p->CrtcVSyncStart, p->CrtcVDisplay); - p->CrtcVBlankEnd = max(p->CrtcVSyncEnd, p->CrtcVTotal); - if ((p->CrtcVBlankEnd - p->CrtcVBlankStart) >= 127) { - /* - * V Blanking size must be < 127. - * Moving blank start forward is safer than moving blank end - * back, since monitors clamp just AFTER the sync pulse (or in - * the sync pulse), but never before. - */ - p->CrtcVBlankStart = p->CrtcVBlankEnd - 127; - /* - * If VBlankStart is now > VSyncStart move VBlankStart - * to VSyncStart using the maximum width that fits into - * VTotal. - */ - if (p->CrtcVBlankStart > p->CrtcVSyncStart) { - p->CrtcVBlankStart = p->CrtcVSyncStart; - p->CrtcVBlankEnd = min(p->CrtcHBlankStart + 127, p->CrtcVTotal); - } - } - p->CrtcHBlankStart = min(p->CrtcHSyncStart, p->CrtcHDisplay); - p->CrtcHBlankEnd = max(p->CrtcHSyncEnd, p->CrtcHTotal); - - if ((p->CrtcHBlankEnd - p->CrtcHBlankStart) >= 63 * 8) { - /* - * H Blanking size must be < 63*8. Same remark as above. - */ - p->CrtcHBlankStart = p->CrtcHBlankEnd - 63 * 8; - if (p->CrtcHBlankStart > p->CrtcHSyncStart) { - p->CrtcHBlankStart = p->CrtcHSyncStart; - p->CrtcHBlankEnd = min(p->CrtcHBlankStart + 63 * 8, p->CrtcHTotal); - } - } } /**