xserver: Branch 'master' - 2 commits

Adam Jackson ajax at kemper.freedesktop.org
Mon Jul 31 14:57:51 UTC 2017


 hw/xfree86/common/xf86Configure.c       |   11 +++++------
 hw/xfree86/drivers/modesetting/driver.c |   10 ++++------
 2 files changed, 9 insertions(+), 12 deletions(-)

New commits:
commit 3050d277616ef472a24d8ccd24afcbf8e31ed80e
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Jun 27 11:18:48 2017 -0400

    xfree86: Fix X -configure driver sort yet again
    
    There were two bugs here: The comparison function was not stable when
    one or more of the drivers being compared is a fallback, and the last
    driver in the list would never be moved.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 5f9643a52..07d3c6319 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -554,15 +554,15 @@ driver_sort(const void *_l, const void *_r)
     if (left == -1 && right == -1)
 	return strcmp(l, r);
 
-    /* left is a fallback */
-    if (left >= 0)
+    /* left is a fallback, right is not */
+    if (left >= 0 && right == -1)
 	return 1;
 
-    /* right is a fallback */
-    if (right >= 0)
+    /* right is a fallback, left is not */
+    if (right >= 0 && left == -1)
 	return -1;
 
-    /* both are fallbacks, which is worse */
+    /* both are fallbacks, decide which is worse */
     return left - right;
 }
 
@@ -573,7 +573,6 @@ fixup_video_driver_list(const char **drivers)
 
     /* walk to the end of the list */
     for (end = drivers; *end && **end; end++);
-    end--;
 
     qsort(drivers, end - drivers, sizeof(const char *), driver_sort);
 }
commit 6f9939525c31f1f2d8d6c137a46404278384b4bf
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Jun 26 12:43:54 2017 -0400

    modesetting: Fix PCI initialization on non-zero domains
    
    libdrm's busid matching for the legacy three-integer bus string format
    simply ignores the domain number, rather than what we were doing here of
    packing the domain into the bus number. Whatever, just use the existing
    code to build a busid string, since that gets the domain right.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index f371198a9..21e75c762 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -851,13 +851,11 @@ ms_get_drm_master_fd(ScrnInfoPtr pScrn)
 
         PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index);
         if (PciInfo) {
-            BusID = XNFalloc(64);
-            sprintf(BusID, "PCI:%d:%d:%d",
-                    ((PciInfo->domain << 8) | PciInfo->bus),
-                    PciInfo->dev, PciInfo->func);
+            if ((BusID = ms_DRICreatePCIBusID(PciInfo)) != NULL) {
+                ms->fd = drmOpen(NULL, BusID);
+                free(BusID);
+            }
         }
-        ms->fd = drmOpen(NULL, BusID);
-        free(BusID);
     }
     else
 #endif


More information about the xorg-commit mailing list