Skip to contentSkip to conversation

Check Xorg version at runtime instead of build time in two places

PATCH In review Michel Dänzer 2 participants 2 messages Nov 2, 2016 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Check Xorg version at runtime instead of build time in two places

From: Michel Dänzer <[email protected]>

This means that all possible paths can be handled as intended, no matter which Xorg version the driver happened to be compiled against.

(Ported from radeon commit 350a2645a1b127227ff294c0b62d20000d0fd48a)

---
 man/amdgpu.man        | 2 +-
 src/amdgpu_kms.c      | 6 +-----
 src/drmmode_display.c | 8 ++++----
 3 files changed, 6 insertions(+), 10 deletions(-)
man/amdgpu.man +1 -1
index 93244a4..948cd70 100644
@@ -65,7 +65,7 @@ will assign xrandr outputs LVDS and VGA-0 to this instance of the driver.
 Define the maximum level of DRI to enable. Valid values are 2 for DRI2 or 3 for DRI3.
 The default is
 .B 3 for DRI3
-if the driver was compiled for Xorg >= 1.18.3, otherwise
+if the Xorg version is >= 1.18.3, otherwise
 .B 2 for DRI2.
 .TP
 .BI "Option \*qEnablePageFlip\*q \*q" boolean \*q
src/amdgpu_kms.c +1 -5
index acf3a7d..b21cd37 100644
@@ -1713,11 +1713,7 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
 	}
 #endif
 
-#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,18,3,0,0)
-	value = TRUE;
-#else
-	value = FALSE;
-#endif
+	value = xorgGetVersion() >= XORG_VERSION_NUMERIC(1,18,3,0,0);
 	from = X_DEFAULT;
 
 	if (info->use_glamor) {
src/drmmode_display.c +4 -4
index f514866..2d36881 100644
@@ -607,10 +607,10 @@ drmmode_can_use_hw_cursor(xf86CrtcPtr crtc)
 		return FALSE;
 #endif
 
-#if defined(AMDGPU_PIXMAP_SHARING) && \
-	XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(1,18,99,901,0)
-	/* HW cursor not supported with RandR 1.4 multihead */
-	if (!xorg_list_is_empty(&crtc->scrn->pScreen->pixmap_dirty_list))
+#if defined(AMDGPU_PIXMAP_SHARING)
+	/* HW cursor not supported with RandR 1.4 multihead up to 1.18.99.901 */
+	if (xorgGetVersion() <= XORG_VERSION_NUMERIC(1,18,99,901,0) &&
+	    !xorg_list_is_empty(&crtc->scrn->pScreen->pixmap_dirty_list))
 		return FALSE;
 #endif
 
Signature · 6 lines
2.10.2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by Alex Deucher
#2 lore raw
In reply to a message not in the archive
Quoted 8 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel Dänzer
Sent: Tuesday, November 01, 2016 11:44 PM
To: [email protected]
Subject: [PATCH xf86-video-amdgpu] Check Xorg version at runtime instead of build time in two places

Quoted 8 lines

From: Michel Dänzer <[email protected]>

This means that all possible paths can be handled as intended, no matter which Xorg version the driver happened to be compiled against.

(Ported from radeon commit 350a2645a1b127227ff294c0b62d20000d0fd48a)

Quoted 64 lines
---
 man/amdgpu.man        | 2 +-
 src/amdgpu_kms.c      | 6 +-----
 src/drmmode_display.c | 8 ++++----
 3 files changed, 6 insertions(+), 10 deletions(-)
man/amdgpu.man +0 -0
index 93244a4..948cd70 100644
@@ -65,7 +65,7 @@ will assign xrandr outputs LVDS and VGA-0 to this

instance of the driver.
Define the maximum level of DRI to enable. Valid values are 2 for DRI2 or 3
for DRI3.
The default is
.B 3 for DRI3

man/amdgpu.man +1 -1
-if the driver was compiled for Xorg >= 1.18.3, otherwise
+if the Xorg version is >= 1.18.3, otherwise
 .B 2 for DRI2.
 .TP
 .BI "Option \*qEnablePageFlip\*q \*q" boolean \*q
src/amdgpu_kms.c +1 -5
index acf3a7d..b21cd37 100644
@@ -1713,11 +1713,7 @@ Bool
 AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
 	}
 #endif
 
-#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,18,3,0,0)
-	value = TRUE;
-#else
-	value = FALSE;
-#endif
+	value = xorgGetVersion() >= XORG_VERSION_NUMERIC(1,18,3,0,0);
 	from = X_DEFAULT;
 
src/amdgpu_kms.c +0 -0
 	if (info->use_glamor) {
src/drmmode_display.c +2 -4
index f514866..2d36881 100644
@@ -607,10 +607,10 @@ drmmode_can_use_hw_cursor(xf86CrtcPtr crtc)
 		return FALSE;
 #endif
 
-#if defined(AMDGPU_PIXMAP_SHARING) && \
-	XORG_VERSION_CURRENT <=
 XORG_VERSION_NUMERIC(1,18,99,901,0)
-	/* HW cursor not supported with RandR 1.4 multihead */
-	if (!xorg_list_is_empty(&crtc->scrn->pScreen->pixmap_dirty_list))
+#if defined(AMDGPU_PIXMAP_SHARING)
+	/* HW cursor not supported with RandR 1.4 multihead up to

1.18.99.901 */

src/drmmode_display.c +1 -0
+	if (xorgGetVersion() <= XORG_VERSION_NUMERIC(1,18,99,901,0)

&&

src/drmmode_display.c +1 -1
+	    !xorg_list_is_empty(&crtc->scrn->pScreen->pixmap_dirty_list))
 		return FALSE;
 #endif
 
--

2.10.2

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx