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

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Fri Jan 7 06:26:30 PST 2011


 hw/xfree86/dri2/dri2.c           |   11 ++++++
 hw/xfree86/modes/xf86EdidModes.c |    2 -
 hw/xfree86/modes/xf86Modes.c     |   33 +++++++++++++++-----
 hw/xfree86/x86emu/ops.c          |   63 +++++++++++++++++++++++++++------------
 os/access.c                      |    4 +-
 os/utils.c                       |   16 +++++++++
 randr/rrscreen.c                 |   12 +++++++
 render/animcur.c                 |    8 +++-
 8 files changed, 118 insertions(+), 31 deletions(-)

New commits:
commit 3d12e6d25a79c1d78964df723731d2510bb932f8
Author: Zhao Yakui <yakui.zhao at intel.com>
Date:   Tue Jan 4 14:08:16 2011 -0500

    edid: Fix incorrect timings for VIC61
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Anssi Hannula <anssi.hannula at iki.fi>
    Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
    (cherry picked from commit 86ca434a1ab766c1519ee7146b48dbfead843524)

diff --git a/hw/xfree86/modes/xf86EdidModes.c b/hw/xfree86/modes/xf86EdidModes.c
index c25b707..d1d2e51 100644
--- a/hw/xfree86/modes/xf86EdidModes.c
+++ b/hw/xfree86/modes/xf86EdidModes.c
@@ -961,7 +961,7 @@ static const DisplayModeRec CEAVideoModes[CEA_VIDEO_MODES_NUM] = {
     { MODEPREFIX,   108000, 1440, 1478, 1602, 1716, 0,  480,  488,  494,  525, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX },/* VIC 58:1440x480i at 240 */
     { MODEPREFIX,   108000, 1440, 1478, 1602, 1716, 0,  480,  488,  494,  525, 0, V_NHSYNC | V_NVSYNC | V_INTERLACE, MODESUFFIX },/* VIC 59:1440x480i at 240 */
     { MODEPREFIX,    59400, 1280, 3040, 3080, 3300, 0,  720,  725,  730,  750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* VIC 60: 1280x720 at 24Hz */
-    { MODEPREFIX,    74250, 3700, 3740, 1430, 3960, 0,  720,  725,  730,  750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* VIC 61: 1280x720 at 25Hz */
+    { MODEPREFIX,    74250, 1280, 3700, 3740, 3960, 0,  720,  725,  730,  750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* VIC 61: 1280x720 at 25Hz */
     { MODEPREFIX,    74250, 1280, 3040, 3080, 3300, 0,  720,  725,  730,  750, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* VIC 62: 1280x720 at 30Hz */
     { MODEPREFIX,   297000, 1920, 2008, 2052, 2200, 0, 1080, 1084, 1089, 1125, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* VIC 63: 1920x1080 at 120Hz */
     { MODEPREFIX,   297000, 1920, 2448, 2492, 2640, 0, 1080, 1084, 1094, 1125, 0, V_PHSYNC | V_PVSYNC, MODESUFFIX }, /* VIC 64:1920x1080 at 100Hz */
commit 9213c2525a2be6f8bf1412f1c6001a7bc6ce4538
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 dc24f90ddc9c116a31347ba961f19feaf63fa843
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date:   Thu Dec 30 19:19:42 2010 +0200

    os: Fix a memory leak
    
    Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    (cherry picked from commit 617b7d22115ccaaaa7ec69c99885054d33a3bc37)

diff --git a/os/access.c b/os/access.c
index 0279259..eb91ea3 100644
--- a/os/access.c
+++ b/os/access.c
@@ -1145,8 +1145,10 @@ Bool LocalClient(ClientPtr client)
 	}
 	for (host = selfhosts; host; host = host->next)
 	{
-	    if (addrEqual (family, addr, alen, host))
+	    if (addrEqual (family, addr, alen, host)) {
+		free(from);
 		return TRUE;
+	    }
 	}
 	free(from);
     }
commit a87a5b7e83349d3871fcde71fec08f85fa16dc0b
Author: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
Date:   Thu Dec 30 19:19:32 2010 +0200

    render: Don't filter 0 return from GetTimeInMillis
    
    In animate cursor block handler code assumes GetTimeInMillis returns
    always nonzero value. This isn't true when time wraps around.
    
    To prevent any problems in case GetTimeInMillis would return zero use
    activeDevice variable to track if we have received time.
    
    Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    (cherry picked from commit aa8cea953dc66bcf4cb4d08f2681f9e6cb1bc8c5)

diff --git a/render/animcur.c b/render/animcur.c
index 2160f50..1a8ca43 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -150,6 +150,7 @@ AnimCurScreenBlockHandler (int screenNum,
     ScreenPtr		pScreen = screenInfo.screens[screenNum];
     AnimCurScreenPtr    as = GetAnimCurScreen(pScreen);
     DeviceIntPtr        dev;
+    Bool                activeDevice = FALSE;
     CARD32              now = 0, 
                         soonest = ~0; /* earliest time to wakeup again */
 
@@ -157,7 +158,10 @@ AnimCurScreenBlockHandler (int screenNum,
     {
 	if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen)
 	{
-	    if (!now) now = GetTimeInMillis (); 
+	    if (!activeDevice) {
+                now = GetTimeInMillis ();
+                activeDevice = TRUE;
+            }
 
 	    if ((INT32) (now - dev->spriteInfo->anim.time) >= 0)
 	    {
@@ -187,7 +191,7 @@ AnimCurScreenBlockHandler (int screenNum,
 	}
     }
 
-    if (now)
+    if (activeDevice)
         AdjustWaitForDelay (pTimeout, soonest - now);
 
     Unwrap (as, pScreen, BlockHandler);
commit aec278eb65fe1ca98ab551a8c3873a7195bad540
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)

diff --git a/hw/xfree86/modes/xf86Modes.c b/hw/xfree86/modes/xf86Modes.c
index 05f4319..ef89050 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 005b465048178d2ab0abecf26ccf6c79c6d5e2cc
Author: Ville Syrjälä <ville.syrjala at nokia.com>
Date:   Fri Dec 3 17:42:16 2010 +0200

    dri2: Don't page flip when the window size doesn't match the pixmap size
    
    If the drawable size doesn't match the pixmap size page flipping should
    not be allowed.
    
    If the window is larger than the pixmap, page flipping might need to
    reposition the CRTC somewhere in the middle of the pixmap. I didn't
    spot any code that would handle that at least in the intel driver.
    
    Also the root pixmap could then move to some negative screen
    coordinates. Not sure if all bits of code could handle that. Perhaps
    when composite is enabled screen_x/y would make it work, but without
    composite there's no way that it would work AFAICS.
    
    Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
    Reviewed-by: Alex Deucher <alexdeucher at gmail.com>
    (cherry picked from commit 0ce25fd7904c792924c3e0ee6fc21a5f1bec1a68)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index e4693d9..39996f9 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -640,6 +640,17 @@ DRI2CanFlip(DrawablePtr pDraw)
     if (!RegionEqual(&pWin->clipList, &pRoot->winSize))
 	return FALSE;
 
+    /* Does the window match the pixmap exactly? */
+    if (pDraw->x != 0 ||
+	pDraw->y != 0 ||
+#ifdef COMPOSITE
+	pDraw->x != pWinPixmap->screen_x ||
+	pDraw->y != pWinPixmap->screen_y ||
+#endif
+	pDraw->width != pWinPixmap->drawable.width ||
+	pDraw->height != pWinPixmap->drawable.height)
+	return FALSE;
+
     return TRUE;
 }
 
commit 651a96982fb2079367d189f4882749e30200003d
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Fri Aug 27 20:36:37 2010 +1000

    GetTimeInMillis: Use CLOCK_MONOTONIC_COARSE where available
    
    On some systems, using CLOCK_MONOTONIC forces a readback of HPET or some
    similarly expensive timer.  CLOCK_MONOTONIC_COARSE can alleviate this,
    at the cost of negligibly-reduced resolution, so prefer that where we
    can.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    (cherry picked from commit 44adb31bfece29260a9bbd9075c9212ebf00d24d)

diff --git a/os/utils.c b/os/utils.c
index 51455cc..4871326 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -427,7 +427,21 @@ GetTimeInMillis(void)
 
 #ifdef MONOTONIC_CLOCK
     struct timespec tp;
-    if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
+    static clockid_t clockid;
+    if (!clockid) {
+#ifdef CLOCK_MONOTONIC_COARSE
+        if (clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 &&
+            (tp.tv_nsec / 1000) <= 1000 &&
+            clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0)
+            clockid = CLOCK_MONOTONIC_COARSE;
+        else
+#endif
+        if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
+            clockid = CLOCK_MONOTONIC;
+        else
+            clockid = ~0L;
+    }
+    if (clockid != ~0L && clock_gettime(clockid, &tp) == 0)
         return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L);
 #endif
 
commit 08db658a19bb532808dba8744f8b64042d773ca0
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 f58e657..1bc1a9e 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -915,6 +915,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;


More information about the xorg-commit mailing list