xserver: Branch 'master'

Adam Jackson ajax at kemper.freedesktop.org
Mon Mar 19 19:54:26 UTC 2018


 dri3/dri3_request.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit ae5c0dd199a5fbfbdf7a2d6b8c1b28c410289106
Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Tue Mar 13 18:38:49 2018 +0000

    dri3: cap the version returned to the client
    
    As per the protocol, the server should not return version greater than
    the one supported by the client.
    
    Add a spec quote and tweak the numbers accordingly.
    
    Fixes: 563138298868 ("dri3: Add DRI3 extension")
    Cc: Daniel Stone <daniels at collabora.com>
    Cc: Keith Packard <keithp at keithp.com>
    Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/dri3/dri3_request.c b/dri3/dri3_request.c
index 7f3f0d08c..fc258711b 100644
--- a/dri3/dri3_request.c
+++ b/dri3/dri3_request.c
@@ -45,7 +45,19 @@ proc_dri3_query_version(ClientPtr client)
     };
 
     REQUEST_SIZE_MATCH(xDRI3QueryVersionReq);
-    (void) stuff;
+    /* From DRI3 proto:
+     *
+     * The client sends the highest supported version to the server
+     * and the server sends the highest version it supports, but no
+     * higher than the requested version.
+     */
+
+    if (rep.majorVersion > stuff->majorVersion ||
+        rep.minorVersion > stuff->minorVersion) {
+        rep.majorVersion = stuff->majorVersion;
+        rep.minorVersion = stuff->minorVersion;
+    }
+
     if (client->swapped) {
         swaps(&rep.sequenceNumber);
         swapl(&rep.length);


More information about the xorg-commit mailing list