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 1, 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.

---
 man/radeon.man        | 2 +-
 src/drmmode_display.c | 8 ++++----
 src/radeon_kms.c      | 9 ++++-----
 3 files changed, 9 insertions(+), 10 deletions(-)
man/radeon.man +1 -1
index 44603a5..1d09fc5 100644
@@ -271,7 +271,7 @@ Sea Islands.
 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 and glamor is enabled, otherwise
+if the Xorg version is >= 1.18.3 and glamor is enabled, otherwise
 .B 2 for DRI2. Note:
 DRI3 may not work correctly in all cases with EXA, enable at your own risk.
 .TP
src/drmmode_display.c +4 -4
index b95e1c9..28b932e 100644
@@ -667,10 +667,10 @@ drmmode_can_use_hw_cursor(xf86CrtcPtr crtc)
 		return FALSE;
 #endif
 
-#if defined(RADEON_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(RADEON_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
 
src/radeon_kms.c +4 -5
index 872150d..6927f58 100644
@@ -2195,11 +2195,10 @@ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
     }
 #endif
 
-#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,18,3,0,0)
-    value = info->use_glamor;
-#else
-    value = FALSE;
-#endif
+    if (xorgGetVersion() >= XORG_VERSION_NUMERIC(1,18,3,0,0))
+	value = info->use_glamor;
+    else
+	value = FALSE;
     from = X_DEFAULT;
 
     if (!info->r600_shadow_fb) {
Signature · 6 lines
2.10.2

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

A message that is not in the archive (sent off-list or not yet received): 20161101073252.19913-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 6 lines · Michel Dänzer

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.

Quoted 61 lines
---
 man/radeon.man        | 2 +-
 src/drmmode_display.c | 8 ++++----
 src/radeon_kms.c      | 9 ++++-----
 3 files changed, 9 insertions(+), 10 deletions(-)
man/radeon.man +1 -1
index 44603a5..1d09fc5 100644
@@ -271,7 +271,7 @@ Sea Islands.
 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 and glamor is enabled, otherwise
+if the Xorg version is >= 1.18.3 and glamor is enabled, otherwise
 .B 2 for DRI2. Note:
 DRI3 may not work correctly in all cases with EXA, enable at your own risk.
 .TP
src/drmmode_display.c +4 -4
index b95e1c9..28b932e 100644
@@ -667,10 +667,10 @@ drmmode_can_use_hw_cursor(xf86CrtcPtr crtc)
                return FALSE;
 #endif
 
-#if defined(RADEON_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(RADEON_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
 
src/radeon_kms.c +4 -6
index 872150d..6927f58 100644
@@ -2195,11 +2195,10 @@ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
     }
 #endif
 
-#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,18,3,0,0)
-    value = info->use_glamor;
-#else
-    value = FALSE;
-#endif
+    if (xorgGetVersion() >= XORG_VERSION_NUMERIC(1,18,3,0,0))
+       value = info->use_glamor;
+    else
+       value = FALSE;
     from = X_DEFAULT;
 
     if (!info->r600_shadow_fb) {
--

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