xserver: Branch 'master'

Adam Jackson ajax at kemper.freedesktop.org
Mon Mar 19 19:48:16 UTC 2018


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

New commits:
commit 6a5d51e0823b43280e3646b7a0c919a3b76146ea
Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Mon Mar 19 16:04:43 2018 +0000

    present: 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: 5c5c1b77982 ("present: Add Present extension")
    Cc: Thierry Reding <treding at nvidia.com>
    Cc: Daniel Stone <daniels at collabora.com>
    Cc: Keith Packard <keithp at keithp.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

diff --git a/present/present_request.c b/present/present_request.c
index c6afe5fa7..f52efa52b 100644
--- a/present/present_request.c
+++ b/present/present_request.c
@@ -41,7 +41,19 @@ proc_present_query_version(ClientPtr client)
     };
 
     REQUEST_SIZE_MATCH(xPresentQueryVersionReq);
-    (void) stuff;
+    /* From presentproto:
+     *
+     * 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