xserver: Branch 'master' - 13 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 28 21:00:32 UTC 2019


 .gitlab-ci.yml                       |   13 +----
 .gitlab-ci/debian-install.sh         |   27 +++++++----
 glamor/glamor_prepare.c              |    2 
 hw/kdrive/ephyr/meson.build          |    2 
 test/meson.build                     |   80 ++++++++++++++++++++++++++++++++++-
 test/scripts/xephyr-glamor-piglit.sh |    9 +++
 test/scripts/xinit-piglit-session.sh |    2 
 test/simple-xinit.c                  |   39 +++++++++++++++--
 8 files changed, 146 insertions(+), 28 deletions(-)

New commits:
commit 3b26b90cb787a14fa5f8bb2033eab8ab6562a9a5
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Mar 25 16:30:18 2019 -0700

    glamor: Fix a compiler warning since the recent OOM fixes.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c
index c1a611f9a..835c4ebea 100644
--- a/glamor/glamor_prepare.c
+++ b/glamor/glamor_prepare.c
@@ -146,8 +146,6 @@ glamor_prep_pixmap_box(PixmapPtr pixmap, glamor_access_t access, BoxPtr box)
 static void
 glamor_fini_pixmap(PixmapPtr pixmap)
 {
-    ScreenPtr                   screen = pixmap->drawable.pScreen;
-    glamor_screen_private       *glamor_priv = glamor_get_screen_private(screen);
     glamor_pixmap_private       *priv = glamor_get_pixmap_private(pixmap);
 
     if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(priv))
commit a63d796ce02ae94a016e6ec027fdf0d4bff68805
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 26 11:30:55 2019 -0700

    gitlab-ci: Build and test glamor using Xephyr.
    
    I keep wanting this when reviewing people's glamor patches.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4d076412b..fdeb432c0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -78,7 +78,7 @@ meson-build-and-test:
         PIGLIT_DIR: /root/piglit
         XTEST_DIR: /root/xts
     script:
-        - meson -Dprefix=/usr build/
+        - meson -Dprefix=/usr -Dxephyr=true build/
         - |
           ninja -C build/ install
           ninja -C build/ test
commit ce5242fa2eef25c9921311480401bda6cd8952be
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 26 13:38:22 2019 -0700

    gitlab-ci: Build and install a current version of rendercheck.
    
    For really testing glamor, we want it installed.  Use master instead
    of whatever version is in repos, because we'll want to update when new
    tests are added.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/.gitlab-ci/debian-install.sh b/.gitlab-ci/debian-install.sh
index 28a2afad4..a17bccff2 100644
--- a/.gitlab-ci/debian-install.sh
+++ b/.gitlab-ci/debian-install.sh
@@ -23,6 +23,12 @@ cd xts
 xvfb-run make -j$(nproc)
 cd ..
 
+git clone https://gitlab.freedesktop.org/xorg/test/rendercheck --depth 1
+cd rendercheck
+meson build
+ninja -C build install
+cd ..
+
 rm -rf piglit/.git xts/.git
 
 echo '[xts]' > piglit/piglit.conf
commit 2a2f0ac3a99f32e6e5cc23003360534400d8f445
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 26 13:35:41 2019 -0700

    gitlab-ci: Make shallow clones of git trees we'll be nuking at the end.
    
    We only check out master, and delete .git when we're done, so save the
    bandwidth.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/.gitlab-ci/debian-install.sh b/.gitlab-ci/debian-install.sh
index ce88f4f3b..28a2afad4 100644
--- a/.gitlab-ci/debian-install.sh
+++ b/.gitlab-ci/debian-install.sh
@@ -15,9 +15,9 @@ apt-get build-dep -y xorg-server
 
 cd /root
 
-git clone https://gitlab.freedesktop.org/mesa/piglit.git
+git clone https://gitlab.freedesktop.org/mesa/piglit.git --depth 1
 
