xserver: Branch 'server-1.19-branch' - 6 commits

Adam Jackson ajax at kemper.freedesktop.org
Wed Oct 4 19:07:46 UTC 2017


 configure.ac                                     |    1 
 hw/dmx/dmxinit.c                                 |   63 -----------------------
 hw/dmx/input/usb-keyboard.c                      |    3 -
 hw/xfree86/Makefile.am                           |   10 +--
 hw/xfree86/dixmods/Makefile.am                   |    4 -
 hw/xfree86/drivers/modesetting/driver.c          |    5 +
 hw/xfree86/drivers/modesetting/drmmode_display.c |   54 +++++++++++++++++++
 hw/xfree86/xkb/Makefile.am                       |    6 ++
 hw/xfree86/xkb/meson.build                       |   12 ++++
 test/Makefile.am                                 |    2 
 10 files changed, 87 insertions(+), 73 deletions(-)

New commits:
commit 3cea13cc40e2421ebefcf2ee0eb949a7bc4e63fd
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 16 15:44:47 2017 -0400

    dmx: Remove some not-very-interesting debug prints
    
    gcc/glibc think the snprintf in dmxExecOS() might truncate. Yes, it
    might, and we also don't care. Just delete all this.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Acked-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit d6db66811643d3762716f6b144a7358572216a4f)

diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c
index 3d394c52b..24bb875fb 100644
--- a/hw/dmx/dmxinit.c
+++ b/hw/dmx/dmxinit.c
@@ -532,63 +532,6 @@ dmxDisplayInit(DMXScreenInfo * dmxScreen)
     dmxGetPixmapFormats(dmxScreen);
 }
 
-/* If this doesn't compile, just add || defined(yoursystem) to the line
- * below.  This information is to help with bug reports and is not
- * critical. */
-#if !defined(_POSIX_SOURCE)
-static const char *
-dmxExecOS(void)
-{
-    return "";
-}
-#else
-#include <sys/utsname.h>
-static const char *
-dmxExecOS(void)
-{
-    static char buffer[128];
-    static int initialized = 0;
-    struct utsname u;
-
-    if (!initialized++) {
-        memset(buffer, 0, sizeof(buffer));
-        uname(&u);
-        snprintf(buffer, sizeof(buffer) - 1, "%s %s %s",
-                 u.sysname, u.release, u.version);
-    }
-    return buffer;
-}
-#endif
-
-static const char *
-dmxBuildCompiler(void)
-{
-    static char buffer[128];
-    static int initialized = 0;
-
-    if (!initialized++) {
-        memset(buffer, 0, sizeof(buffer));
-#if defined(__GNUC__) && defined(__GNUC_MINOR__) &&defined(__GNUC_PATCHLEVEL__)
-        snprintf(buffer, sizeof(buffer) - 1, "gcc %d.%d.%d",
-                 __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
-#endif
-    }
-    return buffer;
-}
-
-static const char *
-dmxExecHost(void)
-{
-    static char buffer[128];
-    static int initialized = 0;
-
-    if (!initialized++) {
-        memset(buffer, 0, sizeof(buffer));
-        XmuGetHostname(buffer, sizeof(buffer) - 1);
-    }
-    return buffer;
-}
-
 static void dmxAddExtensions(Bool glxSupported)
 {
     const ExtensionModule dmxExtensions[] = {
@@ -641,12 +584,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
         SetVendorRelease(VENDOR_RELEASE);
         SetVendorString(VENDOR_STRING);
 
-        if (dmxGeneration == 1) {
-            dmxLog(dmxInfo, "DMX Build OS:       %s (%s)\n", OSNAME, OSVENDOR);
-            dmxLog(dmxInfo, "DMX Build Compiler: %s\n", dmxBuildCompiler());
-            dmxLog(dmxInfo, "DMX Execution OS:   %s\n", dmxExecOS());
-            dmxLog(dmxInfo, "DMX Execution Host: %s\n", dmxExecHost());
-        }
         dmxLog(dmxInfo, "MAXSCREENS:         %d\n", MAXSCREENS);
 
         for (i = 0; i < dmxNumScreens; i++) {
commit 320e48c9217a8bdcd07dc8ce4aebec043e4afa3c
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Jun 16 15:44:46 2017 -0400

    dmx: Silence an unused-result warning
    
    Modern glibc is very insistent that you care about whether write()
    succeeds:
    
    ../hw/dmx/input/usb-keyboard.c: In function ‘kbdUSBCtrl’:
    ../hw/dmx/input/usb-keyboard.c:292:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
             write(priv->fd, &event, sizeof(event));
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 17ad6e5d5616039021455bc821d6ee2497f7ebde)

diff --git a/hw/dmx/input/usb-keyboard.c b/hw/dmx/input/usb-keyboard.c
index e41ad40eb..b26c822c0 100644
--- a/hw/dmx/input/usb-keyboard.c
+++ b/hw/dmx/input/usb-keyboard.c
@@ -289,7 +289,8 @@ kbdUSBCtrl(DevicePtr pDev, KeybdCtrl * ctrl)
             led = i;
         event.code = led;
         event.value = ! !(ctrl->leds & (1 << led));
-        write(priv->fd, &event, sizeof(event));
+        if (write(priv->fd, &event, sizeof(event)) != sizeof(event))
+            DebugF("Failed to set LEDs!\n");
     }
 }
 
commit c5d409a292008c4219c77a1bdb7621eb0ac42991
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Jun 26 14:54:04 2017 +0100

    Move statically linked xorgxkb files from dixmods to a separate directory
    
    [ajax: Fixed test/Makefile.am as well]
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit fbdd73fac68383c93f6f5c6a7615860503039999)

