From 1f66f6076b4a9eb575c003db04bf40d042c9c9b8 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 2 Feb 2026 16:47:03 +0100 Subject: [PATCH] xfree86: ddc: add xf86Monitor_gtf_supported() replacement for GTF_SUPPORTED() macro that's not a good API isolation at all. Drivers should use that function instead for checking whether the monitor supports GTF. Should be backported to older releases, too - so drivers don't need extra per-Xserver-version tweaks. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/ddc/edid.h | 9 +++++++++ hw/xfree86/ddc/interpret_edid.c | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/hw/xfree86/ddc/edid.h b/hw/xfree86/ddc/edid.h index adc9bf71c9..3845ecc32f 100644 --- a/hw/xfree86/ddc/edid.h +++ b/hw/xfree86/ddc/edid.h @@ -12,6 +12,7 @@ #ifndef _EDID_H_ #define _EDID_H_ +#include #include #ifndef _X_EXPORT @@ -668,4 +669,12 @@ struct cea_ext_body { struct cea_data_block data_collection; }; +/* + * check whether monitor supports Generalized Timing Formula + * + * @param monitor the monitor information structure to check + * @return true if GTF is supported by the monitor + */ +_X_EXPORT bool xf86Monitor_gtf_supported(xf86MonPtr monitor); + #endif /* _EDID_H_ */ diff --git a/hw/xfree86/ddc/interpret_edid.c b/hw/xfree86/ddc/interpret_edid.c index 5e48919724..808cabed44 100644 --- a/hw/xfree86/ddc/interpret_edid.c +++ b/hw/xfree86/ddc/interpret_edid.c @@ -777,3 +777,11 @@ gtf_supported(xf86MonPtr mon) return FALSE; } + +bool xf86Monitor_gtf_supported(xf86MonPtr monitor) +{ + if (!monitor) + return false; + + return GTF_SUPPORTED(monitor->features.msc); +}