-git clone https://gitlab.freedesktop.org/xorg/test/xts
+git clone https://gitlab.freedesktop.org/xorg/test/xts --depth 1
 cd xts
 ./autogen.sh
 xvfb-run make -j$(nproc)
commit 0dc271690b0841473e442ffbf97464876234a7c8
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 26 13:33:09 2019 -0700

    gitlab-ci: Don't bother building piglit.
    
    We don't use any of piglit's tests, just the framework.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/.gitlab-ci/debian-install.sh b/.gitlab-ci/debian-install.sh
index 814f1ffc6..ce88f4f3b 100644
--- a/.gitlab-ci/debian-install.sh
+++ b/.gitlab-ci/debian-install.sh
@@ -6,8 +6,7 @@ set -o xtrace
 echo 'deb-src https://deb.debian.org/debian testing main' > /etc/apt/sources.list.d/deb-src.list
 apt-get update
 apt-get install -y \
-	meson git ca-certificates ccache cmake automake \
-	autoconf libtool libwaffle-dev \
+	meson git ca-certificates ccache automake autoconf libtool \
 	libxkbcommon-dev python3-mako python3-numpy python3-six \
 	x11-utils x11-xserver-utils xauth xvfb \
         libgl1 libglx-mesa0
@@ -15,13 +14,8 @@ apt-get install -y \
 apt-get build-dep -y xorg-server
 
 cd /root
+
 git clone https://gitlab.freedesktop.org/mesa/piglit.git
-cd piglit
-cmake -G Ninja -DPIGLIT_BUILD_GL_TESTS=OFF -DPIGLIT_BUILD_GLES1_TESTS=OFF \
-    -DPIGLIT_BUILD_GLES2_TESTS=OFF -DPIGLIT_BUILD_GLES3_TESTS=OFF \
-    -DPIGLIT_BUILD_DMA_BUF_TESTS=OFF -DPIGLIT_BUILD_GLX_TESTS=OFF
-ninja
-cd ..
 
 git clone https://gitlab.freedesktop.org/xorg/test/xts
 cd xts
@@ -36,6 +30,6 @@ echo 'path=/root/xts' >> piglit/piglit.conf
 
 find -name \*.a -o -name \*.o | xargs rm
 
-apt-get purge -y git cmake libwaffle-dev libxkbcommon-dev \
+apt-get purge -y git libxkbcommon-dev \
     x11-utils x11-xserver-utils xauth xvfb
 apt-get autoremove -y --purge
commit 8c1dac5f83fba8fcd51f68214c0c5cf5d14ed2a7
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 26 12:58:39 2019 -0700

    gitlab-ci: Install Mesa so we can test glamor.
    
    We need the DRI swrast driver (for GLX in vfb), and also libgl (for
    libepoxy in glamor)
    
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 267dc669c..4d076412b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -18,7 +18,7 @@ variables:
     DEBIAN_VERSION: testing-slim
     DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh'
 
-    DEBIAN_TAG: "2019-03-27"
+    DEBIAN_TAG: "2019-03-27-2"
     IMAGE_LOCAL: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
 
 include:
diff --git a/.gitlab-ci/debian-install.sh b/.gitlab-ci/debian-install.sh
index e8d53eee9..814f1ffc6 100644
--- a/.gitlab-ci/debian-install.sh
+++ b/.gitlab-ci/debian-install.sh
@@ -5,8 +5,13 @@ set -o xtrace
 
 echo 'deb-src https://deb.debian.org/debian testing main' > /etc/apt/sources.list.d/deb-src.list
 apt-get update
-apt-get install -y meson git ca-certificates ccache cmake automake autoconf libtool libwaffle-dev \
-    libxkbcommon-dev python3-mako python3-numpy python3-six x11-utils x11-xserver-utils xauth xvfb
+apt-get install -y \
+	meson git ca-certificates ccache cmake automake \
+	autoconf libtool libwaffle-dev \
+	libxkbcommon-dev python3-mako python3-numpy python3-six \
+	x11-utils x11-xserver-utils xauth xvfb \
+        libgl1 libglx-mesa0
+
 apt-get build-dep -y xorg-server
 
 cd /root
