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

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Sun Nov 14 02:12:30 PST 2010


 Xi/extinit.c                   |    4 +--
 dix/events.c                   |   52 +----------------------------------------
 dix/getevents.c                |    2 -
 dix/main.c                     |    4 ---
 hw/xfree86/common/xf86Helper.c |    7 +++++
 hw/xfree86/ddc/ddc.c           |    4 ---
 hw/xfree86/modes/xf86Crtc.c    |    4 +--
 hw/xfree86/modes/xf86Cursors.c |    9 ++++---
 include/eventstr.h             |    2 -
 randr/rrtransform.c            |   28 +++++++++++-----------
 10 files changed, 36 insertions(+), 80 deletions(-)

New commits:
commit ac556019cfcaaf9b5367a56f6e52ee51a95f453c
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jun 9 17:10:57 2010 +1000

    Xi: move property reset from extension shutdown to init.
    
    If any part of the stack calls XIGetKnownProperty during device shutdown
    the property is re-initialized before the server generation resets, leaving
    the value invalid again.
    
    Move the reset to the extension init which happens before input devices are
    initialized before the first property is requested.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    (cherry picked from commit 5cd11d2356d153840f1b429bdb8284367f8dc468)

diff --git a/Xi/extinit.c b/Xi/extinit.c
index 37f9856..72df3c1 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -1122,8 +1122,6 @@ RestoreExtensionEvents(void)
 static void
 IResetProc(ExtensionEntry * unused)
 {
-    XIResetProperties();
-
     ReplySwapVector[IReqCode] = ReplyNotSwappd;
     EventSwapVector[DeviceValuator] = NotImplemented;
     EventSwapVector[DeviceKeyPress] = NotImplemented;
@@ -1304,6 +1302,8 @@ XInputExtensionInit(void)
 
 	inputInfo.all_devices = &xi_all_devices;
 	inputInfo.all_master_devices = &xi_all_master_devices;
+
+	XIResetProperties();
     } else {
 	FatalError("IExtensionInit: AddExtensions failed\n");
     }
commit 4f7b19a40dc5b1bf70199c13e73d1a0abaa8e2fb
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Oct 18 15:42:54 2010 -0400

    ddc: Don't probe for DDC/CI or EEPROM
    
    For whatever reason, some (broken) monitors will crash if you do this.
    We're not actually using this information for anything, so let's just
    not do it.
    
    Originally reported as http://bugzilla.redhat.com/620333
    
    Reviewed-by: Alex Deucher <alexdeucher at gmail.com>
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit d2064fbb687839c297a851a5d85f32dfbbe4a0d5)

diff --git a/hw/xfree86/ddc/ddc.c b/hw/xfree86/ddc/ddc.c
index 6fad9fb..df46689 100644
--- a/hw/xfree86/ddc/ddc.c
+++ b/hw/xfree86/ddc/ddc.c
@@ -311,10 +311,6 @@ DDC2Init(int scrnIndex, I2CBusPtr pBus)
     dev = DDC2MakeDevice(pBus, 0x00A0, "ddc2");
     if (xf86I2CProbeAddress(pBus, 0x0060))
 	DDC2MakeDevice(pBus, 0x0060, "E-EDID segment register");
-    if (xf86I2CProbeAddress(pBus, 0x0062))
-	DDC2MakeDevice(pBus, 0x0062, "EDID EEPROM interface");
-    if (xf86I2CProbeAddress(pBus, 0x006E))
-	DDC2MakeDevice(pBus, 0x006E, "DDC control interface");
 
     return dev;
 }
commit 87f84e8e665d2cc404c52c91f7f00f2a85bcb5ce
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Jun 12 08:19:16 2010 -0700

    Don't coredump on "X -showopts" (bug 25874)
    
    Don't try walking the xf86ConfigLayout.screens table if it's empty
    https://bugs.freedesktop.org/show_bug.cgi?id=25874
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit b8615d592700b7be319c04cc0563fdeb5a266534)

diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 1cc1526..512b39e 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1447,6 +1447,13 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
     if (xf86DoConfigure && xf86DoConfigurePass1) return 1;
 
     /*
+     * This can happen when running Xorg -showopts and a module like ati
+     * or vmware tries to load its submodules when xf86ConfigLayout is empty
+     */
+    if (!xf86ConfigLayout.screens)
+	return 0;
+
+    /*
      * This is a very important function that matches the device sections
      * as they show up in the config file with the drivers that the server
      * loads at run time.
commit 6c1da48ca5274f84246a6772f25a7b430b821103
Author: Ben Skeggs <bskeggs at redhat.com>
Date:   Mon Jun 7 10:21:18 2010 +1000

    randr: prevent an unnecessary screen resize with multiple displays
    
    crtc->{x,y} is always 0 when xf86DefaultScreenLimits() is called, so we
    calculate too small an area for the initial framebuffer and force a resize
    to happen.
    
    This commit fixes the code to use desired{X,Y} instead, which contains the
    initial output positions.
    
    Signed-off-by: Ben Skeggs <bskeggs at redhat.com>
    Reviewed-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit f7af00e9f0e0e1d854b0e882378c032518ab71ca)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index c7c0bad..a14c43a 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1043,8 +1043,8 @@ xf86DefaultScreenLimits (ScrnInfoPtr scrn, int *widthp, int *heightp,
 
 	if (crtc->enabled)
 	{
-	    crtc_width = crtc->x + xf86ModeWidth (&crtc->desiredMode, crtc->desiredRotation);
-	    crtc_height = crtc->y + xf86ModeHeight (&crtc->desiredMode, crtc->desiredRotation);
+	    crtc_width = crtc->desiredX + xf86ModeWidth (&crtc->desiredMode, crtc->desiredRotation);
+	    crtc_height = crtc->desiredY + xf86ModeHeight (&crtc->desiredMode, crtc->desiredRotation);
 	}
 	if (!canGrow) {
 	    for (o = 0; o < config->num_output; o++)
commit a1095c1372bcdb711eda458bf8bdfac9e8f4e39c
Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Jun 21 10:05:08 2010 +1000

    rotation: fix cursor and overlap of one pixel.
    
    Commit 77c7a64e8885696665556c9fbcb3cffb552e367a was introduced to fix
    a cursor off by one on Intel hw, however it also move the whole crtc
    into an off by one position and you could see gnom-eshell overlapping.
    
    This commit reverts that and instead fixes the cursor hotspot
    translation to work like pixman does. We add 0.5 to the cursor vector
    before translating, and floor the value afterwards.
    
    Thanks to Soeren (ssp) for pointing out where the real problem was
    after explaning how pixman translates points.
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 80d1a548d6ce73c2ff097536c1bc7044bf74965d)

diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index 4162999..36cf45c 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -327,10 +327,13 @@ xf86_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y)
 						  xf86CursorScreenKey);
 	struct pict_f_vector   v;
 
-	v.v[0] = x + ScreenPriv->HotX; v.v[1] = y + ScreenPriv->HotY; v.v[2] = 1;
+	v.v[0] = (x + ScreenPriv->HotX) + 0.5;
+	v.v[1] = (y + ScreenPriv->HotY) + 0.5;
+	v.v[2] = 1;
 	pixman_f_transform_point (&crtc->f_framebuffer_to_crtc, &v);
-	x = floor (v.v[0] + 0.5);
-	y = floor (v.v[1] + 0.5);
+	/* cursor will have 0.5 added to it already so floor is sufficent */
+	x = floor (v.v[0]);
+	y = floor (v.v[1]);
 	/*
 	 * Transform position of cursor upper left corner
 	 */
diff --git a/randr/rrtransform.c b/randr/rrtransform.c
index 06f6298..53de3b8 100644
--- a/randr/rrtransform.c
+++ b/randr/rrtransform.c
@@ -185,21 +185,21 @@ RRTransformCompute (int			    x,
 	    break;
 	case RR_Rotate_90:
 	    f_rot_cos = 0;	    f_rot_sin = 1;
-	    f_rot_dx  = height-1;   f_rot_dy  = 0;
+	    f_rot_dx  = height;	    f_rot_dy  = 0;
 	    rot_cos = F ( 0);	    rot_sin = F ( 1);
-	    rot_dx =  F (height-1); rot_dy  = F (0);
+	    rot_dx =  F ( height);  rot_dy  = F (0);
 	    break;
 	case RR_Rotate_180:
 	    f_rot_cos = -1;	    f_rot_sin = 0;
-	    f_rot_dx  = width - 1;  f_rot_dy  = height - 1;
+	    f_rot_dx  = width;	    f_rot_dy  = height;
 	    rot_cos = F (-1);	    rot_sin = F ( 0);
-	    rot_dx  = F (width-1);  rot_dy  = F ( height-1);
+	    rot_dx  = F (width);   rot_dy  = F ( height);
 	    break;
 	case RR_Rotate_270:
 	    f_rot_cos = 0;	    f_rot_sin = -1;
-	    f_rot_dx  = 0;	    f_rot_dy  = width-1;
+	    f_rot_dx  = 0;	    f_rot_dy  = width;
 	    rot_cos = F ( 0);	    rot_sin = F (-1);
-	    rot_dx  = F ( 0);	    rot_dy  = F ( width-1);
+	    rot_dx  = F ( 0);	    rot_dy  = F ( width);
 	    break;
 	}
 	