diff --git a/configure.ac b/configure.ac
index e9167e460..e078f12bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2647,6 +2647,7 @@ hw/xfree86/shadowfb/Makefile
 hw/xfree86/vbe/Makefile
 hw/xfree86/vgahw/Makefile
 hw/xfree86/x86emu/Makefile
+hw/xfree86/xkb/Makefile
 hw/xfree86/utils/Makefile
 hw/xfree86/utils/man/Makefile
 hw/xfree86/utils/cvt/Makefile
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 85bd0bed0..b876b79ab 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -36,13 +36,13 @@ endif
 
 SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \
 	  ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \
-	  $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods \
+	  $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods xkb \
 	  fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man \
 	  $(GLAMOR_EGL_SUBDIR) drivers
 
 DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \
                parser ramdac shadowfb vbe vgahw \
-               loader dixmods dri dri2 exa modes \
+               loader dixmods xkb dri dri2 exa modes \
 	       utils doc man glamor_egl drivers
 
 bin_PROGRAMS = Xorg
@@ -66,7 +66,7 @@ LOCAL_LIBS = \
             ddc/libddc.la \
             i2c/libi2c.la \
             $(XORG_LIBS) \
-            dixmods/libxorgxkb.la \
+            xkb/libxorgxkb.la \
             $(DRI_LIB) \
             $(DRI2_LIB) \
 	    $(DRI3_LIB) \
@@ -148,5 +148,5 @@ i2c/libi2c.la:
 dixmods/libdixmods.la:
 	$(AM_V_at)cd dixmods && $(MAKE) libdixmods.la
 
-dixmods/libxorgxkb.la:
-	$(AM_V_at)cd dixmods && $(MAKE) libxorgxkb.la
+xkb/libxorgxkb.la:
+	$(AM_V_at)cd xkb && $(MAKE) libxorgxkb.la
diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am
index d534c789b..856659f98 100644
--- a/hw/xfree86/dixmods/Makefile.am
+++ b/hw/xfree86/dixmods/Makefile.am
@@ -1,4 +1,4 @@
-noinst_LTLIBRARIES = libdixmods.la libxorgxkb.la
+noinst_LTLIBRARIES = libdixmods.la
 
 if GLX
 GLXMODS = libglx.la
@@ -46,5 +46,3 @@ libshadow_la_SOURCES = shmodule.c
 
 libdixmods_la_SOURCES = $(top_srcdir)/mi/miinitext.c
 libdixmods_la_CFLAGS = $(AM_CFLAGS)