commit 3f3c489e51e1b8a82adee9c7c5942dadf218b70d
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 26 11:06:00 2019 -0700

    test: Trim the Render ops that we test the composite paths on.
    
    We cover all Render ops under the "blend" group, so when we're doing
    the cross products of some formats for the masking operation, skip
    most of the ops (covering just zero, one, and src/dst alpha blend
    factors along with a definitely non-glamor-accelerated one) .
    
    All the tests now complete in <20s of runtime on my skylake.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/test/meson.build b/test/meson.build
index 81f10955b..690298b77 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -8,6 +8,7 @@ piglit_env = environment()
 piglit_env.set('XSERVER_DIR', meson.source_root())
 piglit_env.set('XSERVER_BUILDDIR', meson.build_root())
 
+some_ops = '-o clear,src,dst,over,xor,disjointover'
 rendercheck_tests = [
     ['blend/All/a8r8g8b8', '-t blend -f a8r8g8b8'],
     ['blend/All/x8r8g8b8', '-t blend -f a8r8g8b8,x8r8g8b8'],
@@ -15,13 +16,13 @@ rendercheck_tests = [
     ['blend/Clear', '-t blend -o clear'],
     ['blend/Src', '-t blend -o src'],
     ['blend/Over', '-t blend -o over'],
-    ['composite/All/a8r8g8b8', '-t composite -f a8r8g8b8'],
-    ['composite/All/x8r8g8b8', '-t composite -f a8r8g8b8,x8r8g8b8'],
-    ['composite/All/a2r10g10b10', '-t composite -f a8r8g8b8,a2r10g10b10'],
-    ['ca composite/All/a8r8g8b8', '-t cacomposite -f a8r8g8b8'],
-    ['ca composite/All/a8', '-t cacomposite -f a8r8g8b8,a8'],
-    ['ca composite/All/x8r8g8b8', '-t cacomposite -f a8r8g8b8,x8r8g8b8'],
-    ['ca composite/All/a2r10g10b10', '-t cacomposite -f a8r8g8b8,a2r10g10b10'],
+    ['composite/Some/a8r8g8b8', '-t composite -f a8r8g8b8 ' + some_ops],
+    ['composite/Some/x8r8g8b8', '-t composite -f a8r8g8b8,x8r8g8b8' + some_ops],
+    ['composite/Some/a2r10g10b10', '-t composite -f a8r8g8b8,a2r10g10b10' + some_ops],
+    ['ca composite/Some/a8r8g8b8', '-t cacomposite -f a8r8g8b8' + some_ops],
+    ['ca composite/Some/a8', '-t cacomposite -f a8r8g8b8,a8' + some_ops],
+    ['ca composite/Some/x8r8g8b8', '-t cacomposite -f a8r8g8b8,x8r8g8b8' + some_ops],
+    ['ca composite/Some/a2r10g10b10', '-t cacomposite -f a8r8g8b8,a2r10g10b10' + some_ops],
     ['fill', '-t fill'],
     ['bug7366', '-t bug7366'],
     ['destination coordinates', '-t dcoords'],
commit 58c168ad93d770a3c48cc07daaa8a2acd1c0729d
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 26 10:21:29 2019 -0700

    test: Execute rendercheck tests without using piglit.
    
    This gets us parallelism between rendercheck tests at the cost of
    spinning up more Xvfbs, and nicer logging of the tests that are run.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/test/meson.build b/test/meson.build
index 26503ce0c..81f10955b 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -8,18 +8,93 @@ piglit_env = environment()
 piglit_env.set('XSERVER_DIR', meson.source_root())
 piglit_env.set('XSERVER_BUILDDIR', meson.build_root())
 
+rendercheck_tests = [
+    ['blend/All/a8r8g8b8', '-t blend -f a8r8g8b8'],
+    ['blend/All/x8r8g8b8', '-t blend -f a8r8g8b8,x8r8g8b8'],
+    ['blend/All/a2r10g10b10', '-t blend -f a8r8g8b8,a2r10g10b10'],
+    ['blend/Clear', '-t blend -o clear'],
+    ['blend/Src', '-t blend -o src'],
+    ['blend/Over', '-t blend -o over'],
+    ['composite/All/a8r8g8b8', '-t composite -f a8r8g8b8'],
+    ['composite/All/x8r8g8b8', '-t composite -f a8r8g8b8,x8r8g8b8'],
+    ['composite/All/a2r10g10b10', '-t composite -f a8r8g8b8,a2r10g10b10'],
+    ['ca composite/All/a8r8g8b8', '-t cacomposite -f a8r8g8b8'],
+    ['ca composite/All/a8', '-t cacomposite -f a8r8g8b8,a8'],
+    ['ca composite/All/x8r8g8b8', '-t cacomposite -f a8r8g8b8,x8r8g8b8'],
+    ['ca composite/All/a2r10g10b10', '-t cacomposite -f a8r8g8b8,a2r10g10b10'],
+    ['fill', '-t fill'],
+    ['bug7366', '-t bug7366'],
+    ['destination coordinates', '-t dcoords'],
+    ['source coordinates', '-t scoords'],
+    ['mask coordinates', '-t mcoords'],
+    ['translated source coordinates', '-t tscoords'],
+    ['translated mask coordinates', '-t tmcoords'],
+    ['triangles', '-t triangles'],
+    ['LibreOffice xRGB', '-t libreoffice_xrgb'],
+    ['GTK ARGB vs xBGR', '-t gtk_argb_xbgr'],
+]
+
+rendercheck = find_program('rendercheck', required:false)
+xvfb_args = [
+    xvfb_server.full_path(),
+    '-screen',
+    'scrn',
+    '1280x1024x24',
+  ]
+
 if get_option('xvfb')
-    test('xvfb-piglit', find_program('scripts/xvfb-piglit.sh'),
+    test('XTS',
+        find_program('scripts/xvfb-piglit.sh'),
         env: piglit_env,
         timeout: 1200,
+        suite: 'xvfb'
     )
 
+    if rendercheck.found()
+        foreach rctest: rendercheck_tests
+            test(rctest[0],
+                 simple_xinit,
+                 # Use full_path so people can copy and paste the
+                 # command line from testlog.txt easily.
+                 args: [
+                     rendercheck.path(),
+                     rctest[1].split(' '),
+                     '--',
+                     xvfb_args,
+                 ],
+                 suite: 'xvfb'
+                )
+        endforeach
+    endif
+
     if get_option('xephyr') and build_glamor
-        test('xephyr-glamor',
+        test('XTS',
             find_program('scripts/xephyr-glamor-piglit.sh'),
             env: piglit_env,
             timeout: 1200,
+            suite: 'xephr-glamor',
         )
+
+        if rendercheck.found()
+            foreach rctest: rendercheck_tests
+                test(rctest[0],
+                     simple_xinit,
+                     args: [simple_xinit.full_path(),
+                            rendercheck.path(),
+                            rctest[1].split(' '),
+                            '----',
+                            xephyr_server.full_path(),
+                            '-glamor',
+                            '-glamor-skip-present',
+                            '-schedMax', '2000',
+                            '--',
+                            xvfb_args,
+                           ],
+                     suite: 'xephr-glamor',
+                     timeout: 300,
+                    )
+            endforeach
+        endif
     endif
 endif
 
diff --git a/test/scripts/xinit-piglit-session.sh b/test/scripts/xinit-piglit-session.sh
index b495c96d6..97bf2b9e0 100755
--- a/test/scripts/xinit-piglit-session.sh
+++ b/test/scripts/xinit-piglit-session.sh
@@ -31,5 +31,7 @@ PIGLIT_ARGS="$PIGLIT_ARGS -x xlistfontswithinfo at 4"
 PIGLIT_ARGS="$PIGLIT_ARGS -x xloadqueryfont at 1"
 PIGLIT_ARGS="$PIGLIT_ARGS -x xqueryfont at 1"
 PIGLIT_ARGS="$PIGLIT_ARGS -x xqueryfont at 2"
+# Run as meson unit tests.
+PIGLIT_ARGS="$PIGLIT_ARGS -x rendercheck"
 
 exec ./piglit run xts-render $PIGLIT_ARGS $PIGLIT_RESULTS_DIR
commit 82aab622952197003799d756f06881b2c7df48bc
Author: Eric Anholt <eric at anholt.net>
Date:   Wed Mar 27 09:47:41 2019 -0700

    docker: Stop dumping long-summary and meson test logs in the CI logs.
    
    I've found that it's hard to find the original error in a dump full of
    xserver debug spam for the passing cases, and when I needed to look at
    this I end up using a proper editor on the file from the artifacts
    view anyway.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index eb9087c67..267dc669c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -81,10 +81,4 @@ meson-build-and-test:
         - meson -Dprefix=/usr build/
         - |
           ninja -C build/ install
-          set +e
-          set -x
           ninja -C build/ test
-          status=$?
-          cat build/meson-logs/testlog.txt
-          cat build/test/piglit-results/xvfb/long-summary || :
-          exit $status
commit 05ded049acaa90ba07295f939910c22bb1e10e3a
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 26 13:43:05 2019 -0700

    test: Skip a few tests on glamor that are known to fail on llvmpipe.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/test/scripts/xephyr-glamor-piglit.sh b/test/scripts/xephyr-glamor-piglit.sh
index c16fdc4f3..0458f271b 100755
--- a/test/scripts/xephyr-glamor-piglit.sh
+++ b/test/scripts/xephyr-glamor-piglit.sh
@@ -16,6 +16,15 @@ export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/kdrive/ephyr/Xephyr \
         -schedMax 2000 \
         -screen 1280x1024"
 
+# Tests that currently fail on llvmpipe on CI
+PIGLIT_ARGS="$PIGLIT_ARGS -x xcleararea at 6"
+PIGLIT_ARGS="$PIGLIT_ARGS -x xcleararea at 7"
+PIGLIT_ARGS="$PIGLIT_ARGS -x xclearwindow at 4"
+PIGLIT_ARGS="$PIGLIT_ARGS -x xclearwindow at 5"
+PIGLIT_ARGS="$PIGLIT_ARGS -x xcopyarea at 1"
+
+export PIGLIT_ARGS
+
 $XSERVER_BUILDDIR/test/simple-xinit \
         $XSERVER_DIR/test/scripts/run-piglit.sh \
         -- \
commit 30369c6345250d71ef9ca5b12e4991c601e350c6
Author: Eric Anholt <eric at anholt.net>
Date:   Wed Mar 27 09:45:34 2019 -0700

    gitlab-ci: Add a note about where to manage your containers.
    
    Michel noted that I could do this instead of bumping the tag as I
    developed, so leave that note for the next person.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 52a89ddf0..eb9087c67 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,7 +11,8 @@
 # After merging a change resulting in generating a new image to the main
 # repository, it's recommended to remove the image from the source repository's
 # container registry, so that the image from the main repository's registry
-# will be used there as well.
+# will be used there as well.  You can manage your images on your fork of:
+# https://gitlab.freedesktop.org/xorg/xserver/container_registry
 variables:
     UPSTREAM_REPO: xorg/xserver
     DEBIAN_VERSION: testing-slim
commit 164a37eac2a5e7390f69ce152796df54e2f00d98
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 26 10:59:27 2019 -0700

    simple-xinit: Introduce an escaped "--" argument.
    
    For testing xephyr-glamor on top of Xvfb in CI better, I want to be
    able to make one command line describing the nested server invocation,
    but that means I need to get two simple-xinits to split client/server
    on different "--" arguments.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/hw/kdrive/ephyr/meson.build b/hw/kdrive/ephyr/meson.build
index f8135e914..9e329ba67 100644
--- a/hw/kdrive/ephyr/meson.build
+++ b/hw/kdrive/ephyr/meson.build
@@ -38,7 +38,7 @@ if build_xv
     xephyr_dep += dependency('xcb-xv')
 endif
 
-executable(
+xephyr_server = executable(
     'Xephyr',
     srcs,
     include_directories: [
diff --git a/test/simple-xinit.c b/test/simple-xinit.c
index a80eb9cf5..e85b48092 100644
--- a/test/simple-xinit.c
+++ b/test/simple-xinit.c
@@ -210,7 +210,13 @@ parse_args(int argc, char **argv,
             continue;
         }
 
-        *next_arg = argv[i];
+        /* A sort of escaped "--" argument so we can nest server
+         * invocations for testing.
+         */
+        if (strcmp(argv[i], "----") == 0)
+            *next_arg = (char *)"--";
+        else
+            *next_arg = argv[i];
         next_arg++;
     }
 
commit 29aed56ec72d2e95dba8975eb44f385a5f6ef1ff
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Mar 26 12:26:34 2019 -0700

    simple-xinit: Avoid hanging if the server fails to set up the display fd.
    
    Early fatal errors may leave us with nothing in the displayfd pipe,
    and we'd block forever.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/test/simple-xinit.c b/test/simple-xinit.c
index 26ff12bf7..a80eb9cf5 100644
--- a/test/simple-xinit.c
+++ b/test/simple-xinit.c
@@ -60,6 +60,15 @@ usage(int argc, char **argv)
     exit(1);
 }
 
+static int server_displayfd;
+static const char *server_dead = "server_dead";
+
+static void
+handle_sigchld(int sig)
+{
+    write(server_displayfd, server_dead, strlen(server_dead));
+}
+
 /* Starts the X server, returning its pid. */
 static int
 start_server(char *const *server_args)
@@ -71,6 +80,17 @@ start_server(char *const *server_args)
         exit(1);
     } else if (server_pid != 0) {
         /* Continue along the main process that will exec the client. */
+
+        struct sigaction sa;
+        sa.sa_handler = handle_sigchld;
+        sigemptyset(&sa.sa_mask);
+        sa.sa_flags = SA_RESTART | SA_NOCLDSTOP;
+        if (sigaction(SIGCHLD, &sa, 0) == -1) {
+            fprintf(stderr, "Failed to set up signal handler: %s\n",
+                    strerror(errno));
+            exit(1);
+        }
+
         return server_pid;
     }
 
@@ -84,7 +104,7 @@ start_server(char *const *server_args)
 static int
 get_display(int displayfd)
 {
-    char display_string[10];
+    char display_string[20];
     ssize_t ret;
 
     ret = read(displayfd, display_string, sizeof(display_string) - 1);
@@ -97,6 +117,12 @@ get_display(int displayfd)
      * '\n', but not '\0'.  Cap it and parse the number.
      */
     display_string[ret] = '\0';
+
+    if (strncmp(display_string, server_dead, strlen(server_dead)) == 0) {
+        fprintf(stderr, "Server failed to start before setting up displayfd\n");
+        exit(1);
+    }
+
     return atoi(display_string);
 }
 
@@ -222,7 +248,8 @@ main(int argc, char **argv)
         exit(1);
     }
 
-    parse_args(argc, argv, &client_args, &server_args, displayfd_pipe[1]);
+    server_displayfd = displayfd_pipe[1];
+    parse_args(argc, argv, &client_args, &server_args, server_displayfd);
     server_pid = start_server(server_args);
     display = get_display(displayfd_pipe[0]);
     ret = start_client(client_args, display);


More information about the xorg-commit mailing list