xserver: Branch 'server-1.9-branch' - 5 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Tue Nov 23 11:07:05 PST 2010


 hw/xfree86/common/xf86Mode.c            |   64 +++++++++++++++++++++++++++++---
 hw/xfree86/dri2/dri2.c                  |   11 +++--
 hw/xfree86/modes/xf86EdidModes.c        |    4 +-
 hw/xfree86/os-support/hurd/hurd_video.c |    9 ++++
 hw/xfree86/os-support/linux/lnx_video.c |    2 +
 hw/xfree86/x86emu/ops.c                 |   20 +++++++---
 6 files changed, 93 insertions(+), 17 deletions(-)

New commits:
commit 2da9b72835e30af1ee4bb634ba4a33e2dac6bcbf
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Jul 27 17:34:36 2010 -0400

    edid: Fix the HDTV sync pulse adjustment
    
    Simple typo, should have been adjusting the horizontal timings
    consistently since we're not trying to mangle vertical at all.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Patrick E. Kane <pekane52 at gmail.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit b2f9ce201cc2a14d5d6ad055b46c9317b040ec2e)

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index 8f4d04f..a94379f 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -484,8 +484,8 @@ DDCModesFromStandardTiming(struct std_timings *timing, ddc_quirk_t quirks,
 	     (hsize == 1368 && vsize == 769))) {
 	    Mode = xf86CVTMode(1366, 768, 60, FALSE, FALSE);
 	    Mode->HDisplay = 1366;
-	    Mode->VSyncStart--;
-	    Mode->VSyncEnd--;
+	    Mode->HSyncStart--;
+	    Mode->HSyncEnd--;
 	} else if (hsize && vsize && refresh) {
 	    Mode = FindDMTMode(hsize, vsize, refresh, rb);
 
commit a4452133ffb943536dcaeee055e8f14cc4c32d85
Author: Luc Verhaegen <libv at skynet.be>
Date:   Sun Oct 24 23:57:06 2010 +0200

    x86emu: fix jump_near_IMM to handle DATA: flag correctly.
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=24348
    
    Before (data flag ignored -> broken):
    66                  DATA:
    e944f1              JMP       1ff6
    
    After (fixed):
    66                  DATA:
    e944f1ffff          JMP       00001ff8
    
    This subtle difference in the length of decoded instruction meant
    that the VBE call jumped to the routine setting AX=0x14F (VBE Failed)
    instead of the routine that set AX=0x4F (VBE success).
    
    The ability to run the same code in vm86 significantly aided the
    debugging of this issue. Those X.org developers who would like to drop
    vm86 better take special care towards _all_ vesa bugs, as those will
    expose further issues.
    
    Patch applies easily to even xserver 1.4.2.
    
    Signed-off-by: Luc Verhaegen <libv at skynet.be>
    Tested-by: Luc Verhaegen <libv at skynet.be>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit cc2c73ddcb4370a7c3ad439cda4da825156c26c9)

diff --git a/hw/xfree86/x86emu/ops.c b/hw/xfree86/x86emu/ops.c
index 21a0347..c6b2f0a 100644
--- a/hw/xfree86/x86emu/ops.c
+++ b/hw/xfree86/x86emu/ops.c
@@ -9691,15 +9691,23 @@ Handles opcode 0xe9
 ****************************************************************************/
 static void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1))
 {
-    int ip;
+    u32 ip;
 
     START_OF_INSTR();
     DECODE_PRINTF("JMP\t");
-    ip = (s16)fetch_word_imm();
-    ip += (s16)M.x86.R_IP;
-    DECODE_PRINTF2("%04x\n", (u16)ip);
-    TRACE_AND_STEP();
-    M.x86.R_IP = (u16)ip;
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+	ip = (u32)fetch_long_imm();
+	ip += (u32)M.x86.R_EIP;
+	DECODE_PRINTF2("%08x\n", (u32)ip);
+	TRACE_AND_STEP();
+	M.x86.R_EIP = (u32)ip;
+    } else {
+	ip = (s16)fetch_word_imm();
+	ip += (s16)M.x86.R_IP;
+	DECODE_PRINTF2("%04x\n", (u16)ip);
+	TRACE_AND_STEP();
+	M.x86.R_IP = (u16)ip;
+    }
     DECODE_CLEAR_SEGOVR();
     END_OF_INSTR();
 }
commit 06ca34fe012c0b6a55851770c47680abe548d229
Author: Samuel Thibault <samuel.thibault at ens-lyon.org>
Date:   Sun Oct 24 15:18:28 2010 +0200

    Do not trap access to timer and keyboard
    
    Disable timer/keyboard trapping on GNU/Hurd for now
    
    Trapping disabled for now, as some VBIOSes (mga-g450 notably) use these
    ports, and the int10 wrapper is not emulating them.
    
    It's effectively what happens in the Linux variant too, as iopl() is used there,
    making the ioperm() meaningless.
    
    Signed-off-by: Olaf Buddenhagen <antrik at users.sf.net>
    Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit a6c64d96456d794b2f3ce40915922a3fba636b95)

diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c
index 3d7af40..39f353b 100644
--- a/hw/xfree86/os-support/hurd/hurd_video.c
+++ b/hw/xfree86/os-support/hurd/hurd_video.c
@@ -124,8 +124,17 @@ xf86EnableIO()
 	FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno));
 	return FALSE;
     }
+#if 0
+    /*
+     * Trapping disabled for now, as some VBIOSes (mga-g450 notably) use these
+     * ports, and the int10 wrapper is not emulating them. (Note that it's
+     * effectively what happens in the Linux variant too, as iopl() is used
+     * there, making the ioperm() meaningless.)
+     *
+     * Reenable this when int10 gets fixed.  */
     ioperm(0x40,4,0); /* trap access to the timer chip */
     ioperm(0x60,4,0); /* trap access to the keyboard controller */
