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

xorg-server: Changes to 'ubuntu-trusty'



 debian/changelog                              |   45 ++++++
 debian/patches/drm_device_keep_trying.patch   |  172 ++++++++++++++++++++++++++
 debian/patches/mi-dont-process-disabled.patch |   62 +++++++++
 debian/patches/ppc64el-endian-fix.patch       |   34 +++++
 debian/patches/series                         |    5 
 debian/patches/xi-dont-copy-too-much.patch    |   67 ++++++++++
 debian/patches/xi2-resize-touch.patch         |   34 +++++
 7 files changed, 419 insertions(+)

New commits:
commit 66ee7bc03428633f0f978f571cb3a91690ab2ef6
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Jul 2 12:43:15 2014 +0200

    release copy of the utopic package back to trusty

diff --git a/debian/changelog b/debian/changelog
index d29c7a7..9351147 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,19 @@
+xorg-server (2:1.15.1-0ubuntu2.1) trusty-proposed; urgency=medium
+
+  * Copy utopic package back to trusty.
+    - Fix ppc64el byte order. (LP: #1333422)
+      + xi-dont-copy-too-much.patch
+    - Fix valgrind issue with xi copying too much.
+      + xi-dont-copy-too-much.patch
+    - Fix crash related to suspend/shutdown. (LP: #1208473)
+      + mi-dont-process-disabled.patch
+    - Fix touch event history overflow.
+      + xi2-resize-touch.patch
+    - Fix switching to guest sessions. (LP: #1322212)
+      + Revive drm_device_keep_trying.patch
+
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 02 Jul 2014 12:37:25 +0200
+
 xorg-server (2:1.15.1-0ubuntu6) utopic; urgency=medium
 
   * ppc64el-endian-fix.patch: Fix PPC endian assumptions (LP: #1333422)

commit 201424bd607c84c106635d71dbef18d69c41454e
Author: Adam Conrad <adconrad@ubuntu.com>
Date:   Mon Jun 23 23:47:15 2014 -0600

    Fix PPC endian assumptions (LP: #1333422)

diff --git a/debian/changelog b/debian/changelog
index 126f08d..d29c7a7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xorg-server (2:1.15.1-0ubuntu6) utopic; urgency=medium
+
+  * ppc64el-endian-fix.patch: Fix PPC endian assumptions (LP: #1333422)
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Mon, 23 Jun 2014 23:47:15 -0600
+
 xorg-server (2:1.15.1-0ubuntu5) utopic; urgency=low
 
   * Add upstream patch to fix some valgrind issues.
diff --git a/debian/patches/ppc64el-endian-fix.patch b/debian/patches/ppc64el-endian-fix.patch
new file mode 100644
index 0000000..6950b27
--- /dev/null
+++ b/debian/patches/ppc64el-endian-fix.patch
@@ -0,0 +1,34 @@
+From adb7bc3386559dfee34b359dadcbb6796bc416e7 Mon Sep 17 00:00:00 2001
+From: Dinar Valeev <dvaleev@suse.com>
+Date: Mon, 24 Feb 2014 10:36:54 +0000
+Subject: arch: Fix image and bitmap byte order for ppc64le
+
+So far PPC was big endian for sure. For ppc64le this is no longer
+true.
+
+Signed-off-by: Egbert Eich <eich@freedesktop.org>
+Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
+Signed-off-by: Keith Packard <keithp@keithp.com>
+---
+diff --git a/include/servermd.h b/include/servermd.h
+index 081123b..e413314 100644
+--- a/include/servermd.h
++++ b/include/servermd.h
+@@ -114,8 +114,13 @@ SOFTWARE.
+ 
+ #if defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__)
+ 
+-#define IMAGE_BYTE_ORDER        MSBFirst
+-#define BITMAP_BIT_ORDER        MSBFirst
++#if defined(__LITTLE_ENDIAN__)
++#define IMAGE_BYTE_ORDER      LSBFirst
++#define BITMAP_BIT_ORDER      LSBFirst
++#else
++#define IMAGE_BYTE_ORDER      MSBFirst
++#define BITMAP_BIT_ORDER      MSBFirst
++#endif
+ #define GLYPHPADBYTES           4
+ 
+ #endif                          /* PowerPC */
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/debian/patches/series b/debian/patches/series
index 8266f07..9fa55f1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -55,3 +55,4 @@ drm_device_keep_trying.patch
 xi2-resize-touch.patch
 xi-dont-copy-too-much.patch
 mi-dont-process-disabled.patch
+ppc64el-endian-fix.patch

commit a1b1ff9a27765697bc001a42f47dcef11f5e58da
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Tue May 20 11:32:49 2014 +0200

    release to u

diff --git a/debian/changelog b/debian/changelog
index 4ea0d8c..126f08d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,11 @@
-xorg-server (2:1.15.1-0ubuntu5) UNRELEASED; urgency=low
+xorg-server (2:1.15.1-0ubuntu5) utopic; urgency=low
 
   * Add upstream patch to fix some valgrind issues.
     - xi-dont-copy-too-much.patch
   * Fix crash related to suspend/shutdown. (LP: #1208473)
     - mi-dont-process-disabled.patch
 
- -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Tue, 20 May 2014 10:49:07 +0200
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Tue, 20 May 2014 11:32:41 +0200
 
 xorg-server (2:1.15.1-0ubuntu4) utopic; urgency=low
 

commit 2f75edaca4e4f532abf7882d34b8dbbee22eeb71
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Tue May 20 11:30:52 2014 +0200

    Add upstream patches to fix some valgrind issues, and fix crash related to suspend/shutdown.
    
    xi-dont-copy-too-much.patch
    mi-dont-process-disabled.patch

diff --git a/debian/changelog b/debian/changelog
index 06eb8a8..4ea0d8c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+xorg-server (2:1.15.1-0ubuntu5) UNRELEASED; urgency=low
+
+  * Add upstream patch to fix some valgrind issues.
+    - xi-dont-copy-too-much.patch
+  * Fix crash related to suspend/shutdown. (LP: #1208473)
+    - mi-dont-process-disabled.patch
+
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Tue, 20 May 2014 10:49:07 +0200
+
 xorg-server (2:1.15.1-0ubuntu4) utopic; urgency=low
 
   * Resize touch event history if the array is filled up.
diff --git a/debian/patches/mi-dont-process-disabled.patch b/debian/patches/mi-dont-process-disabled.patch
new file mode 100644
index 0000000..81691ee
--- /dev/null
+++ b/debian/patches/mi-dont-process-disabled.patch
@@ -0,0 +1,62 @@
+Date: Tue, 20 May 2014 14:32:59 +1000
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Subject: [PATCH] mi: don't process events from disabled devices (#77884)
+
+Once a device is disabled, it doesn't have a sprite pointer anymore. If an
+event is still in the queue and processed after DisableDevice finished, a
+dereference causes a crash. Example backtrace (crash forced by injecting an
+event at the right time):
+
+(EE) 0: /opt/xorg/bin/Xorg (OsSigHandler+0x3c) [0x48d334]
+(EE) 1: /lib64/libpthread.so.0 (__restore_rt+0x0) [0x37fcc0f74f]
+(EE) 2: /opt/xorg/bin/Xorg (mieqMoveToNewScreen+0x38) [0x609240]
+(EE) 3: /opt/xorg/bin/Xorg (mieqProcessDeviceEvent+0xd4) [0x609389]
+(EE) 4: /opt/xorg/bin/Xorg (mieqProcessInputEvents+0x206) [0x609720]
+(EE) 5: /opt/xorg/bin/Xorg (ProcessInputEvents+0xd) [0x4aeb58]
+(EE) 6: /opt/xorg/bin/Xorg (xf86VTSwitch+0x1a6) [0x4af457]
+(EE) 7: /opt/xorg/bin/Xorg (xf86Wakeup+0x2bf) [0x4af0a7]
+(EE) 8: /opt/xorg/bin/Xorg (WakeupHandler+0x83) [0x4445cb]
+(EE) 9: /opt/xorg/bin/Xorg (WaitForSomething+0x3fe) [0x491bf6]
+(EE) 10: /opt/xorg/bin/Xorg (Dispatch+0x97) [0x435748]
+(EE) 11: /opt/xorg/bin/Xorg (dix_main+0x61d) [0x4438a9]
+(EE) 12: /opt/xorg/bin/Xorg (main+0x28) [0x49ba28]
+(EE) 13: /lib64/libc.so.6 (__libc_start_main+0xf5) [0x37fc821d65]
+(EE) 14: /opt/xorg/bin/Xorg (_start+0x29) [0x425e69]
+(EE) 15: ? (?+0x29) [0x29]
+
+xf86VTSwitch() calls ProcessInputEvents() before disabling a device, and
+DisableDevice() calls mieqProcessInputEvents() again when flushing touches and
+button events. Between that and disabling the device (which causes new events
+to be refused) there is a window where events may be triggered and enqueued.
+On the next call to PIE that event is processed on a now defunct device,
+causing the crash.
+
+The simplest fix to this is to discard events from disabled devices. We flush
+the queue often enough before disabling that when we get here, we really don't
+care about the events from this device.
+
+X.Org Bug 77884 <http://bugs.freedesktop.org/show_bug.cgi?id=77884>
+---
+Modified by Maarten Lankhorst to pass tests.
+
+ mi/mieq.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/mi/mieq.c b/mi/mieq.c
+index 4c07480..188a0b0 100644
+--- a/mi/mieq.c
++++ b/mi/mieq.c
+@@ -515,6 +515,10 @@ mieqProcessDeviceEvent(DeviceIntPtr dev, InternalEvent *event, ScreenPtr screen)
+ 
+     verify_internal_event(event);
+ 
++    /* refuse events from disabled devices */
++    if (dev && !dev->enabled)
++        return 0;
++
+     /* Custom event handler */
+     handler = miEventQueue.handlers[event->any.type];
+ 
+-- 
+1.9.0
+
diff --git a/debian/patches/series b/debian/patches/series
index 93c7b5a..8266f07 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -53,3 +53,5 @@ fix-ftbfs-ppc64el.patch
 xmir.patch
 drm_device_keep_trying.patch
 xi2-resize-touch.patch
+xi-dont-copy-too-much.patch
+mi-dont-process-disabled.patch
diff --git a/debian/patches/xi-dont-copy-too-much.patch b/debian/patches/xi-dont-copy-too-much.patch
new file mode 100644
index 0000000..117f7f4
--- /dev/null
+++ b/debian/patches/xi-dont-copy-too-much.patch
@@ -0,0 +1,67 @@
+commit 56929f41e6c4cc1b2d72a33d14b4d993e7b613a3
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Apr 29 16:52:01 2014 +1000
+
+    Xi: don't copy a DeviceEvent into an InternalEvent
+    
+    ==26141== Invalid read of size 8
+    ==26141==    at 0x58FAEA: DeliverEmulatedMotionEvent (exevents.c:1484)
+    
+    An InternalEvent is bigger than a DeviceEvent, thus copying one to the other
+    reads past the allocated boundary. Shouldn't have any real effect since we
+    shouldn't access anything past the DeviceEvent boundary if the event type is
+    correct.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+diff --git a/Xi/exevents.c b/Xi/exevents.c
+index 9c207eb..02530bd 100644
+--- a/Xi/exevents.c
++++ b/Xi/exevents.c
+@@ -1469,7 +1469,7 @@ static void
+ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
+                            InternalEvent *ev)
+ {
+-    InternalEvent motion;
++    DeviceEvent motion;
+ 
+     if (ti->num_listeners) {
+         ClientPtr client;
+@@ -1481,11 +1481,11 @@ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
+             ti->listeners[0].type != LISTENER_POINTER_GRAB)
+             return;
+ 
+-        motion = *ev;
+-        motion.any.type = ET_TouchUpdate;
+-        motion.device_event.detail.button = 0;
++        motion = ev->device_event;
++        motion.type = ET_TouchUpdate;
++        motion.detail.button = 0;
+ 
+-        if (!RetrieveTouchDeliveryData(dev, ti, &motion,
++        if (!RetrieveTouchDeliveryData(dev, ti, (InternalEvent*)&motion,
+                                        &ti->listeners[0], &client, &win, &grab,
+                                        &mask))
+             return;
+@@ -1500,18 +1500,18 @@ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
+             }
+         }
+ 
+-        DeliverTouchEmulatedEvent(dev, ti, &motion, &ti->listeners[0], client,
++        DeliverTouchEmulatedEvent(dev, ti, (InternalEvent*)&motion, &ti->listeners[0], client,
+                                   win, grab, mask);
+     }
+     else {
+         InternalEvent button;
+         int converted;
+ 
+-        converted = TouchConvertToPointerEvent(ev, &motion, &button);
++        converted = TouchConvertToPointerEvent(ev, (InternalEvent*)&motion, &button);
+ 
+         BUG_WARN(converted == 0);
+         if (converted)
+-            ProcessOtherEvent(&motion, dev);
++            ProcessOtherEvent((InternalEvent*)&motion, dev);
+     }
+ }
+ 

commit 2e84778c7527f10ed10392053cdee9886d193573
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed May 7 14:00:39 2014 +0200

    Resize touch event history if the array is filled up.
    
    xi2-resize-touch.patch

diff --git a/debian/changelog b/debian/changelog
index 508e9bd..06eb8a8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+xorg-server (2:1.15.1-0ubuntu4) utopic; urgency=low
+
+  * Resize touch event history if the array is filled up.
+    - xi2-resize-touch.patch
+
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 07 May 2014 13:52:59 +0200
+
 xorg-server (2:1.15.1-0ubuntu3) utopic; urgency=medium
 
   * Revive the old drm_device_keep_trying.patch.
diff --git a/debian/patches/series b/debian/patches/series
index 0351dc2..93c7b5a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -52,3 +52,4 @@ pixman-validate.patch
 fix-ftbfs-ppc64el.patch
 xmir.patch
 drm_device_keep_trying.patch
+xi2-resize-touch.patch
diff --git a/debian/patches/xi2-resize-touch.patch b/debian/patches/xi2-resize-touch.patch
new file mode 100644
index 0000000..021dd59
--- /dev/null
+++ b/debian/patches/xi2-resize-touch.patch
@@ -0,0 +1,34 @@
+diff --git a/dix/touch.c b/dix/touch.c
+index a7ea213..1478e38 100644
+--- a/dix/touch.c
++++ b/dix/touch.c
+@@ -460,12 +460,26 @@ TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev)
+     if (ev->flags & (TOUCH_CLIENT_ID | TOUCH_REPLAYING))
+         return;
+ 
++    if (ti->history_elements == ti->history_size - 1) {
++        DeviceEvent *hist = NULL;
++        size_t sz = ti->history_size * 2;
++
++        if (sz < 10000) {
++            hist = realloc(ti->history, sz * sizeof(*hist));
++
++            if (hist) {
++                ti->history = hist;
++                ti->history_size = sz;
++                memset(&hist[sz/2], 0, sizeof(*hist)*sz/2);
++            }
++        }
++    }
++
+     ti->history[ti->history_elements++] = *ev;
+-    /* FIXME: proper overflow fixes */
+     if (ti->history_elements > ti->history_size - 1) {
+         ti->history_elements = ti->history_size - 1;
+-        DebugF("source device %d: history size %d overflowing for touch %u\n",
+-               ti->sourceid, ti->history_size, ti->client_id);
++        ErrorF("source device %d: history size %d overflowing for touch %u\n",
++              ti->sourceid, ti->history_size, ti->client_id);
+     }
+ }
+ 

commit 441e968bd3f9f6f1375333df91cc781c62e3246d
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Mon Apr 28 10:08:37 2014 +0200

    release to utopic

diff --git a/debian/changelog b/debian/changelog
index db2ff1d..508e9bd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,9 @@
-xorg-server (2:1.15.1-0ubuntu3) UNRELEASED; urgency=low
+xorg-server (2:1.15.1-0ubuntu3) utopic; urgency=medium
 
   * Revive the old drm_device_keep_trying.patch.
     - Removing the call to get_drm_info fixes switching to guest sessions.
 
- -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 23 Apr 2014 11:24:30 +0200
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Mon, 28 Apr 2014 10:06:21 +0200
 
 xorg-server (2:1.15.1-0ubuntu2) trusty; urgency=medium
 

commit 9bc8fed00d8ef6861701f16f4b94fb290194b9ca
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Apr 23 16:27:26 2014 +0200

    fixup drm_device_keep_trying.patch to prevent a drm node being added twice

diff --git a/debian/patches/drm_device_keep_trying.patch b/debian/patches/drm_device_keep_trying.patch
index 2359851..8a8f920 100644
--- a/debian/patches/drm_device_keep_trying.patch
+++ b/debian/patches/drm_device_keep_trying.patch
@@ -1,13 +1,16 @@
-From fe5802680b5ecf5ecef55b839f2f555882207d41 Mon Sep 17 00:00:00 2001
-From: Bryce Harrington <bryce@canonical.com>
-Date: Wed, 13 Feb 2013 11:39:34 -0800
-Subject: [PATCH] If drm device couldn't be opened, keep trying for a sec.
+From: Maarten Lankhorst <maarten.lankhorst@canonical.com>
+Subject: [PATCH] do not use drmGetBusid to grab the pci-id name
 
 The kernel returns EACCES or EAGAIN on drm open when the drm device is
 currently unavailable, such as if it is in use by another process
 (e.g. plymouth), or hasn't finished initializing (e.g. on a really fast
-SSD).  Check for errors when trying to open the device, and continue
-retrying for a short period before giving up.
+SSD). Because the probing is done before a vt switch is completed,
+we have no way to ensure that we can own DRM master. This results
+in failing to boot.
+
+Also attrib->unowned is not initialized, always initialize it to fix
+a valgrind warning, and to prevent adding the same device a second time
+after a vt switch.
 
 Fixes: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/982889
 
@@ -144,7 +147,7 @@ Signed-off-by: Bryce Harrington <bryce@canonical.com>
      ret = xf86platformAddDevice(index);
      if (ret == -1)
          xf86_remove_platform_device(index);
-@@ -145,18 +102,12 @@
+@@ -145,18 +102,10 @@
  
      LogMessage(X_INFO, "xfree86: Adding drm device (%s)\n", path);
  
@@ -159,11 +162,10 @@ Signed-off-by: Bryce Harrington <bryce@canonical.com>
 -    ret = get_drm_info(attribs, path, -1);
 -    if (ret == FALSE)
 -        goto out_free;
-+    if (!xf86VTOwner())
-+        /* if we don't currently own the VT then don't probe the device,
-+           just mark it as unowned for later use */
-+        attribs->unowned = TRUE;
- 
+-
++    /* if we don't currently own the VT then don't probe the device,
++       just mark it as unowned for later use */
++    attribs->unowned = !xf86VTOwner();
 +    xf86_add_platform_device(attribs);
      return;
  

commit e4243b84075f5f4c90b7230fcf90f0ccf207a484
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Apr 23 11:25:36 2014 +0200

    Revive the old drm_device_keep_trying.patch.
    
    Removing the call to get_drm_info fixes switching to guest sessions.

diff --git a/debian/changelog b/debian/changelog
index 3638c54..db2ff1d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+xorg-server (2:1.15.1-0ubuntu3) UNRELEASED; urgency=low
+
+  * Revive the old drm_device_keep_trying.patch.
+    - Removing the call to get_drm_info fixes switching to guest sessions.
+
+ -- Maarten Lankhorst <maarten.lankhorst@ubuntu.com>  Wed, 23 Apr 2014 11:24:30 +0200
+
 xorg-server (2:1.15.1-0ubuntu2) trusty; urgency=medium
 
   * Disable support for rotations and transforms
diff --git a/debian/patches/drm_device_keep_trying.patch b/debian/patches/drm_device_keep_trying.patch
new file mode 100644
index 0000000..2359851
--- /dev/null
+++ b/debian/patches/drm_device_keep_trying.patch
@@ -0,0 +1,170 @@
+From fe5802680b5ecf5ecef55b839f2f555882207d41 Mon Sep 17 00:00:00 2001
+From: Bryce Harrington <bryce@canonical.com>
+Date: Wed, 13 Feb 2013 11:39:34 -0800
+Subject: [PATCH] If drm device couldn't be opened, keep trying for a sec.
+
+The kernel returns EACCES or EAGAIN on drm open when the drm device is
+currently unavailable, such as if it is in use by another process
+(e.g. plymouth), or hasn't finished initializing (e.g. on a really fast
+SSD).  Check for errors when trying to open the device, and continue
+retrying for a short period before giving up.
+
+Fixes: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/982889
+
+Signed-off-by: Bryce Harrington <bryce@canonical.com>
+---
+ hw/xfree86/os-support/linux/lnx_platform.c |   29 +++++++++++++++++++++++++---
+ 1 file changed, 26 insertions(+), 3 deletions(-)
+
+--- a/config/udev.c
++++ b/config/udev.c
+@@ -98,7 +98,7 @@
+         if (strncmp(sysname, "card", 4) != 0)
+             return;
+ 
+-        LogMessage(X_INFO, "config/udev: Adding drm device (%s)\n", path);
++        LogMessage(X_INFO, "config/udev: Adding drm device (%s) %s %s\n", path, sysname, syspath);
+ 
+         config_udev_odev_setup_attribs(path, syspath, NewGPUDeviceRequest);
+         return;
+@@ -430,11 +430,23 @@
+ #ifdef CONFIG_UDEV_KMS
+ 
+ static Bool
++get_pci_busid(const char *in, char *pci_str)
++{
++    int ret, domain, bus, dev, func;
++    ret = sscanf(in, "/%04x:%02x:%02x.%d/drm/card%*d", &domain, &bus, &dev, &func);
++    if (ret != 4)
++        return FALSE;
++    sprintf(pci_str, "pci:%04x:%02x:%02x.%d", domain, bus, dev, func);
++    return TRUE;
++}
++
++static Bool
+ config_udev_odev_setup_attribs(const char *path, const char *syspath,
+                                config_odev_probe_proc_ptr probe_callback)
+ {
+     struct OdevAttributes *attribs = config_odev_allocate_attribute_list();
+     int ret;
++    const char *platform;
+ 
+     if (!attribs)
+         return FALSE;
+@@ -447,6 +459,33 @@
+     if (ret == FALSE)
+         goto fail;
+ 
++    if (strstr(syspath, "/devices/pci")) {
++        char pci_str[17];
++        const char *end = strstr(syspath, "/drm/card");
++        if (strstr(syspath, "/usb"))
++            ret = config_odev_add_attribute(attribs, ODEV_ATTRIB_BUSID, "");
++        else if (get_pci_busid(end - 13, pci_str))
++            ret = config_odev_add_attribute(attribs, ODEV_ATTRIB_BUSID, pci_str);
++    } else if ((platform = strstr(syspath, "/devices/platform/"))) {
++        /* OMAP relies on this, modesetting doesn't use it */
++        const char *end;
++        platform += 18;
++        end = strchr(platform, '.');
++        if (end) {
++            char *busid;
++            ret = asprintf(&busid, "platform:%.*s:%02li",
++                           (int)(end - platform), platform, strtol(end + 1, NULL, 10));
++            if (ret >= 0) {
++                ret = config_odev_add_attribute(attribs, ODEV_ATTRIB_BUSID, busid);
++                free(busid);
++            }
++            else
++                ret = TRUE;
++        }
++    }
++    if (ret == FALSE)
++        goto fail;
++
+     /* ownership of attribs is passed to probe layer */
+     probe_callback(attribs);
+     return TRUE;
+--- a/hw/xfree86/os-support/linux/lnx_platform.c
++++ b/hw/xfree86/os-support/linux/lnx_platform.c
+@@ -19,44 +19,6 @@
+ 
+ #include "hotplug.h"
+ 
+-static Bool
+-get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index)
+-{
+-    drmSetVersion sv;
+-    char *buf;
+-    int fd;
+-    int err = 0;
+-
+-    fd = open(path, O_RDWR, O_CLOEXEC);
+-    if (fd == -1)
+-        return FALSE;
+-
+-    sv.drm_di_major = 1;
+-    sv.drm_di_minor = 4;
+-    sv.drm_dd_major = -1;       /* Don't care */
+-    sv.drm_dd_minor = -1;       /* Don't care */
+-
+-    err = drmSetInterfaceVersion(fd, &sv);
+-    if (err) {
+-        ErrorF("setversion 1.4 failed: %s\n", strerror(-err));
+-	goto out;
+-    }
+-
+-    /* for a delayed probe we've already added the device */
+-    if (delayed_index == -1) {
+-            xf86_add_platform_device(attribs);
+-            delayed_index = xf86_num_platform_devices - 1;
+-    }
+-
+-    buf = drmGetBusid(fd);
+-    xf86_add_platform_device_attrib(delayed_index,
+-                                    ODEV_ATTRIB_BUSID, buf);
+-    drmFreeBusid(buf);
+-out:
+-    close(fd);
+-    return (err == 0);
+-}
+-
+ Bool
+ xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid)
+ {
+@@ -105,11 +67,6 @@
+     char *dpath;
+     dpath = xf86_get_platform_attrib(index, ODEV_ATTRIB_PATH);
+ 
+-    ret = get_drm_info(attribs, dpath, index);
+-    if (ret == FALSE) {
+-        xf86_remove_platform_device(index);
+-        return;
+-    }
+     ret = xf86platformAddDevice(index);
+     if (ret == -1)
+         xf86_remove_platform_device(index);
+@@ -145,18 +102,12 @@
+ 
+     LogMessage(X_INFO, "xfree86: Adding drm device (%s)\n", path);
+ 
+-    if (!xf86VTOwner()) {
+-            /* if we don't currently own the VT then don't probe the device,
+-               just mark it as unowned for later use */
+-            attribs->unowned = TRUE;
+-            xf86_add_platform_device(attribs);
+-            return;
+-    }
+-
+-    ret = get_drm_info(attribs, path, -1);
+-    if (ret == FALSE)
+-        goto out_free;
++    if (!xf86VTOwner())
++        /* if we don't currently own the VT then don't probe the device,
++           just mark it as unowned for later use */
++        attribs->unowned = TRUE;
+ 
++    xf86_add_platform_device(attribs);
+     return;
+ 
+ out_free:
diff --git a/debian/patches/series b/debian/patches/series
index 8adae10..0351dc2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -51,3 +51,4 @@ disable-rotation-transform-gpuscreens.patch
 pixman-validate.patch
 fix-ftbfs-ppc64el.patch
 xmir.patch
+drm_device_keep_trying.patch


Reply to: