[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'ubuntu+1'



 COPYING                                                                   |    1 
 ChangeLog                                                                 | 2474 +++++++++-
 Xext/panoramiX.c                                                          |   14 
 Xext/saver.c                                                              |    8 
 Xext/sync.c                                                               |   13 
 Xext/xvdisp.c                                                             |    8 
 Xext/xvmain.c                                                             |    4 
 Xi/chgdctl.c                                                              |    6 
 Xi/devbell.c                                                              |    3 
 Xi/exevents.c                                                             |  224 
 Xi/extinit.c                                                              |   38 
 Xi/setdval.c                                                              |    3 
 Xi/setmode.c                                                              |    4 
 Xi/ungrdevb.c                                                             |    2 
 Xi/ungrdevk.c                                                             |    2 
 Xi/xibarriers.c                                                           |   12 
 Xi/xibarriers.h                                                           |    4 
 Xi/xigrabdev.c                                                            |   15 
 Xi/xipassivegrab.c                                                        |    2 
 composite/compext.c                                                       |    7 
 config/10-quirks.conf                                                     |   54 
 config/Makefile.am                                                        |    4 
 configure.ac                                                              |   23 
 debian/changelog                                                          |   15 
 debian/patches/228_autobind_gpu.patch                                     |   26 
 debian/patches/autoconfig-fixup-tell-changed-so-randr-clients-can-t.patch |  192 
 debian/patches/dix-allow-pixmap-dirty-helper-to-be-used-for-non-sha.patch |   40 
 debian/patches/dix-fixup-build-failure.patch                              |   12 
 debian/patches/os-use-libunwind-to-generate-backtraces.patch              |  206 
 debian/patches/series                                                     |   20 
 debian/patches/xf86-add--gpu-switch.patch                                 |  238 
 debian/patches/xf86-detach-scanout.patch                                  |   16 
 debian/patches/xf86-dont-enable-gpuscreens.patch                          |   64 
 debian/patches/xf86-fixup-unbind.patch                                    |   30 
 debian/patches/xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch |   65 
 debian/patches/xf86setdesired-hybrid.patch                                |   44 
 debian/patches/xserver-call-CSR-for-gpus.patch                            |   46 
 dix/cursor.c                                                              |   29 
 dix/devices.c                                                             |   59 
 dix/dispatch.c                                                            |    4 
 dix/dixutils.c                                                            |    8 
 dix/eventconvert.c                                                        |   23 
 dix/events.c                                                              |  103 
 dix/getevents.c                                                           |   61 
 dix/grabs.c                                                               |   21 
 dix/main.c                                                                |    9 
 dix/pixmap.c                                                              |    2 
 dix/registry.c                                                            |   25 
 dix/touch.c                                                               |  118 
 dix/window.c                                                              |   19 
 fb/fbpict.c                                                               |    8 
 fb/fbpixmap.c                                                             |    1 
 fb/wfbrename.h                                                            |    1 
 glx/extension_string.c                                                    |    2 
 glx/extension_string.h                                                    |    5 
 glx/glxcmds.c                                                             |   26 
 glx/glxdri.c                                                              |   12 
 glx/glxdri2.c                                                             |   15 
 glx/glxdricommon.c                                                        |    4 
 glx/glxscreens.h                                                          |    3 
 hw/dmx/config/dmxcompat.c                                                 |    4 
 hw/kdrive/ephyr/ephyr.c                                                   |    7 
 hw/kdrive/ephyr/ephyrinit.c                                               |    6 
 hw/kdrive/ephyr/ephyrvideo.c                                              |   24 
 hw/kdrive/ephyr/hostx.c                                                   |   43 
 hw/kdrive/ephyr/hostx.h                                                   |    3 
 hw/kdrive/ephyr/man/Xephyr.man                                            |    6 
 hw/kdrive/fbdev/fbdev.c                                                   |  167 
 hw/kdrive/fbdev/fbdev.h                                                   |    2 
 hw/kdrive/linux/mouse.c                                                   |    6 
 hw/kdrive/src/kdrive.c                                                    |    3 
 hw/kdrive/src/kinput.c                                                    |    8 
 hw/kdrive/src/kxv.c                                                       |    2 
 hw/xfree86/common/xf86.h                                                  |   26 
 hw/xfree86/common/xf86Config.c                                            |    1 
 hw/xfree86/common/xf86Events.c                                            |   18 
 hw/xfree86/common/xf86Init.c                                              |    2 
 hw/xfree86/common/xf86Mode.c                                              |   17 
 hw/xfree86/common/xf86Option.c                                            |    2 
 hw/xfree86/common/xf86Xinput.c                                            |    2 
 hw/xfree86/common/xf86fbman.c                                             |   12 
 hw/xfree86/common/xf86platformBus.c                                       |   30 
 hw/xfree86/common/xf86platformBus.h                                       |    4 
 hw/xfree86/common/xf86sbusBus.c                                           |    6 
 hw/xfree86/common/xf86xvmc.c                                              |    4 
 hw/xfree86/ddc/ddc.c                                                      |    7 
 hw/xfree86/ddc/xf86DDC.h                                                  |    2 
 hw/xfree86/dri2/dri2.c                                                    |   19 
 hw/xfree86/fbdevhw/Makefile.am                                            |    2 
 hw/xfree86/fbdevhw/fbdevhw.c                                              |    1 
 hw/xfree86/man/xorg.conf.man                                              |   11 
 hw/xfree86/modes/Makefile.am                                              |    4 
 hw/xfree86/modes/xf86Crtc.c                                               |  128 
 hw/xfree86/modes/xf86Crtc.h                                               |    3 
 hw/xfree86/modes/xf86Cursors.c                                            |    4 
 hw/xfree86/modes/xf86DisplayIDModes.c                                     |    1 
 hw/xfree86/modes/xf86Modes.h                                              |    6 
 hw/xfree86/modes/xf86RandR12.c                                            |    3 
 hw/xfree86/modes/xf86RandR12.h                                            |    3 
 hw/xfree86/modes/xf86Rename.h                                             |   94 
 hw/xfree86/os-support/bus/Sbus.c                                          |    8 
 hw/xfree86/os-support/linux/lnx_platform.c                                |   62 
 hw/xfree86/os-support/solaris/sun_init.c                                  |    2 
 hw/xfree86/os-support/xf86_OSproc.h                                       |    3 
 hw/xfree86/ramdac/xf86Cursor.c                                            |   29 
 hw/xfree86/utils/cvt/Makefile.am                                          |    1 
 hw/xfree86/utils/cvt/cvt.c                                                |    1 
 hw/xfree86/vbe/Makefile.am                                                |    1 
 hw/xfree86/vbe/vbe.c                                                      |    1 
 hw/xquartz/GL/visualConfigs.c                                             |    3 
 hw/xwin/Makefile.am                                                       |    2 
 hw/xwin/XWin.exe.manifest                                                 |    2 
 hw/xwin/glx/indirect.c                                                    |    2 
 hw/xwin/winclipboardthread.c                                              |    5 
 hw/xwin/windialogs.c                                                      |   74 
 hw/xwin/winkeybd.c                                                        |    2 
 hw/xwin/winmultiwindowclass.c                                             |   10 
 hw/xwin/winmultiwindowclass.h                                             |    2 
 hw/xwin/winmultiwindowicons.c                                             |    2 
 hw/xwin/winmultiwindowwindow.c                                            |   15 
 hw/xwin/winmultiwindowwndproc.c                                           |    6 
 hw/xwin/winpfbdd.c                                                        |   13 
 hw/xwin/winprefs.c                                                        |    7 
 hw/xwin/winprefs.h                                                        |    2 
 hw/xwin/winscrinit.c                                                      |    4 
 hw/xwin/winwin32rootlesswindow.c                                          |    4 
 hw/xwin/winwindow.c                                                       |    4 
 hw/xwin/winwindowswm.c                                                    |   15 
 hw/xwin/winwndproc.c                                                      |    2 
 include/callback.h                                                        |    1 
 include/cursor.h                                                          |    4 
 include/dix-config.h.in                                                   |    3 
 include/dixgrabs.h                                                        |    2 
 include/dixstruct.h                                                       |    2 
 include/eventstr.h                                                        |    2 
 include/hotplug.h                                                         |    1 
 include/input.h                                                           |    7 
 include/inputstr.h                                                        |    2 
 include/registry.h                                                        |    2 
 include/xkbsrv.h                                                          |    3 
 miext/shadow/Makefile.am                                                  |    4 
 miext/shadow/c2p_core.h                                                   |  187 
 miext/shadow/shadow.h                                                     |   12 
 miext/shadow/shafb4.c                                                     |  139 
 miext/shadow/shafb8.c                                                     |  143 
 miext/shadow/shiplan2p4.c                                                 |  136 
 miext/shadow/shiplan2p8.c                                                 |  137 
 miext/shadow/shpacked.c                                                   |    1 
 os/Makefile.am                                                            |    5 
 os/backtrace.c                                                            |   75 
 os/io.c                                                                   |    1 
 os/log.c                                                                  |  118 
 randr/randr.c                                                             |   24 
 randr/randrstr.h                                                          |    4 
 randr/rrcrtc.c                                                            |   11 
 randr/rrinfo.c                                                            |    2 
 randr/rroutput.c                                                          |    2 
 randr/rrscreen.c                                                          |    2 
 render/animcur.c                                                          |    3 
 test/input.c                                                              |    2 
 test/signal-logging.c                                                     |   95 
 xfixes/cursor.c                                                           |   16 
 xkb/xkb.c                                                                 |    3 
 xkb/xkbActions.c                                                          |  149 
 xkb/xkbInit.c                                                             |   29 
 165 files changed, 5186 insertions(+), 1617 deletions(-)

New commits:
commit cde1b97c0e08b168eb89a50f64acb843a12737d7
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Thu Jul 11 16:55:09 2013 +0200

    Fix null pointer deref on logout. (LP: #1194343)

diff --git a/debian/changelog b/debian/changelog
index ea0fd0d..cfb9eb0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xorg-server (2:1.14.1-0ubuntu1) saucy; urgency=low
+
+  * Fix null pointer deref on logout. (LP: #1194343)
+
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Thu, 11 Jul 2013 16:52:28 +0200
+
 xorg-server (2:1.14.1-0ubuntu0.8) saucy; urgency=low
 
   * Use correct version for libxfixes3.
diff --git a/debian/patches/xf86-detach-scanout.patch b/debian/patches/xf86-detach-scanout.patch
index e25bd48..9226590 100644
--- a/debian/patches/xf86-detach-scanout.patch
+++ b/debian/patches/xf86-detach-scanout.patch
@@ -37,7 +37,7 @@ Dave, does this seem like a reasonable way to work around this particular crash?
 +    int i;
 +
 +    /* make sure there are no attached shared scanout pixmaps first */
-+    for (i = 0; i < rp->numCrtcs; i++)
++    for (i = 0; i < rp && rp->numCrtcs; i++)
 +        RRCrtcDetachScanoutPixmap(rp->crtcs[i]);
 +
 +    DetachOutputGPU(pScreen);

commit 59a6d3f1eb03010ab831b32b03706a1d6143c732
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date:   Thu Nov 8 13:41:13 2012 +0000

    os: Remove any old logfile before trying to write to it
    
    If we are not backing up logfiles, remove the old logfile before trying to write
    a new logfile, as otherwise the operation may fail if the previous logfile was
    created by a different user.
    
    This change is useful when:
    - The DDX doesn't use the logfile backup mechanism (i.e. not Xorg)
    - The DDX is run by a non-root user, and then by a different non-root user
    - The logfile directory doesn't have the restricted-deletion flag set
    
    Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
    Acked-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
    Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/os/log.c b/os/log.c
index f19faf5..53b3586 100644
--- a/os/log.c
+++ b/os/log.c
@@ -216,6 +216,9 @@ LogInit(const char *fname, const char *backup)
                 free(oldLog);
             }
         }
+        else {
+            unlink(logFileName);
+        }
         if ((logFile = fopen(logFileName, "w")) == NULL)
             FatalError("Cannot open log file \"%s\"\n", logFileName);
         setvbuf(logFile, NULL, _IONBF, 0);

commit 8eeaa74bc241acb41f1d3ed64971e0b01e794776
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Tue Jul 9 13:27:19 2013 +1000

    dix: when ungrabbing an active grab, accept pointer grabs (#66720)
    
    Ungrabbing a device during an active touch grab rejects the grab. Ungrabbing
    a device during an active pointer grab accepts the grab.
    
    Rejection is not really an option for a pointer-emulated grab, if a client
    has a button mask on the window it would get a ButtonPress emulated after
    UngrabDevice. That is against the core grab behaviour.
    
    X.Org Bug 66720 <http://bugs.freedesktop.org/show_bug.cgi?id=66720>
    
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
    Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 2bbc6f0..fd4b80c 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1223,9 +1223,13 @@ ProcessTouchOwnershipEvent(TouchOwnershipEvent *ev,
     else if (ev->reason == XIAcceptTouch) {
         int i;
 
-        /* Go through the motions of ending the touch if the listener has
+
+        /* For pointer-emulated listeners that ungrabbed the active grab,
+         * the state was forced to LISTENER_HAS_END. Still go
+         * through the motions of ending the touch if the listener has
          * already seen the end. This ensures that the touch record is ended in
-         * the server. */
+         * the server.
+         */
         if (ti->listeners[0].state == LISTENER_HAS_END)
             TouchEmitTouchEnd(dev, ti, TOUCH_ACCEPT, ti->listeners[0].listener);
 
@@ -1883,16 +1887,23 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
 
     if (listener->type == LISTENER_POINTER_REGULAR ||
         listener->type == LISTENER_POINTER_GRAB) {
-        rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
-                                       grab, xi2mask);
-
-         /* Once we send a TouchEnd to a legacy listener, we're already well
-          * past the accepting/rejecting stage (can only happen on
-          * GrabModeSync + replay. This listener now gets the end event,
-          * and we can continue.
-          */
-        if (rc == Success)
-            listener->state = LISTENER_HAS_END;
+        /* Note: If the active grab was ungrabbed, we already changed the
+         * state to LISTENER_HAS_END but still get here. So we mustn't
+         * actually send the event.
+         * This is part two of the hack in DeactivatePointerGrab
+         */
+        if (listener->state != LISTENER_HAS_END) {
+            rc = DeliverTouchEmulatedEvent(dev, ti, ev, listener, client, win,
+                                           grab, xi2mask);
+
+             /* Once we send a TouchEnd to a legacy listener, we're already well
+              * past the accepting/rejecting stage (can only happen on
+              * GrabModeSync + replay. This listener now gets the end event,
+              * and we can continue.
+              */
+            if (rc == Success)
+                listener->state = LISTENER_HAS_END;
+        }
         goto out;
     }
 
diff --git a/dix/events.c b/dix/events.c
index e5db348..03b2d2e 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1522,13 +1522,20 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
     for (i = 0; !wasPassive && mouse->touch && i < mouse->touch->num_touches; i++) {
         TouchPointInfoPtr ti = mouse->touch->touches + i;
         if (ti->active && TouchResourceIsOwner(ti, grab_resource)) {
+            int mode = XIRejectTouch;
             /* Rejecting will generate a TouchEnd, but we must not
                emulate a ButtonRelease here. So pretend the listener
                already has the end event */
             if (grab->grabtype == CORE || grab->grabtype == XI ||
-                    !xi2mask_isset(mouse->deviceGrab.grab->xi2mask, mouse, XI_TouchBegin))
+                    !xi2mask_isset(mouse->deviceGrab.grab->xi2mask, mouse, XI_TouchBegin)) {
+                mode = XIAcceptTouch;
+                /* NOTE: we set the state here, but
+                 * ProcessTouchOwnershipEvent() will still call
+                 * TouchEmitTouchEnd for this listener. The other half of
+                 * this hack is in DeliverTouchEndEvent */
                 ti->listeners[0].state = LISTENER_HAS_END;
-            TouchListenerAcceptReject(mouse, ti, 0, XIRejectTouch);
+            }
+            TouchListenerAcceptReject(mouse, ti, 0, mode);
         }
     }
 

commit a2d6932ad48f2cbfcc4c5fb8272e47106d08ac78
Author: Julien Cristau <jcristau@debian.org>
Date:   Mon Jul 1 19:39:30 2013 +0200

    xkb: don't call atoi(NULL) when parsing argv
    
    If the -ardelay or -arinterval options have no argument, there's no
    point trying to read it.
    
    See
    http://www.forallsecure.com/bug-reports/feb3db57fc206d8df22ca53a6907f74973876272/
    
    Reported-by: Alexandre Rebert <alexandre@cmu.edu>
    Signed-off-by: Julien Cristau <jcristau@debian.org>
    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index 5308a29..f72655f 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -759,13 +759,15 @@ XkbProcessArguments(int argc, char *argv[], int i)
     if ((strcmp(argv[i], "-ardelay") == 0) || (strcmp(argv[i], "-ar1") == 0)) { /* -ardelay int */
         if (++i >= argc)
             UseMsg();
-        XkbDfltRepeatDelay = (long) atoi(argv[i]);
+        else
+            XkbDfltRepeatDelay = (long) atoi(argv[i]);
         return 2;
     }
     if ((strcmp(argv[i], "-arinterval") == 0) || (strcmp(argv[i], "-ar2") == 0)) {      /* -arinterval int */
         if (++i >= argc)
             UseMsg();
-        XkbDfltRepeatInterval = (long) atoi(argv[i]);
+        else
+            XkbDfltRepeatInterval = (long) atoi(argv[i]);
         return 2;
     }
     return 0;

commit 77e51d5bbb97eb5c9d9dbff9a7c44d7e53620e68
Author: Eric Anholt <eric@anholt.net>
Date:   Mon Jun 17 15:51:19 2013 -0700

    Revert "DRI2: re-allocate DRI2 drawable if pixmap serial changes"
    
    This reverts commit 3209b094a3b1466b579e8020e12a4f3fa78a5f3f.  After a
    long debug session by Paul Berry, it appears that this was the commit
    that has been producing sporadic failures in piglit front buffer
    rendering tests for the last several years.
    
    GetBuffers may return fresh buffers with invalid contents at a couple
    reasonable times:
    
    - When first asked for a non-fake-front buffer.
    - When the drawable size is changed, an Invalidate has been sent, and
      obviously the app needs to redraw the whole buffer.
    - After a glXSwapBuffers(), GL allows the backbuffer to be undefined,
      and an Invalidate was sent to tell the GL that it should grab these
      appropriate new buffers to avoid stalling.
    
    But with the patch being reverted, GetBuffers would also return fresh
    invalid buffers when the drawable serial number changed, which is
    approximately "whenever, for any reason".  The app is not expecting
    invalid buffer contents "whenever", nor is it valid.  Because the GL
    usually only GetBuffers after an Invalidate is sent, and the new
    buffer allocation only happened during a GetBuffers, most apps saw no
    problems.  But apps that do (fake-)frontbuffer rendering do frequently
    ask the server for the front buffer (since we drop the fake front
    allocation when we're not doing front buffer rendering), and if the
    drawable serial got bumped midway through a draw, the server would
    pointlessly ditch the front *and* backbuffer full of important
    drawing, resulting in bad rendering.
    
    The patch was originally to fix bugzilla:
    https://bugs.freedesktop.org/show_bug.cgi?id=28365
    Specifically:
    
        To reproduce, start with a large-ish display (i.e. 1680x1050 on my
        laptop), use the patched glxgears from bug 28252 to add the
        -override option.  Then run glxgears -override -geometry 640x480
        to create a 640x480 window in the top left corner, which will work
        fine.  Next, run xrandr -s 640x480 and watch the fireworks.
    
    I've tested with an override-redirect glxgears, both with vblank sync
    enabled and disabled, both with gnome-shell and no window manager at
    all, before and after this patch.  The only problem observed was that
    before and after the revert, sometimes when alt-tabbing to kill my
    gears after completing the test gnome-shell would get confused about
    override-redirectness of the glxgears window (according to a log
    message) and apparently not bother doing any further compositing.
    
    Signed-off-by: Eric Anholt <eric@anholt.net>
    Reviewed-by: Keith Packard <keithp@keithp.com>
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Keith Packard <keithp@keithp.com>

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 40963c3..0b047f0 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -99,7 +99,6 @@ typedef struct _DRI2Drawable {
     CARD64 last_swap_msc;       /* msc at completion of most recent swap */
     CARD64 last_swap_ust;       /* ust at completion of most recent swap */
     int swap_limit;             /* for N-buffering */
-    unsigned long serialNumber;
     Bool needInvalidate;
     int prime_id;
     PixmapPtr prime_slave_pixmap;
@@ -189,19 +188,6 @@ DRI2GetDrawable(DrawablePtr pDraw)
     }
 }
 
-static unsigned long
-DRI2DrawableSerial(DrawablePtr pDraw)
-{
-    ScreenPtr pScreen = pDraw->pScreen;
-    PixmapPtr pPix;
-
-    if (pDraw->type != DRAWABLE_WINDOW)
-        return pDraw->serialNumber;
-
-    pPix = pScreen->GetWindowPixmap((WindowPtr) pDraw);
-    return pPix->drawable.serialNumber;
-}
-
 static DRI2DrawablePtr
 DRI2AllocateDrawable(DrawablePtr pDraw)
 {
@@ -235,7 +221,6 @@ DRI2AllocateDrawable(DrawablePtr pDraw)
     pPriv->last_swap_msc = 0;
     pPriv->last_swap_ust = 0;
     xorg_list_init(&pPriv->reference_list);
-    pPriv->serialNumber = DRI2DrawableSerial(pDraw);
     pPriv->needInvalidate = FALSE;
     pPriv->redirectpixmap = NULL;
     pPriv->prime_slave_pixmap = NULL;
@@ -493,7 +478,6 @@ allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds,
         || attachment == DRI2BufferFrontLeft
         || !dimensions_match || (pPriv->buffers[old_buf]->format != format)) {
         *buffer = create_buffer (pDraw, attachment, format);
-        pPriv->serialNumber = DRI2DrawableSerial(pDraw);
         return TRUE;
 
     }
@@ -559,8 +543,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
     ds = DRI2GetScreen(pDraw->pScreen);
 
     dimensions_match = (pDraw->width == pPriv->width)
-        && (pDraw->height == pPriv->height)
-        && (pPriv->serialNumber == DRI2DrawableSerial(pDraw));
+        && (pDraw->height == pPriv->height);
 
     buffers = calloc((count + 1), sizeof(buffers[0]));
     if (!buffers)

commit ca40c60f67969a3ee1bfc0b2e2f8657fc1c74fdb
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Mon Jun 17 14:17:10 2013 +0200

    Add patch to fix nvidia regression.
    
    xf86-inactive-gpuscreen.patch
    
    Conflicts:
    	debian/patches/series

diff --git a/debian/changelog b/debian/changelog
index 193f628..2b78d15 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -78,6 +78,14 @@ xorg-server (2:1.14.1-1) UNRELEASED; urgency=low
 
  -- Robert Hooker <sarvatt@ubuntu.com>  Wed, 22 Aug 2012 11:12:17 -0400
 
+xorg-server (2:1.13.3-0ubuntu13) saucy; urgency=low
+
+  * Re-enable xf86-fixup-detection.patch.
+  * Add patch to fix nvidia regression.
+    - xf86-inactive-gpuscreen.patch
+
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Mon, 17 Jun 2013 14:16:05 +0200
+
 xorg-server (2:1.13.3-0ubuntu10) saucy; urgency=low
 
   * Add patch to fix DPMS. (LP: #1184999)
diff --git a/debian/patches/series b/debian/patches/series
index 9e10a04..5c231ad 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -46,5 +46,6 @@ config-add-no-removal.patch
 xf86-detach-scanout.patch
 xf86-fixup-unbind.patch
 xf86-fixup-detection.patch
+xf86-inactive-gpuscreen.patch
 228_autobind_gpu.patch
 xf86-add--gpu-switch.patch
diff --git a/debian/patches/xf86-inactive-gpuscreen.patch b/debian/patches/xf86-inactive-gpuscreen.patch
new file mode 100644
index 0000000..11ffec4
--- /dev/null
+++ b/debian/patches/xf86-inactive-gpuscreen.patch
@@ -0,0 +1,26 @@
+diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
+index c790d50..a47c2d0 100644
+--- a/hw/xfree86/common/xf86platformBus.c
++++ b/hw/xfree86/common/xf86platformBus.c
+@@ -387,7 +387,7 @@ xf86platformProbeDev(DriverPtr drvp)
+     Bool foundScreen = FALSE;
+     GDevPtr *devList;
+     const unsigned numDevs = xf86MatchDevice(drvp->driverName, &devList);
+-    int i, j;
++    int i, j, flags;
+ 
+     /* find the main device or any device specificed in xorg.conf */
+     for (i = 0; i < numDevs; i++) {
+@@ -415,7 +415,11 @@ xf86platformProbeDev(DriverPtr drvp)
+         if (j == xf86_num_platform_devices)
+              continue;
+ 
+-        foundScreen = probeSingleDevice(&xf86_platform_devices[j], drvp, devList[i], 0);
++        flags = 0;
++        if (!devList[i]->active)
++            flags |= PLATFORM_PROBE_GPU_SCREEN;
++
++        foundScreen = probeSingleDevice(&xf86_platform_devices[j], drvp, devList[i], flags);
+         if (!foundScreen)
+             continue;
+     }

commit ef7a883c40fe43d9ba301cc7f9979ff883fe1968
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Thu Jun 13 11:04:27 2013 +0200

    make -gpu work correctly

diff --git a/debian/patches/series b/debian/patches/series
index 5ff1f8b..9e10a04 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -45,4 +45,6 @@ dix-fixup-build-failure.patch
 config-add-no-removal.patch
 xf86-detach-scanout.patch
 xf86-fixup-unbind.patch
+xf86-fixup-detection.patch
 228_autobind_gpu.patch
+xf86-add--gpu-switch.patch
diff --git a/debian/patches/xf86-add--gpu-switch.patch b/debian/patches/xf86-add--gpu-switch.patch
index 5d92129..3e6cc44 100644
--- a/debian/patches/xf86-add--gpu-switch.patch
+++ b/debian/patches/xf86-add--gpu-switch.patch
@@ -1,6 +1,8 @@
+diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
+index 91ec4c8..b9a1065 100644
 --- a/hw/xfree86/common/xf86Init.c
 +++ b/hw/xfree86/common/xf86Init.c
-@@ -95,6 +95,9 @@
+@@ -95,6 +95,9 @@ void (*xf86OSPMClose) (void) = NULL;
  #endif
  static Bool xorgHWOpenConsole = FALSE;
  
@@ -10,7 +12,7 @@
  /* Common pixmap formats */
  
  static PixmapFormatRec formats[MAXFORMATS] = {
-@@ -1435,6 +1438,23 @@
+@@ -1399,6 +1402,23 @@ ddxProcessArgument(int argc, char **argv, int i)
          xf86PointerName = argv[++i];
          return 2;
      }
@@ -34,7 +36,7 @@
      if (!strcmp(argv[i], "-keyboard")) {
          CHECK_FOR_REQUIRED_ARGUMENT();
          xf86KeyboardName = argv[++i];
-@@ -1543,6 +1563,7 @@
+@@ -1507,6 +1527,7 @@ ddxUseMsg(void)
          ("-keyboard name         specify the core keyboard InputDevice name\n");
      ErrorF
          ("-pointer name          specify the core pointer InputDevice name\n");
@@ -42,9 +44,11 @@
      ErrorF("-nosilk                disable Silken Mouse\n");
      ErrorF("-flipPixels            swap default black/white Pixel values\n");
  #ifdef XF86VIDMODE
+diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
+index 58cfe0a..a639fbd 100644
 --- a/hw/xfree86/common/xf86Priv.h
 +++ b/hw/xfree86/common/xf86Priv.h
-@@ -98,6 +98,11 @@
+@@ -96,6 +96,11 @@ extern _X_EXPORT RootWinPropPtr *xf86RegisteredPropertiesTable;
  
  extern ScrnInfoPtr *xf86GPUScreens;      /* List of pointers to ScrnInfoRecs */
  extern int xf86NumGPUScreens;
@@ -56,63 +60,179 @@
  #ifndef DEFAULT_VERBOSE
  #define DEFAULT_VERBOSE		0
  #endif
---- a/hw/xfree86/common/xf86platformBus.c
-+++ b/hw/xfree86/common/xf86platformBus.c
-@@ -355,7 +355,14 @@
-     Bool foundScreen = FALSE;
-     GDevPtr *devList;
-     const unsigned numDevs = xf86MatchDevice(drvp->driverName, &devList);
--    int i, j;
-+    int i, j, primary_idx = 0;
-+
-+    for (i = 0; i < xf86_num_platform_devices; ++i) {
-+        if (xf86_platform_devices[j].pdev && xf86IsPrimaryPlatform(&xf86_platform_devices[i])) {
-+            primary_idx = i;
-+            break;
-+        }
-+    }
+diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
+index 258988a..51a3b53 100644
+--- a/hw/xfree86/common/xf86pciBus.c
++++ b/hw/xfree86/common/xf86pciBus.c
+@@ -77,6 +77,10 @@ int pciSlotClaimed = 0;
+     (((c) & 0x00ffff00) \
+ 	 == ((PCI_CLASS_DISPLAY << 16) | (PCI_SUBCLASS_DISPLAY_VGA << 8)))
  
-     /* find the main device or any device specificed in xorg.conf */
-     for (i = 0; i < numDevs; i++) {
-@@ -369,23 +376,35 @@
-                 if (ServerIsNotSeat0())
-                     break;
-                 if (xf86_platform_devices[j].pdev) {
--                    if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
-+                    if (xf86gpu_idx >= 0)
-                         break;
--                }
--                else {
-+                    else if (j == primary_idx)
-+                        break;
-+                } else if ((xf86_num_platform_devices == 1) && (!foundScreen))
-                     /* there's no way to handle real platform devices at this point,
-                      * as there's no valid busID to be used, so try to move forward
-                      * in case there's only one platform device, and see if the
-                      * driver's probe succeeds or not at least once */
--                    if ((xf86_num_platform_devices == 1) && (!foundScreen))
--                        break;
--                }
-+                    break;
++#define IS_3D(c) \
++    (((c) & 0x00ffff00) \
++	 == ((PCI_CLASS_DISPLAY << 16) | (PCI_SUBCLASS_DISPLAY_3D << 8)))
++
+ static struct pci_slot_match xf86IsolateDevice = {
+     PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0
+ };
+@@ -88,6 +92,7 @@ static struct pci_slot_match xf86IsolateDevice = {
+ void
+ xf86PciProbe(void)
+ {
++    int primary_idx = -1;
+     int i = 0, k;
+     int num = 0;
+     struct pci_device *info;
+@@ -113,6 +118,7 @@ xf86PciProbe(void)
+             if (primaryBus.type == BUS_NONE && pci_device_is_boot_vga(info)) {
+                 primaryBus.type = BUS_PCI;
+                 primaryBus.id.pci = info;
++                primary_idx = num - 1;
              }
+             info->user_data = 0;
          }
+@@ -128,10 +134,12 @@ xf86PciProbe(void)
+             pci_device_cfg_read_u16(info, &command, 4);
  
-         if (j == xf86_num_platform_devices)
-              continue;
- 
-+        /*
-+         * When xf86gpu_idx is set the primary device will come first.
-+         * The rest will be reordered, this way -gpu 0 will always map
-+         * to the default.
-+         */
-+        if (xf86gpu_idx >= 0) {
-+            if (j < primary_idx)  {
-+                if (j + 1 != xf86gpu_idx)
-+                     continue;
-+            } else if (j - primary_idx != xf86gpu_idx)
-+                continue;
-+        }
+             if ((command & PCI_CMD_MEM_ENABLE)
+-                && ((num == 1) || IS_VGA(info->device_class))) {
++                && (num == 1 || IS_VGA(info->device_class) ||
++                    IS_3D(info->device_class))) {
+                 if (primaryBus.type == BUS_NONE) {
+                     primaryBus.type = BUS_PCI;
+                     primaryBus.id.pci = info;
++                    primary_idx = i;
+                 }
+                 else {
+                     xf86Msg(X_NOTICE,
+@@ -142,6 +150,17 @@ xf86PciProbe(void)
+         }
+     }
+ 
++    if (xf86gpu_idx > 0 && primary_idx >= 0) {
++        if (xf86gpu_idx >= num)
++            FatalError("invalid -gpu %i specified devices, only %i cards found\n", xf86gpu_idx, num);
 +
-         foundScreen = probeSingleDevice(&xf86_platform_devices[j], drvp, devList[i], 0);
-         if (!foundScreen)
++        primaryBus.type = BUS_PCI;
++        if (xf86gpu_idx > primary_idx)
++            primaryBus.id.pci = xf86PciVideoInfo[xf86gpu_idx];
++        else
++            primaryBus.id.pci = xf86PciVideoInfo[xf86gpu_idx - 1];
++    }
++
+     /* Print a summary of the video devices found */
+     for (k = 0; k < num; k++) {
+         const char *prim = " ";
+@@ -153,7 +172,7 @@ xf86PciProbe(void)
              continue;
+ 
+         if (xf86IsPrimaryPci(info))
+-            prim = "*";
++            prim = xf86gpu_idx > 0 ? "o" : "*";
+ 
+         xf86Msg(X_PROBED, "PCI:%s(%u:%u:%u:%u) %04x:%04x:%04x:%04x ", prim,
+                 info->domain, info->bus, info->dev, info->func,
+diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
+index e368dee..2fb4694 100644
+--- a/hw/xfree86/common/xf86platformBus.c
++++ b/hw/xfree86/common/xf86platformBus.c
+@@ -131,7 +131,7 @@ xf86IsPrimaryPlatform(struct xf86_platform_device *plat)
+     return ((primaryBus.type == BUS_PLATFORM) && (plat == primaryBus.id.plat));
+ }
+ 
+-static void
++static int
+ platform_find_pci_info(struct xf86_platform_device *pd, char *busid)
+ {
+     struct pci_slot_match devmatch;
+@@ -143,20 +143,22 @@ platform_find_pci_info(struct xf86_platform_device *pd, char *busid)
+                  &devmatch.domain, &devmatch.bus, &devmatch.dev,
+                  &devmatch.func);
+     if (ret != 4)
+-        return;
++        return 0;
+ 
+     iter = pci_slot_match_iterator_create(&devmatch);
+     info = pci_device_next(iter);
++    ret = 0;
+     if (info) {
+         pd->pdev = info;
+         pci_device_probe(info);
+         if (pci_device_is_boot_vga(info)) {
+             primaryBus.type = BUS_PLATFORM;
+             primaryBus.id.plat = pd;
++            ret = 1;
+         }
+     }
+     pci_iterator_destroy(iter);
+-
++    return ret;
+ }
+ 
+ static Bool
+@@ -216,22 +219,46 @@ xf86PlatformMatchDriver(char *matches[], int nmatches)
+ int
+ xf86platformProbe(void)
+ {
+-    int i;
+-    Bool pci = TRUE;
++    int i, primary_idx = 0;
+ 
+     config_odev_probe(xf86PlatformDeviceProbe);
+ 
+-    if (!xf86scanpci()) {
+-        pci = FALSE;
+-    }
++    if (!xf86scanpci())
++        return 0;
+ 
+     for (i = 0; i < xf86_num_platform_devices; i++) {
+         char *busid = xf86_get_platform_attrib(i, ODEV_ATTRIB_BUSID);
+ 
+-        if (pci && (strncmp(busid, "pci:", 4) == 0)) {
+-            platform_find_pci_info(&xf86_platform_devices[i], busid);
++        if (strncmp(busid, "pci:", 4) == 0) {
++            if (platform_find_pci_info(&xf86_platform_devices[i], busid))
++                primary_idx = i;
+         }
+     }
++
++    if (xf86gpu_idx > 0 &&
++        xf86gpu_idx < xf86_num_platform_devices) {
++        if (xf86gpu_idx <= primary_idx)
++            primaryBus.id.plat = &xf86_platform_devices[xf86gpu_idx - 1];
++        else
++            primaryBus.id.plat = &xf86_platform_devices[xf86gpu_idx];
++    }
++
++    for (i = 0; i < xf86_num_platform_devices; i++) {
++        const char *prim = " ";
++        Bool memdone = FALSE, iodone = FALSE;
++        struct xf86_platform_device *dev = &xf86_platform_devices[i];
++
++        if (xf86IsPrimaryPlatform(dev))
++            prim = xf86gpu_idx > 0 ? "o" : "*";
++
++        xf86Msg(X_PROBED, "[%s%i] %s %s %s %04x:%04x\n", prim, i,
++                xf86_get_platform_attrib(i, ODEV_ATTRIB_BUSID),
++                xf86_get_platform_attrib(i, ODEV_ATTRIB_PATH),
++                xf86_get_platform_attrib(i, ODEV_ATTRIB_SYSPATH),
++                dev->pdev ? dev->pdev->vendor_id : 0xffff,
++                dev->pdev ? dev->pdev->device_id : 0xffff);
++    }
++
+     return 0;
+ }
+ 
+diff --git a/hw/xfree86/os-support/bus/xf86Pci.h b/hw/xfree86/os-support/bus/xf86Pci.h
+index f69e55b..1183b7a 100644
+--- a/hw/xfree86/os-support/bus/xf86Pci.h
++++ b/hw/xfree86/os-support/bus/xf86Pci.h
+@@ -173,6 +173,7 @@
+ /* 0x03 display subclasses */
+ #define PCI_SUBCLASS_DISPLAY_VGA	0x00
+ #define PCI_SUBCLASS_DISPLAY_XGA	0x01
++#define PCI_SUBCLASS_DISPLAY_3D		0x02
+ #define PCI_SUBCLASS_DISPLAY_MISC	0x80
+ 
+ /* 0x04 multimedia subclasses */
diff --git a/debian/patches/xf86-fixup-detection.patch b/debian/patches/xf86-fixup-detection.patch
new file mode 100644
index 0000000..e454c75
--- /dev/null
+++ b/debian/patches/xf86-fixup-detection.patch
@@ -0,0 +1,79 @@
+--- a/hw/xfree86/common/xf86pciBus.c
++++ b/hw/xfree86/common/xf86pciBus.c
+@@ -546,6 +546,15 @@
+                     for (k = 0; k < xf86NumEntities; k++) {
+                         EntityPtr pEnt = xf86Entities[k];
+ 
++#ifdef XSERVER_PLATFORM_BUS
++                        if (pEnt->bus.type == BUS_PLATFORM &&
++                            pEnt->bus.id.plat->pdev &&
++                            MATCH_PCI_DEVICES(pEnt->bus.id.plat->pdev, pPci)) {
++                            foundScreen = TRUE;
++                            break;
++                        }
++#endif
++
+                         if (pEnt->bus.type != BUS_PCI)
+                             continue;
+                         if (pEnt->bus.id.pci == pPci) {
+--- a/hw/xfree86/common/xf86platformBus.c
++++ b/hw/xfree86/common/xf86platformBus.c
+@@ -167,11 +167,12 @@
+     for (i = 0; i < xf86NumEntities; i++) {
+         const EntityPtr u = xf86Entities[i];
+ 
+-        if (pd->pdev && u->bus.type == BUS_PCI)
+-            return !MATCH_PCI_DEVICES(pd->pdev, u->bus.id.pci);
+-        if ((u->bus.type == BUS_PLATFORM) && (pd == u->bus.id.plat)) {
++        if (pd->pdev && u->bus.type == BUS_PCI &&
++            MATCH_PCI_DEVICES(pd->pdev, u->bus.id.pci))
++            return FALSE;
++
++        if ((u->bus.type == BUS_PLATFORM) && (pd == u->bus.id.plat))
+             return FALSE;
+-        }
+     }
+     return TRUE;
+ }
+@@ -302,6 +303,11 @@
+         for (nent = 0; nent < xf86NumEntities; nent++) {
+             EntityPtr pEnt = xf86Entities[nent];
+ 
++            if (dev->pdev && pEnt->bus.type == BUS_PCI &&
++                MATCH_PCI_DEVICES(dev->pdev, pEnt->bus.id.pci)) {
++                return FALSE;
++            }
++
+             if (pEnt->bus.type != BUS_PLATFORM)
+                 continue;
+             if (pEnt->bus.id.plat == dev) {
+@@ -368,18 +374,15 @@
+                 /* for non-seat0 servers assume first device is the master */
+                 if (ServerIsNotSeat0())
+                     break;
+-                if (xf86_platform_devices[j].pdev) {
+-                    if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
+-                        break;
+-                }
+-                else {
++                if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
++                    break;
++                else
+                     /* there's no way to handle real platform devices at this point,
+                      * as there's no valid busID to be used, so try to move forward
+                      * in case there's only one platform device, and see if the
+                      * driver's probe succeeds or not at least once */
+                     if ((xf86_num_platform_devices == 1) && (!foundScreen))
+                         break;
+-                }
+             }
+         }
+ 
+@@ -398,6 +401,7 @@
+         }
+     }
+ 
++    free(devList);
+     return foundScreen;
+ }
+ 

commit 80054fcafb095aff76f6df00d348c7fd85e8ddbc
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date:   Sat Mar 30 19:44:14 2013 +0000

    hw/xwin: Update manifest to target all architectures, not just x86
    
    Update manifest to target all architectures, not just x86
    
    Also: Write explicit dependencies for Xwin.rc.  XWin.exe.manifest and X.ico are
    included the resource compiler output, so add a dependency on them to cause it
    to be recompiled if they change.
    
    Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison@virgin.net>

diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 93ce570..f131975 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -160,6 +160,8 @@ XWin_LDFLAGS = -mwindows -static
 .rc.o:
 	$(AM_V_GEN)$(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -I $(top_builddir)/include
 
+XWin.o: XWin.rc XWin.exe.manifest X.ico
+
 winprefsyacc.h: winprefsyacc.c
 winprefslex.c: winprefslex.l winprefsyacc.c winprefsyacc.h
 
diff --git a/hw/xwin/XWin.exe.manifest b/hw/xwin/XWin.exe.manifest
index a0d4d7d..477334f 100755
--- a/hw/xwin/XWin.exe.manifest
+++ b/hw/xwin/XWin.exe.manifest
@@ -7,7 +7,7 @@
 	       type="win32"
 	       name="Microsoft.Windows.Common-Controls"
 	       version="6.0.0.0"
-	       processorArchitecture="X86"
+	       processorArchitecture="*"
 	       publicKeyToken="6595b64144ccf1df"
 	       language="*"
 	     />

commit 689e7ad9b0fccd582cd63796cc90a999f141f589
Author: Jon TURNEY <jon.turney@dronecode.org.uk>
Date:   Sun Mar 31 18:36:37 2013 +0100

    hw/xwin: Win32 Windows properties are of pointer type HANDLE, not an integer type
    
    Win32 Windows properties are of pointer type HANDLE, not an integer type, but we
    use the Windows property WINDOW_WID_PROP to store the X window XID.


Reply to: