diff --git a/SOURCES/0001-xfree86-add-drm-modes-on-non-GTF-panels.patch b/SOURCES/0001-xfree86-add-drm-modes-on-non-GTF-panels.patch new file mode 100644 index 0000000..a10be22 --- /dev/null +++ b/SOURCES/0001-xfree86-add-drm-modes-on-non-GTF-panels.patch @@ -0,0 +1,173 @@ +From 139868f3e82a3e7b7b17f3a5a2e07c4b04d81728 Mon Sep 17 00:00:00 2001 +From: Aaron Ma +Date: Thu, 30 Jul 2020 11:02:39 +0200 +Subject: [PATCH xserver] xfree86: add drm modes on non-GTF panels +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +EDID1.4 replaced GTF Bit with Continuous or Non-Continuous Frequency Display. + +Check the "Display Range Limits Descriptor" for GTF support. +If panel doesn't support GTF, then add gtf modes. + +Otherwise X will only show the modes in "Detailed Timing Descriptor". + +V2: Coding style changes. +V3: Coding style changes, remove unused variate. +V4: remove unused variate. + +BugLink: https://gitlab.freedesktop.org/drm/intel/issues/313 +Signed-off-by: Aaron Ma +Reviewed-by: Adam Jackson +(cherry picked from commit 6a79a737e2c0bc730ee693b4ea4a1530c108be4e) +Signed-off-by: Michel Dänzer +--- + hw/xfree86/ddc/edid.h | 17 +++++++++++- + hw/xfree86/ddc/interpret_edid.c | 27 +++++++++++++++++++ + hw/xfree86/ddc/xf86DDC.h | 3 +++ + .../drivers/modesetting/drmmode_display.c | 2 +- + hw/xfree86/modes/xf86Crtc.c | 3 +-- + 5 files changed, 48 insertions(+), 4 deletions(-) + +diff --git a/hw/xfree86/ddc/edid.h b/hw/xfree86/ddc/edid.h +index 750e4270b..b884d8212 100644 +--- a/hw/xfree86/ddc/edid.h ++++ b/hw/xfree86/ddc/edid.h +@@ -262,6 +262,10 @@ + #define MAX_H (_MAX_H(c) + _MAX_H_OFFSET(c)) + #define _MAX_CLOCK(x) x[9] + #define MAX_CLOCK _MAX_CLOCK(c) ++#define _DEFAULT_GTF(x) (x[10] == 0x00) ++#define DEFAULT_GTF _DEFAULT_GTF(c) ++#define _RANGE_LIMITS_ONLY(x) (x[10] == 0x01) ++#define RANGE_LIMITS_ONLY _RANGE_LIMITS_ONLY(c) + #define _HAVE_2ND_GTF(x) (x[10] == 0x02) + #define HAVE_2ND_GTF _HAVE_2ND_GTF(c) + #define _F_2ND_GTF(x) (x[12] * 2) +@@ -477,6 +481,16 @@ struct detailed_timings { + #define DS_VENDOR 0x101 + #define DS_VENDOR_MAX 0x110 + ++/* ++ * Display range limit Descriptor of EDID version1, reversion 4 ++ */ ++typedef enum { ++ DR_DEFAULT_GTF, ++ DR_LIMITS_ONLY, ++ DR_SECONDARY_GTF, ++ DR_CVT_SUPPORTED = 4, ++} DR_timing_flags; ++ + struct monitor_ranges { + int min_v; + int max_v; +@@ -495,6 +509,7 @@ struct monitor_ranges { + char supported_blanking; + char supported_scaling; + int preferred_refresh; /* in hz */ ++ DR_timing_flags display_range_timing_flags; + }; + + struct whitePoints { +@@ -524,7 +539,7 @@ struct detailed_monitor_section { + Uchar serial[13]; + Uchar ascii_data[13]; + Uchar name[13]; +- struct monitor_ranges ranges; /* 56 */ ++ struct monitor_ranges ranges; /* 60 */ + struct std_timings std_t[5]; /* 80 */ + struct whitePoints wp[2]; /* 32 */ + /* color management data */ +diff --git a/hw/xfree86/ddc/interpret_edid.c b/hw/xfree86/ddc/interpret_edid.c +index 17a8f81c0..19630471c 100644 +--- a/hw/xfree86/ddc/interpret_edid.c ++++ b/hw/xfree86/ddc/interpret_edid.c +@@ -672,6 +672,9 @@ get_monitor_ranges(Uchar * c, struct monitor_ranges *r) + r->max_clock = 0; + if (MAX_CLOCK != 0xff) /* is specified? */ + r->max_clock = MAX_CLOCK * 10 + 5; ++ ++ r->display_range_timing_flags = c[10]; ++ + if (HAVE_2ND_GTF) { + r->gtf_2nd_f = F_2ND_GTF; + r->gtf_2nd_c = C_2ND_GTF; +@@ -751,6 +754,30 @@ validate_version(int scrnIndex, struct edid_version *r) + return TRUE; + } + ++Bool ++gtf_supported(xf86MonPtr mon) ++{ ++ int i; ++ ++ if (!mon) ++ return FALSE; ++ ++ if ((mon->ver.version == 1) && (mon->ver.revision < 4)) { ++ if (mon->features.msc & 0x1) ++ return TRUE; ++ } else { ++ for (i = 0; i < DET_TIMINGS; i++) { ++ struct detailed_monitor_section *det_timing_des = &(mon->det_mon[i]); ++ if (det_timing_des && (det_timing_des->type == DS_RANGES) && ++ (det_timing_des->section.ranges.display_range_timing_flags == DR_DEFAULT_GTF ++ || det_timing_des->section.ranges.display_range_timing_flags == DR_SECONDARY_GTF)) ++ return TRUE; ++ } ++ } ++ ++ return FALSE; ++} ++ + /* + * Returns true if HDMI, false if definitely not or unknown. + */ +diff --git a/hw/xfree86/ddc/xf86DDC.h b/hw/xfree86/ddc/xf86DDC.h +index 7d81ab911..6eb2f0ba2 100644 +--- a/hw/xfree86/ddc/xf86DDC.h ++++ b/hw/xfree86/ddc/xf86DDC.h +@@ -48,6 +48,9 @@ extern _X_EXPORT Bool xf86SetDDCproperties(ScrnInfoPtr pScreen, xf86MonPtr DDC); + extern _X_EXPORT Bool + xf86MonitorIsHDMI(xf86MonPtr mon); + ++extern _X_EXPORT Bool ++gtf_supported(xf86MonPtr mon); ++ + extern _X_EXPORT DisplayModePtr + FindDMTMode(int hsize, int vsize, int refresh, Bool rb); + +diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c +index 59abb6cc7..9dd8c5573 100644 +--- a/hw/xfree86/drivers/modesetting/drmmode_display.c ++++ b/hw/xfree86/drivers/modesetting/drmmode_display.c +@@ -2439,7 +2439,7 @@ drmmode_output_add_gtf_modes(xf86OutputPtr output, DisplayModePtr Modes) + int max_x = 0, max_y = 0; + float max_vrefresh = 0.0; + +- if (mon && GTF_SUPPORTED(mon->features.msc)) ++ if (mon && gtf_supported(mon)) + return Modes; + + if (!has_panel_fitter(output)) +diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c +index 37a45bb3a..17d4ef103 100644 +--- a/hw/xfree86/modes/xf86Crtc.c ++++ b/hw/xfree86/modes/xf86Crtc.c +@@ -1719,11 +1719,10 @@ xf86ProbeOutputModes(ScrnInfoPtr scrn, int maxX, int maxY) + + if (edid_monitor) { + struct det_monrec_parameter p; +- struct disp_features *features = &edid_monitor->features; + struct cea_data_block *hdmi_db; + + /* if display is not continuous-frequency, don't add default modes */ +- if (!GTF_SUPPORTED(features->msc)) ++ if (!gtf_supported(edid_monitor)) + add_default_modes = FALSE; + + p.mon_rec = &mon_rec; +-- +2.26.2 + diff --git a/SPECS/xorg-x11-server.spec b/SPECS/xorg-x11-server.spec index a96c2a0..0c0d307 100644 --- a/SPECS/xorg-x11-server.spec +++ b/SPECS/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.8 -Release: 5%{?gitdate:.%{gitdate}}%{?dist} +Release: 6%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -117,6 +117,7 @@ Patch202: 0001-modesetting-Reduce-glamor-initialization-failed-mess.patch Patch203: 0001-xfree86-Only-switch-to-original-VT-if-it-is-active.patch Patch204: 0001-xwayland-Hold-a-pixmap-reference-in-struct-xwl_prese.patch Patch205: 0001-glamor-Fix-glamor_poly_fill_rect_gl-xRectangle-width.patch +Patch206: 0001-xfree86-add-drm-modes-on-non-GTF-panels.patch BuildRequires: systemtap-sdt-devel BuildRequires: git @@ -560,6 +561,10 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Aug 20 2020 Michel Dänzer - 1.20.8-6 +- xfree86: add drm modes on non-GTF panels + Resolves: #1823461 + * Tue Aug 4 2020 Michel Dänzer - 1.20.8-5 - xwayland: Hold a pixmap reference in struct xwl_present_event Related: #1728684