xserver: Branch 'server-1.8-branch' - 7 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Tue Jan 11 11:16:24 PST 2011


 Xext/sync.c                      |    5 +-
 exa/exa_accel.c                  |    2 
 exa/exa_unaccel.c                |    2 
 hw/xfree86/modes/xf86EdidModes.c |    5 ++
 hw/xfree86/modes/xf86Modes.c     |   33 +++++++++++----
 hw/xfree86/x86emu/ops.c          |   83 +++++++++++++++++++++++++++------------
 include/protocol-versions.h      |    4 +
 randr/rrscreen.c                 |   12 +++++
 8 files changed, 112 insertions(+), 34 deletions(-)

New commits:
commit 39ee5010504ab60737677ae3ec32a927e6d0df5e
Author: Ville Syrjälä <ville.syrjala at nokia.com>
Date:   Thu Dec 16 18:22:13 2010 +0200

    xfree86/modes: Take rotation into account when checking mode size
    
    Assume that a mode can be used in either landscape or portrait
    orientation. I suppose the correct thing to do would be to
    collect all the supported rotations from the CRTCs that can be used
    with a specific output, but that information doesn't seem to be
    readily available when these checks are done. So just assume that
    either orientation is fine.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit 2e781457d43ec4bf0d633257ac6852cde3b00541)
    (cherry picked from commit aec278eb65fe1ca98ab551a8c3873a7195bad540)

diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c
index 75aedaa..0fb29bf 100644
--- a/hw/xfree86/modes/xf86Modes.c
+++ b/hw/xfree86/modes/xf86Modes.c
@@ -364,15 +364,32 @@ xf86ValidateModesSize(ScrnInfoPtr pScrn, DisplayModePtr modeList,
 {
     DisplayModePtr mode;
 
-    for (mode = modeList; mode != NULL; mode = mode->next) {
-	if (maxPitch > 0 && mode->HDisplay > maxPitch)
-	    mode->status = MODE_BAD_WIDTH;
-
-	if (maxX > 0 && mode->HDisplay > maxX)
-	    mode->status = MODE_VIRTUAL_X;
+    if (maxPitch <= 0)
+	    maxPitch = MAXINT;
+    if (maxX <= 0)
+	    maxX = MAXINT;
+    if (maxY <= 0)
+	    maxY = MAXINT;
 
-	if (maxY > 0 && mode->VDisplay > maxY)
-	    mode->status = MODE_VIRTUAL_Y;
+    for (mode = modeList; mode != NULL; mode = mode->next) {
+	if ((xf86ModeWidth(mode, RR_Rotate_0) > maxPitch ||
+	     xf86ModeWidth(mode, RR_Rotate_0) > maxX ||
+	     xf86ModeHeight(mode, RR_Rotate_0) > maxY) &&
+	    (xf86ModeWidth(mode, RR_Rotate_90) > maxPitch ||
+	     xf86ModeWidth(mode, RR_Rotate_90) > maxX ||
+	     xf86ModeHeight(mode, RR_Rotate_90) > maxY)) {
+	    if (xf86ModeWidth(mode, RR_Rotate_0) > maxPitch ||
+		xf86ModeWidth(mode, RR_Rotate_90) > maxPitch)
+		mode->status = MODE_BAD_WIDTH;
+
+	    if (xf86ModeWidth(mode, RR_Rotate_0) > maxX ||
+		xf86ModeWidth(mode, RR_Rotate_90) > maxX)
+		mode->status = MODE_VIRTUAL_X;
+
+	    if (xf86ModeHeight(mode, RR_Rotate_0) > maxY ||
+		xf86ModeHeight(mode, RR_Rotate_90) > maxY)
+		mode->status = MODE_VIRTUAL_Y;
+	}
 
 	if (mode->next == modeList)
 	    break;
commit 588d3f259a7243c44fe89d31e41605a2b5acbf41
Author: Tiago Vignatti <tiago.vignatti at nokia.com>
Date:   Fri Dec 17 16:09:35 2010 +0200

    randr: check for virtual size limits before set crtc
    
    Return a error if the screen is configured to an invalid size.
    
    Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit d1107918d4626268803b54033a07405122278e7f)

diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index 630ff57..0fee1f5 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -921,6 +921,18 @@ ProcRRSetScreenConfig (ClientPtr client)
 	width = mode->mode.height;
 	height = mode->mode.width;
     }
+
+    if (width < pScrPriv->minWidth || pScrPriv->maxWidth < width) {
+	client->errorValue = width;
+	free(pData);
+	return BadValue;
+    }
+    if (height < pScrPriv->minHeight || pScrPriv->maxHeight < height) {
+	client->errorValue = height;
+	free(pData);
+	return BadValue;
+    }
+
     if (width != pScreen->width || height != pScreen->height)
     {
 	int	c;
commit 205efedddc3e966633d63d2d7907148a34bc67f6
Author: Michel Dänzer <daenzer at vmware.com>
Date:   Wed Dec 22 11:45:36 2010 +0100

    EXA: Fix crash with fill using 1x1 tile of depth < 8 (bug #24703).
    
    Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24703 .
    
    Signed-off-by: Michel Dänzer <daenzer at vmware.com>
    Reviewed-by: Dave Airlie <airlied at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit e06fa804009798ea95efa8babaabb0228dfdfe65)

diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 57029fd..3b71ad4 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1057,6 +1057,8 @@ exaFillRegionSolid (DrawablePtr	pDrawable, RegionPtr pRegion, Pixel pixel,
 		*(CARD16*)pExaPixmap->sys_ptr = pixel;
 		break;
 	    case 8:
+	    case 4:
+	    case 1:
 		*(CARD8*)pExaPixmap->sys_ptr = pixel;
 	    }
 
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index 8d70098..1f91f19 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -736,6 +736,8 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap)
 	    return pixel;
 	}
     case 8:
+    case 4:
+    case 1:
 	{
 	    CARD8 pixel;
 
commit 2fe16061231dc995731b5f3c1cc69dc5d53b1145
Author: Jörn Horstmann <launchpad at planetxml.de>
Date:   Mon Dec 6 11:24:02 2010 +1100

    Add EDID quirk for HP Compaq nc8430.
    
    Like some other LPL panels, this one reports the vertical size in cm rather
    than mm.
    Patch taken from Launchpad bug #380009 <https://launchpad.net/bugs/380009>
    
    X.Org Bug 28414 <https://bugs.freedesktop.org/show_bug.cgi?id=28414>
    
    Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 4b88c7be8de4149fe3d166bf115775f9e81a1373)

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index ec65408..584fdd2 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -145,6 +145,11 @@ static Bool quirk_detailed_v_in_cm (int scrnIndex, xf86MonPtr DDC)
 	DDC->vendor.prod_id == 0x2a00)
 	return TRUE;
 