@@ -222,11 +222,11 @@ RRTransformCompute (int			    x,
 	    f_scale_x = -1;
 	    scale_x = F(-1);
 	    if (rotation & (RR_Rotate_0|RR_Rotate_180)) {
-		f_scale_dx = width-1;
-		scale_dx = F(width-1);
+		f_scale_dx = width;
+		scale_dx = F(width);
 	    } else {
-		f_scale_dx = height-1;
-		scale_dx = F(height-1);
+		f_scale_dx = height;
+		scale_dx = F(height);
 	    }
 	}
 	if (rotation & RR_Reflect_Y)
@@ -234,11 +234,11 @@ RRTransformCompute (int			    x,
 	    f_scale_y = -1;
 	    scale_y = F(-1);
 	    if (rotation & (RR_Rotate_0|RR_Rotate_180)) {
-		f_scale_dy = height-1;
-		scale_dy = F(height-1);
+		f_scale_dy = height;
+		scale_dy = F(height);
 	    } else {
-		f_scale_dy = width-1;
-		scale_dy = F(width-1);
+		f_scale_dy = width;
+		scale_dy = F(width);
 	    }
 	}
 	
commit ffbdba03198b9bf792cfcc1755f2e8b6c63b7f3a
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Jun 24 12:52:53 2010 +1000

    Revert "dix: use the event mask of the grab for TryClientEvents."
    
    Behaviour of earlier X servers was to deliver the ButtonPress event
    unconditionally, regardless of the actual event mask being set. This is
    documented in the protocol:
    "This request establishes a passive grab.  In the future, the pointer is
    actively grabbed as described in GrabPointer, the last-pointer-grab time is
    set to the time at which the button was pressed (as transmitted in the
    ButtonPress event), and the ButtonPress event is reported if all of the
    following conditions are true:
        <list of conditions, event mask is not one of them>"
    
    Thus, a GrabButton event will always deliver the button press event, a
    GrabKey always the key press event, etc. Same goes for XI and XI2.
    
    Reproducible with a simple client requesting a button grab in the form of:
        XGrabButton(dpy, AnyButton, AnyModifier, win, True, ButtonReleaseMask,
                    GrabModeAsync, GrabModeAsync, None, None);
    
    On servers before MPX/XI2, the client will receive a button press and
    release event. On current servers, the client receives only the release.
    Clients that expect the press event to be delivered unconditionally.
    
    XTS Xlib13 XGrabButton 5/39 now passes.
    
    This reverts commit 48585bd1e3e98db0f3df1ecc68022510216e00cc.
    Effectively reverts commit 1c612acca8568fcdf9761d23f112adaf4d496f1b as well,
    the code introduced with 1c612 is not needed anymore.
    
    Conflicts:
    
    	dix/events.c
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Acked-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 1884db430a5680e37e94726dff46686e2218d525)

