xserver: Branch 'master' - 3 commits

Adam Jackson ajax at kemper.freedesktop.org
Mon Apr 30 17:59:50 UTC 2018


 dri3/dri3_request.c |   10 +++++++---
 glamor/glamor_egl.c |    2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit e00ada9fbbddf4570fe38c3ceeb922af7afcfd1a
Author: Mario Kleiner <mario.kleiner.de at gmail.com>
Date:   Mon Apr 30 09:06:09 2018 +0200

    glamor: Don't fail in glamor_get_formats if not dmabuf_capable.
    
    If dmabuf_capable is false, because the server "dmabuf_capable"
    debug flag isn't set, treat it as successfull query with zero
    returned formats, instead of failure.
    
    This allows the servers cache_formats_and_modifiers() function
    to cache the fact that formats are not supported during the
    current server generation, instead of pointless retesting at
    every invocation.
    
    Signed-off-by: Mario Kleiner <mario.kleiner.de at gmail.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 9edb50967..c38b02e2b 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -602,7 +602,7 @@ glamor_get_formats(ScreenPtr screen,
     glamor_egl = glamor_egl_get_screen_private(xf86ScreenToScrn(screen));
 
     if (!glamor_egl->dmabuf_capable)
-        return FALSE;
+        return TRUE;
 
     if (!eglQueryDmaBufFormatsEXT(glamor_egl->display, 0, NULL, &num))
         return FALSE;
commit 55db3c9cfc1bc92a53b75b99e8fa49a32d7efe63
Author: Mario Kleiner <mario.kleiner.de at gmail.com>
Date:   Mon Apr 30 09:06:08 2018 +0200

    dri3: Robustly clamp to 1.0 if not all screens support 1.2
    
    Checking for dri3_screen_info_rec.version >= 2 is insufficient,
    as some shipping drivers, e.g., intel-ddx, nouveau-ddx, set the
    version to DRI3_SCREEN_INFO_VERSION, ie. to whatever version the
    installed servers headers define. On server 1.20 that would
    be version 2, but the drivers still don't support the v1.2
    hooks. Make sure all hooks are defined before reporting v1.2.
    
    Also make clamping of reported version to minimum of client
    or server robust against possible future clients with possible
    majorVersion >= 2.0.
    
    Signed-off-by: Mario Kleiner <mario.kleiner.de at gmail.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Cc: Daniel Stone <daniels at collabora.com>

diff --git a/dri3/dri3_request.c b/dri3/dri3_request.c
index 61d3f9d05..e34bebedb 100644
--- a/dri3/dri3_request.c
+++ b/dri3/dri3_request.c
@@ -37,7 +37,10 @@ dri3_screen_can_one_point_two(ScreenPtr screen)
 {
     dri3_screen_priv_ptr dri3 = dri3_screen_priv(screen);
 
-    if (dri3 && dri3->info && dri3->info->version >= 2)
+    if (dri3 && dri3->info && dri3->info->version >= 2 &&
+        dri3->info->pixmap_from_fds && dri3->info->fds_from_pixmap &&
+        dri3->info->get_formats && dri3->info->get_modifiers &&
+        dri3->info->get_drawable_modifiers)
         return TRUE;
 
     return FALSE;
@@ -79,7 +82,8 @@ proc_dri3_query_version(ClientPtr client)
      */
 
     if (rep.majorVersion > stuff->majorVersion ||
-        rep.minorVersion > stuff->minorVersion) {
+        (rep.majorVersion == stuff->majorVersion &&
+         rep.minorVersion > stuff->minorVersion)) {
         rep.majorVersion = stuff->majorVersion;
         rep.minorVersion = stuff->minorVersion;
     }
commit fbc5c5cd532962d2df96a04e5c8cc0d21b47b08a
Author: Mario Kleiner <mario.kleiner.de at gmail.com>
Date:   Mon Apr 30 09:06:07 2018 +0200

    dri3: Fix error handling in dri3_buffer_from_pixmap request.
    
    The old info->fd_from_pixmap() driver hook, which is
    preferentially used in dri3_fd_from_pixmap(), can return
    error codes other than -1, e.g., -EINVAL (-22) on nouveau-ddx.
    
    Not handling the error causes a broken/corrupted X-Connection
    resulting from a failed request.
    
    This fixes failure of sddm-greeter to start up under nouveau-ddx
    with DRI3 enabled and DRI3 protocol version properly clamped
    to 1.0 by the server (see followup patch).
    
    Fixes: 75bba3aedcb0 ("dri3: Use single-FD screen call for single-FD request")
    Signed-off-by: Mario Kleiner <mario.kleiner.de at gmail.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Cc: Daniel Stone <daniels at collabora.com>

diff --git a/dri3/dri3_request.c b/dri3/dri3_request.c
index 8b3503611..61d3f9d05 100644
--- a/dri3/dri3_request.c
+++ b/dri3/dri3_request.c
@@ -255,7 +255,7 @@ proc_dri3_buffer_from_pixmap(ClientPtr client)
     rep.bpp = pixmap->drawable.bitsPerPixel;
 
     fd = dri3_fd_from_pixmap(pixmap, &rep.stride, &rep.size);
-    if (fd == -1)
+    if (fd < 0)
         return BadPixmap;
 
     if (client->swapped) {


More information about the xorg-commit mailing list