+    /* Bug #28414: HP Compaq NC8430 LP154W01-TLA8 */
+    if (memcmp (DDC->vendor.name, "LPL", 4) == 0 &&
+	DDC->vendor.prod_id == 5750)
+	return TRUE;
+
     /* Bug #21750: Samsung Syncmaster 2333HD */
     if (memcmp (DDC->vendor.name, "SAM", 4) == 0 &&
 	DDC->vendor.prod_id == 1157)
commit eadd8b54934fdf3f7dbeb521885e1bdec2e720c6
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Dec 10 14:24:02 2010 -0500

    x86emu: Fix more mis-decoding of the data prefix
    
    cc2c73ddcb4370a7c3ad439cda4da825156c26c9's three-cent titanium tax
    doesn't go too far enough.  Fix the rest of the call and jmp
    instructions to handle the data prefix correctly.
    
    Reference: Intel 64 and IA-32 Architectures Software Developer's Manual
    Volume 2A: Instruction Set Reference, A-M
    
    http://www.intel.com/Assets/PDF/manual/253666.pdf
    
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit bb18f277156c08be028a6e12d8987fb1593e9168)

diff --git a/hw/xfree86/x86emu/ops.c b/hw/xfree86/x86emu/ops.c
index c6b2f0a..5d3cac1 100644
--- a/hw/xfree86/x86emu/ops.c
+++ b/hw/xfree86/x86emu/ops.c
@@ -7065,15 +7065,20 @@ Handles opcode 0x9a
 ****************************************************************************/
 static void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1))
 {
-    u16 farseg, faroff;
+    u32 farseg, faroff;
 
     START_OF_INSTR();
-	DECODE_PRINTF("CALL\t");
+    DECODE_PRINTF("CALL\t");
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+	faroff = fetch_long_imm();
+	farseg = fetch_word_imm();
+    } else {
 	faroff = fetch_word_imm();
 	farseg = fetch_word_imm();
-	DECODE_PRINTF2("%04x:", farseg);
-	DECODE_PRINTF2("%04x\n", faroff);
-	CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR ");
+    }
+    DECODE_PRINTF2("%04x:", farseg);
+    DECODE_PRINTF2("%04x\n", faroff);
+    CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR ");
 
     /* XXX
      * 
@@ -7084,8 +7089,12 @@ static void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1))
     TRACE_AND_STEP();
     push_word(M.x86.R_CS);
     M.x86.R_CS = farseg;
-    push_word(M.x86.R_IP);
-    M.x86.R_IP = faroff;
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+	push_long(M.x86.R_EIP);
+    } else {
+	push_word(M.x86.R_IP);
+    }
+    M.x86.R_EIP = faroff & 0xffff;
     DECODE_CLEAR_SEGOVR();
     END_OF_INSTR();
 }
@@ -9670,17 +9679,30 @@ Handles opcode 0xe8
 ****************************************************************************/
 static void x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1))
 {
-    s16 ip;
+    s16 ip16;
+    s32 ip32;
 
     START_OF_INSTR();
-	DECODE_PRINTF("CALL\t");
-	ip = (s16) fetch_word_imm();
-	ip += (s16) M.x86.R_IP;    /* CHECK SIGN */
-	DECODE_PRINTF2("%04x\n", (u16)ip);
-	CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip, "");
+    DECODE_PRINTF("CALL\t");
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+	ip32 = (s32) fetch_long_imm();
+	ip32 += (s16) M.x86.R_IP;    /* CHECK SIGN */
+	DECODE_PRINTF2("%04x\n", (u16)ip32);
+	CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip32, "");
+    } else {
+	ip16 = (s16) fetch_word_imm();
+	ip16 += (s16) M.x86.R_IP;    /* CHECK SIGN */
+	DECODE_PRINTF2("%04x\n", (u16)ip16);
+	CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip16, "");
+    }
     TRACE_AND_STEP();
