[PATCH xf86-video-ati] Check Xorg version at runtime instead of build time in two places
Michel Dänzer
michel at daenzer.net
Tue Nov 1 07:32:52 UTC 2016
From: Michel Dänzer <michel.daenzer at amd.com>
This means that all possible paths can be handled as intended, no matter
which Xorg version the driver happened to be compiled against.
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
man/radeon.man | 2 +-
src/drmmode_display.c | 8 ++++----
src/radeon_kms.c | 9 ++++-----
3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/man/radeon.man b/man/radeon.man
index 44603a5..1d09fc5 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -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
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index b95e1c9..28b932e 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -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
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 872150d..6927f58 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -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
More information about the amd-gfx
mailing list