summaryrefslogtreecommitdiff
path: root/dri3
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2018-04-24 16:08:26 -0400
committerAdam Jackson <ajax@redhat.com>2018-04-25 14:51:02 -0400
commit19d006ee3db4b4635ef9ef5c92562f3ffeddb305 (patch)
treec2112c10b8ab0f672b802d6f1a87862eb51ab659 /dri3
parent352a5ac87fd344936b759a5766eb74271e7d295d (diff)
dri3: Clamp to 1.0 if not all screens support 1.2
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'dri3')
-rw-r--r--dri3/dri3_request.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/dri3/dri3_request.c b/dri3/dri3_request.c
index 452b08a87..8b3503611 100644
--- a/dri3/dri3_request.c
+++ b/dri3/dri3_request.c
@@ -32,6 +32,17 @@
#include <protocol-versions.h>
#include <drm_fourcc.h>
+static Bool
+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)
+ return TRUE;
+
+ return FALSE;
+}
+
static int
proc_dri3_query_version(ClientPtr client)
{
@@ -45,6 +56,21 @@ proc_dri3_query_version(ClientPtr client)
};
REQUEST_SIZE_MATCH(xDRI3QueryVersionReq);
+
+ for (int i = 0; i < screenInfo.numScreens; i++) {
+ if (!dri3_screen_can_one_point_two(screenInfo.screens[i])) {
+ rep.minorVersion = 0;
+ break;
+ }
+ }
+
+ for (int i = 0; i < screenInfo.numGPUScreens; i++) {
+ if (!dri3_screen_can_one_point_two(screenInfo.gpuscreens[i])) {
+ rep.minorVersion = 0;
+ break;
+ }
+ }
+
/* From DRI3 proto:
*
* The client sends the highest supported version to the server