-    push_word(M.x86.R_IP);
-    M.x86.R_IP = ip;
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+	push_long(M.x86.R_EIP);
+	M.x86.R_EIP = ip32 & 0xffff;
+    } else {
+	push_word(M.x86.R_IP);
+	M.x86.R_EIP = ip16;
+    }
     DECODE_CLEAR_SEGOVR();
     END_OF_INSTR();
 }
@@ -9718,16 +9740,21 @@ Handles opcode 0xea
 ****************************************************************************/
 static void x86emuOp_jump_far_IMM(u8 X86EMU_UNUSED(op1))
 {
-    u16 cs, ip;
+    u16 cs;
+    u32 ip;
 
     START_OF_INSTR();
     DECODE_PRINTF("JMP\tFAR ");
-    ip = fetch_word_imm();
+    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+	ip = fetch_long_imm();
+    } else {
+	ip = fetch_word_imm();
+    }
     cs = fetch_word_imm();
     DECODE_PRINTF2("%04x:", cs);
     DECODE_PRINTF2("%04x\n", ip);
     TRACE_AND_STEP();
-    M.x86.R_IP = ip;
+    M.x86.R_EIP = ip & 0xffff;
     M.x86.R_CS = cs;
     DECODE_CLEAR_SEGOVR();
     END_OF_INSTR();
commit a9ddd6b4aad8cb12c1172f71da8e56b3d9098cdb
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 20045592cd5c9bf10659d6eeffefd48b8fe0885b
Author: James Jones <jajones at nvidia.com>
Date:   Mon Dec 6 13:36:14 2010 -0800

    Add and use SERVER_SYNC_*_VERSION
    
    Most extensions have a version defined
    in the protocol headers, and also in the
    server's protocol-versions.h.  The latter
    defines which version the server advertises
    support for.  Sync wasn't included in
    protocol-versions.h, and was advertising
    support for whatever was in the protocol
    headers the server was built against.
    
    Signed-off-by: James Jones <jajones at nvidia.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 27593eea7efcbed8de0c6e8233cbd1a1b8a50459)

diff --git a/Xext/sync.c b/Xext/sync.c
index 2015fc1..4e73b80 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -67,6 +67,7 @@ PERFORMANCE OF THIS SOFTWARE.
 #include "opaque.h"
 #include <X11/extensions/syncproto.h>
 #include "syncsrv.h"
+#include "protocol-versions.h"
 
 #include <stdio.h>
 #if !defined(WIN32)
@@ -1137,8 +1138,8 @@ ProcSyncInitialize(ClientPtr client)
     memset(&rep, 0, sizeof(xSyncInitializeReply));
     rep.type = X_Reply;
     rep.sequenceNumber = client->sequence;
-    rep.majorVersion = SYNC_MAJOR_VERSION;
-    rep.minorVersion = SYNC_MINOR_VERSION;
+    rep.majorVersion = SERVER_SYNC_MAJOR_VERSION;
+    rep.minorVersion = SERVER_SYNC_MINOR_VERSION;
     rep.length = 0;
 
     if (client->swapped)
diff --git a/include/protocol-versions.h b/include/protocol-versions.h
index 97ef5da..9107915 100644
--- a/include/protocol-versions.h
+++ b/include/protocol-versions.h
@@ -95,6 +95,10 @@
 #define SERVER_SHM_MAJOR_VERSION		1
 #define SERVER_SHM_MINOR_VERSION		1
 
+/* Sync */
+#define SERVER_SYNC_MAJOR_VERSION		3
+#define SERVER_SYNC_MINOR_VERSION		0
+
 /* Windows WM */
 #define SERVER_WINDOWSWM_MAJOR_VERSION		1
 #define SERVER_WINDOWSWM_MINOR_VERSION		0


More information about the xorg-commit mailing list