diff --git a/dix/events.c b/dix/events.c
index 5de1505..80c29cc 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3450,7 +3450,6 @@ CheckPassiveGrabsOnWindow(
     {
 	DeviceIntPtr	gdev;
 	XkbSrvInfoPtr	xkbi = NULL;
-	Mask		mask = 0;
 
 	gdev= grab->modifierDevice;
         if (grab->grabtype == GRABTYPE_CORE)
@@ -3565,9 +3564,6 @@ CheckPassiveGrabsOnWindow(
                 }
                 xE = &core;
                 count = 1;
-                mask = grab->eventMask;
-                if (grab->ownerEvents)
-                    mask |= pWin->eventMask;
             } else if (match & XI2_MATCH)
             {
                 rc = EventToXI2((InternalEvent*)event, &xE);
@@ -3579,34 +3575,6 @@ CheckPassiveGrabsOnWindow(
                     continue;
                 }
                 count = 1;
-
-                /* FIXME: EventToXI2 returns NULL for enter events, so
-                 * dereferencing the event is bad. Internal event types are
-                 * aligned with core events, so the else clause is valid.
-                 * long-term we should use internal events for enter/focus
-                 * as well */
-                if (xE)
-                    mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
-                else if (event->type == XI_Enter || event->type == XI_FocusIn)
-                    mask = grab->xi2mask[device->id][event->type/8];
-
-                if (grab->ownerEvents && wOtherInputMasks(grab->window))
-                {
-                    InputClientsPtr icp =
-                        wOtherInputMasks(grab->window)->inputClients;
-
-                    while(icp)
-                    {
-                        if (rClient(icp) == rClient(grab))
-                        {
-                            int evtype = (xE) ? ((xGenericEvent*)xE)->evtype : event->type;
-                            mask |= icp->xi2mask[device->id][evtype/8];
-                            break;
-                        }
-
-                        icp = icp->next;
-                    }
-                }
             } else
             {
                 rc = EventToXI((InternalEvent*)event, &xE, &count);
@@ -3617,23 +3585,6 @@ CheckPassiveGrabsOnWindow(
                                 "(%d, %d).\n", device->name, event->type, rc);
                     continue;
                 }
-                mask = grab->eventMask;
-                if (grab->ownerEvents && wOtherInputMasks(grab->window))
-                {
-                    InputClientsPtr icp =
-                        wOtherInputMasks(grab->window)->inputClients;
-
-                    while(icp)
-                    {
-                        if (rClient(icp) == rClient(grab))
-                        {
-                            mask |= icp->mask[device->id];
-                            break;
-                        }
-
-                        icp = icp->next;
-                    }
-                }
             }
 
 	    (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
@@ -3642,7 +3593,8 @@ CheckPassiveGrabsOnWindow(
             {
                 FixUpEventFromWindow(device, xE, grab->window, None, TRUE);
 
-                TryClientEvents(rClient(grab), device, xE, count, mask,
+                TryClientEvents(rClient(grab), device, xE, count,
+                                       GetEventFilter(device, xE),
                                        GetEventFilter(device, xE), grab);
             }
 
commit 9ae9cbae5f9f67c71219d2b434506f8778994669
Author: Joe Shaw <joeshaw at litl.com>
Date:   Thu Oct 14 15:09:20 2010 -0400

    fix a sign problem with valuator data.
    
    Without this patch, any negative valuator value is wrong when returned
    from XQueryDeviceState().  This is a regression from at least xserver
    1.4.
    
    Valuator data is set in dix/getevents.c:set_valuators() by copying
    signed int values into an unsigned int field
    DeviceEvent.valuators.data.
    
    That data is converted into a double with an implicit cast by
    assignment to axisVal[i] in Xi/exevents.c:UpdateDeviceState().
    
    That double is converted back to a signed int in
    queryst.c:ProcXQueryDeviceState().  If the original value in
    set_valuators() is negative, the double value will be > 2^31 and the
    conversion back to a signed int is undefined.  (Although I
    consistently see the value -2^31.)
    
    Fix this by changing the definition of DeviceEvent.valuators.data from
    uint32_t to int32_t.
    
    Signed-off-by: Joe Shaw <joeshaw at litl.com>
    Reviewed-by: Chase Douglas <chase.douglas at canonical.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit e354ccac36a8ee3a23bdc845833c16a5646cc200)

diff --git a/dix/getevents.c b/dix/getevents.c
index 197deb4..dd7e786 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -177,7 +177,7 @@ set_valuators(DeviceIntPtr dev, DeviceEvent* event, int first_valuator,
     }
 
     memcpy(&event->valuators.data[first_valuator],
-           valuators, num_valuators * sizeof(uint32_t));
+           valuators, num_valuators * sizeof(int32_t));
 
 }
 
diff --git a/include/eventstr.h b/include/eventstr.h
index 433227e..377cceb 100644
--- a/include/eventstr.h
+++ b/include/eventstr.h
@@ -99,7 +99,7 @@ struct _DeviceEvent
     struct {
         uint8_t  mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */
         uint8_t  mode[(MAX_VALUATORS + 7)/8]; /**< Valuator mode (Abs or Rel)*/
-        uint32_t data[MAX_VALUATORS];         /**< Valuator data */
+        int32_t  data[MAX_VALUATORS];         /**< Valuator data */
         int32_t  data_frac[MAX_VALUATORS];    /**< Fractional part for data */
     } valuators;
     struct {
commit db4b69c77f31cffd66c57e51f5bed3238f692a0f
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Feb 15 16:54:35 2010 -0500

    dix: Default DPMS timeout values to match screensaver values
    
    These have the same default, but if you specify something different with
    -s on the command line, only the screensaver time is changed.  As DPMS
    is usually what's desired, change it to match.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 2a763c9023b8bc978b32eaa56d2c625b6f2badee)

diff --git a/dix/main.c b/dix/main.c
index f023536..b500ad7 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -161,9 +161,7 @@ int main(int argc, char *argv[], char *envp[])
 	ScreenSaverBlanking = defaultScreenSaverBlanking;
 	ScreenSaverAllowExposures = defaultScreenSaverAllowExposures;
 #ifdef DPMSExtension
-	DPMSStandbyTime = DEFAULT_SCREEN_SAVER_TIME;
-	DPMSSuspendTime = DEFAULT_SCREEN_SAVER_TIME;
-	DPMSOffTime = DEFAULT_SCREEN_SAVER_TIME;
+	DPMSStandbyTime = DPMSSuspendTime = DPMSOffTime = ScreenSaverTime;
 	DPMSEnabled = TRUE;
 	DPMSPowerLevel = 0;
 #endif


More information about the xorg-commit mailing list