+#endif
     return TRUE;
 }
 	
diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index bdd2639..1c40a1b 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -529,6 +529,8 @@ xf86EnableIO(void)
 		return FALSE;
         }
 # if !defined(__alpha__)
+	/* XXX: this is actually not trapping anything because of iopl(3)
+	 * above */
 	ioperm(0x40,4,0); /* trap access to the timer chip */
 	ioperm(0x60,4,0); /* trap access to the keyboard controller */
 # endif
commit 32004e8d6e3fcbb98ccacd89662099d190c71f51
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date:   Mon Oct 25 17:13:57 2010 +0300

    DRI2: Avoid call to NULL pointer
    
    DDX driver may implement schedule swap without GetMSC. In that case we
    can't call GetMSC in DRI2SwapBuffers.
    
    Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
    Reviewed-by: Mario Kleiner <mario.kleiner at tuebingen.mpg.de>
    CC: Keith Packard <keithp at keithp.com>
    CC: Kristian Høgsberg <krh at bitplanet.net>
    Reviewed-by: Jesse Barnes <jbarnes at virtuousgeek.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 383dfe23f1641435c0713f8a56424814a156af8e)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 34f735f..e4693d9 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -828,11 +828,14 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
 	 * is moved to a crtc with a lower refresh rate, or a crtc that just
 	 * got enabled.
 	 */
-	if (!(*ds->GetMSC)(pDraw, &ust, &current_msc))
-	    pPriv->last_swap_target = 0;
+	if (ds->GetMSC) {
+	    if (!(*ds->GetMSC)(pDraw, &ust, &current_msc))
+		pPriv->last_swap_target = 0;
 
-	if (current_msc < pPriv->last_swap_target)
-	    pPriv->last_swap_target = current_msc;
+	    if (current_msc < pPriv->last_swap_target)
+		pPriv->last_swap_target = current_msc;
+
+	}
 
 	/*
 	 * Swap target for this swap is last swap target + swap interval since
commit 9770500983308c85b84279be3a5ff36e120e7caa
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Mon Oct 18 15:59:35 2010 -0400

    modes: improve aspect ratio match for classic drivers
    
    After we infer the aspect ratio for the screen, we pick the largest
    mode matching that aspect ratio from the best mode pool available.
    We then clamp virtual size to that mode, and run the resulting mode
    list through the driver's ValidMode hook.  In doing so we might filter
    away our initial guess.  If this happens we shrink the default mode
    to the next largest mode from _any_ mode pool.  This is usually wrong,
    and we should instead pick the next aspect-matched mode from the best
    available mode pool (as always, user then driver then default).
    
    Reviewed-by: Alex Deucher <alexdeucher at gmail.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit 7bb653bedceb6180a0361ead1c612839e776ce98)

diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index 7bdf79a..d03310e 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -1831,8 +1831,6 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
 	numModes++;
     }
 
-#undef _VIRTUALX
-
     /*
      * If we estimated the virtual size above, we may have filtered away all
      * the modes that maximally match that size; scan again to find out and
@@ -1847,13 +1845,69 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
 	    }
 	}
 	if (vx < virtX || vy < virtY) {
+	    const int types[] = {
+		M_T_BUILTIN | M_T_PREFERRED,
+		M_T_BUILTIN,
+		M_T_DRIVER | M_T_PREFERRED,
+		M_T_DRIVER,
+		0
+	    };
+	    const int ntypes = sizeof(types) / sizeof(int);
+	    int n;
+
+	    /* 
+	     * We did not find the estimated virtual size. So now we want to 
+	     * find the largest mode available, but we want to search in the
+	     * modes in the order of "types" listed above.
+	     */
+	    for (n = 0; n < ntypes; n++) {
+		int type = types[n];
+
+		vx = 0; vy = 0;
+		for (p = scrp->modes; p; p = p->next) {
+		    /* scan through the modes in the sort order above */
+		    if ((p->type & type) != type)
+			continue;
+		    if (p->HDisplay > vx && p->VDisplay > vy) {
+			vx = p->HDisplay;
+			vy = p->VDisplay;
+		    }
+		}
+		if (vx && vy)
+		    /* Found one */
+		    break;
+	    }
 	    xf86DrvMsg(scrp->scrnIndex, X_WARNING,
 		       "Shrinking virtual size estimate from %dx%d to %dx%d\n",
 		       virtX, virtY, vx, vy);
-	    virtX = vx;
+	    virtX = _VIRTUALX(vx);
 	    virtY = vy;
-	    linePitch = scanLineWidth(vx, vy, minPitch, apertureSize,
-				      BankFormat, pitchInc);
+	    for (p = scrp->modes; p; p = p->next) {
+		if (numModes > 0) {
+		    if (p->HDisplay > virtX)
+			p->status = MODE_VIRTUAL_X;
+		    if (p->VDisplay > virtY)
+			p->status = MODE_VIRTUAL_Y;
+		    if (p->status != MODE_OK) {
+			numModes--;
+			printModeRejectMessage(scrp->scrnIndex, p, p->status);
+		    }
+		}
+	    }
+	    if (linePitches != NULL) {
+		for (i = 0; linePitches[i] != 0; i++) {
+		    if ((linePitches[i] >= virtX) &&
+			(linePitches[i] ==
+			scanLineWidth(virtX, virtY, linePitches[i],
+				      apertureSize, BankFormat, pitchInc))) {
+			linePitch = linePitches[i];
+			break;
+		    }
+		}
+	    } else {
+		linePitch = scanLineWidth(virtX, virtY, minPitch,
+					  apertureSize, BankFormat, pitchInc);
+	    }
 	}
     }
 


More information about the xorg-commit mailing list