-
-libxorgxkb_la_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c
diff --git a/hw/xfree86/xkb/Makefile.am b/hw/xfree86/xkb/Makefile.am
new file mode 100644
index 000000000..252cf3b5d
--- /dev/null
+++ b/hw/xfree86/xkb/Makefile.am
@@ -0,0 +1,6 @@
+noinst_LTLIBRARIES = libxorgxkb.la
+
+AM_CFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@
+AM_CPPFLAGS = @XORG_INCS@
+
+libxorgxkb_la_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c
diff --git a/hw/xfree86/xkb/meson.build b/hw/xfree86/xkb/meson.build
new file mode 100644
index 000000000..894aa5ca3
--- /dev/null
+++ b/hw/xfree86/xkb/meson.build
@@ -0,0 +1,12 @@
+srcs_xorg_xkb = [
+    'xkbVT.c',
+    'xkbPrivate.c',
+    'xkbKillSrv.c',
+]
+
+xorg_xkb = static_library('xorg_xkb',
+    srcs_xorg_xkb,
+    include_directories: [inc, xorg_inc],
+    dependencies: common_dep,
+    c_args: xorg_c_args,
+)
diff --git a/hw/xfree86/dixmods/xkbKillSrv.c b/hw/xfree86/xkb/xkbKillSrv.c
similarity index 100%
rename from hw/xfree86/dixmods/xkbKillSrv.c
rename to hw/xfree86/xkb/xkbKillSrv.c
diff --git a/hw/xfree86/dixmods/xkbPrivate.c b/hw/xfree86/xkb/xkbPrivate.c
similarity index 100%
rename from hw/xfree86/dixmods/xkbPrivate.c
rename to hw/xfree86/xkb/xkbPrivate.c
diff --git a/hw/xfree86/dixmods/xkbVT.c b/hw/xfree86/xkb/xkbVT.c
similarity index 100%
rename from hw/xfree86/dixmods/xkbVT.c
rename to hw/xfree86/xkb/xkbVT.c
diff --git a/test/Makefile.am b/test/Makefile.am
index 064e1c5b7..dc60057f5 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -81,7 +81,7 @@ libxservertest_la_LIBADD += \
             $(top_builddir)/hw/xfree86/ramdac/libramdac.la \
             $(top_builddir)/hw/xfree86/ddc/libddc.la \
             $(top_builddir)/hw/xfree86/i2c/libi2c.la \
-            $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \
+            $(top_builddir)/hw/xfree86/xkb/libxorgxkb.la \
             $(top_builddir)/Xext/libXvidmode.la \
             @XORG_LIBS@
 
commit 359186b13bc6ea6d8c3340c392c0aba5b9376a5d
Author: Dawid Kurek <dawid.kurek at displaylink.com>
Date:   Thu Jul 6 14:51:11 2017 +0200

    modesetting: Blacklist EVDI devices from PRIME sync
    
    UDL (usb) devices are blacklisted because of they weird behaviour when
    it comes to vblank events. As EVDI uses very similar model of handling
    vblanks it should be treated similarly.
    
    When doing a page flip, EVDI does not wait for real vblank, but
    simulates it by adding constant delay. It also does not support
    DRM_IOCTL_WAIT_VBLANK.
    
    In contrast to UDL, EVDI uses platform devices, thus instead of 'usb' in
    path they all have 'platform'.
    
    It is possible to blacklist by 'platform', so without explicitly saying
    'evdi', but it might be misleading when it comes to real reason for it.
    
    Signed-off-by: Dawid Kurek <dawid.kurek at displaylink.com>
    (cherry picked from commit fbd80b2c8ebe9fd41229dc5438524d107c071ff1)

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 3da69a396..4d5c4e339 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -1202,6 +1202,11 @@ msEnableSharedPixmapFlipping(RRCrtcPtr crtc, PixmapPtr front, PixmapPtr back)
          * vblank events */
         if (syspath && strstr(syspath, "usb"))
             return FALSE;
+
+        /* EVDI uses USB transport but is platform device, not usb.
+         * Blacklist it explicitly */
+        if (syspath && strstr(syspath, "evdi"))
+            return FALSE;
     }
 #endif
 
commit 5571318f22f17883e26977a4c72e1e46d17bdf5d
Author: Keith Packard <keithp at keithp.com>
Date:   Mon Sep 25 16:18:22 2017 -0700

    modesetting: Skip no-longer-present connectors when resetting BAD links
    
    Outputs may have NULL mode_output (connector) pointers if the
    connector disappears while the server is running. Skip these when
    resetting outputs with BAD link status.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit 37f4e7651a2fd51efa613a08a1e705553be33e76)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 6236fb0b6..53e1cf545 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -2298,9 +2298,12 @@ drmmode_handle_uevents(int fd, void *closure)
     for (i = 0; i < config->num_output; i++) {
         xf86OutputPtr output = config->output[i];
         drmmode_output_private_ptr drmmode_output = output->driver_private;
-        uint32_t con_id = drmmode_output->mode_output->connector_id;
+        uint32_t con_id;
         drmModeConnectorPtr koutput;
 
+        if (drmmode_output->mode_output == NULL)
+            continue;
+        con_id = drmmode_output->mode_output->connector_id;
         /* Get an updated view of the properties for the current connector and
          * look for the link-status property
          */
commit 787655d5df0c8c43e5e424af3e6e35b8daf54a7d
Author: Martin Peres <martin.peres at linux.intel.com>
Date:   Mon Apr 10 16:48:21 2017 +0300

    modesetting: re-set the crtc's mode when link-status goes BAD
    
    Despite all the careful planning of the kernel, a link may become
    insufficient to handle the currently-set mode. At this point, the
    kernel should mark this particular configuration as being broken
    and potentially prune the mode before setting the offending connector's
    link-status to BAD and send the userspace a hotplug event. This may
    happen right after a modeset or later on.
    
    Upon receiving a hot-plug event, we iterate through the connectors to
    re-apply the currently-set mode on all the connectors that have a
    link-status property set to BAD. The kernel may be able to get the
    link to work by dropping to using a lower link bpp (with the same
    display bpp). However, the modeset may fail if the kernel has pruned
    the mode, so to make users aware of this problem a warning is outputed
    in the logs to warn about having a potentially-black display.
    
    This patch does not modify the current behaviour of always propagating
    the events to the randr clients. This allows desktop environments to
    re-probe the connectors and select a new resolution based on the new
    (currated) mode list if a mode disapeared. This behaviour is expected in
    order to pass the Display Port compliance tests.
    
    Signed-off-by: Martin Peres <martin.peres at linux.intel.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>
    (cherry picked from commit bcee1b76aa0db8525b491485e90b8740763d7de6)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 415c1b38d..6236fb0b6 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -2263,6 +2263,10 @@ drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
 }
 
 #ifdef CONFIG_UDEV_KMS
+
+#define DRM_MODE_LINK_STATUS_GOOD       0
+#define DRM_MODE_LINK_STATUS_BAD        1
+
 static void
 drmmode_handle_uevents(int fd, void *closure)
 {
@@ -2282,6 +2286,49 @@ drmmode_handle_uevents(int fd, void *closure)
     if (!found)
         return;
 
+    /* Try to re-set the mode on all the connectors with a BAD link-state:
+     * This may happen if a link degrades and a new modeset is necessary, using
+     * different link-training parameters. If the kernel found that the current
+     * mode is not achievable anymore, it should have pruned the mode before
+     * sending the hotplug event. Try to re-set the currently-set mode to keep
+     * the display alive, this will fail if the mode has been pruned.
+     * In any case, we will send randr events for the Desktop Environment to
+     * deal with it, if it wants to.
+     */
+    for (i = 0; i < config->num_output; i++) {
+        xf86OutputPtr output = config->output[i];
+        drmmode_output_private_ptr drmmode_output = output->driver_private;
+        uint32_t con_id = drmmode_output->mode_output->connector_id;
+        drmModeConnectorPtr koutput;
+
+        /* Get an updated view of the properties for the current connector and
+         * look for the link-status property
+         */
+        koutput = drmModeGetConnectorCurrent(drmmode->fd, con_id);
+        for (j = 0; koutput && j < koutput->count_props; j++) {
+            drmModePropertyPtr props;
+            props = drmModeGetProperty(drmmode->fd, koutput->props[j]);
+            if (props && props->flags & DRM_MODE_PROP_ENUM &&
+                !strcmp(props->name, "link-status") &&
+                koutput->prop_values[j] == DRM_MODE_LINK_STATUS_BAD) {
+                xf86CrtcPtr crtc = output->crtc;
+                if (!crtc)
+                    continue;
+
+                /* the connector got a link failure, re-set the current mode */
+                drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation,
+                                       crtc->x, crtc->y);
+
+                xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+                           "hotplug event: connector %u's link-state is BAD, "
+                           "tried resetting the current mode. You may be left"
+                           "with a black screen if this fails...\n", con_id);
+            }
+            drmModeFreeProperty(props);
+        }
+        drmModeFreeConnector(koutput);
+    }
+
     mode_res = drmModeGetResources(drmmode->fd);
     if (!mode_res)
         goto out;
@@ -2346,6 +2393,10 @@ out_free_res:
 out:
     RRGetInfo(xf86ScrnToScreen(scrn), TRUE);
 }
+
+#undef DRM_MODE_LINK_STATUS_BAD
+#undef DRM_MODE_LINK_STATUS_GOOD
+
 #endif
 
 void


More information about the xorg-commit mailing list