From e1921f014b102e3eecf3b41972f8672cf23264d6 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 10 Aug 2006 20:43:15 -0400 Subject: [PATCH 1/2] Rename some mode tokens to better reflect their use. Per #5386, M_T_EDID -> M_T_DRIVER, since it's really for any driver-detected mode. Also add M_T_PREFERRED bit, to select a 'best' mode out of a set. --- hw/xfree86/common/xf86str.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h index 0c33afba2a..ae9d9aef4f 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h @@ -119,14 +119,19 @@ typedef enum { MODE_ERROR = -1 /* error condition */ } ModeStatus; +/* + * The mode sets are, from best to worst: USERDEF, DRIVER, and DEFAULT/BUILTIN. + * Preferred will bubble a mode to the top within a set. + */ # define M_T_BUILTIN 0x01 /* built-in mode */ # define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */ # define M_T_CRTC_C (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC */ # define M_T_CLOCK_CRTC_C (M_T_CLOCK_C | M_T_CRTC_C) /* built-in mode - configure CRTC and clock */ +# define M_T_PREFERRED 0x08 /* preferred mode within a set */ # define M_T_DEFAULT 0x10 /* (VESA) default modes */ # define M_T_USERDEF 0x20 /* One of the modes from the config file */ -# define M_T_EDID 0x40 /* Mode from the EDID info from the monitor */ +# define M_T_DRIVER 0x40 /* Supplied by the driver (EDID, etc) */ /* Video mode */ typedef struct _DisplayModeRec { From c4951e0a6b6cf3eeee710cc5cda1d9bc929ee3d7 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 10 Aug 2006 20:49:06 -0400 Subject: [PATCH 2/2] Fix a mode sanity check to not break reduced-blanking setups (LCDs). --- hw/xfree86/common/xf86Mode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c index b892e3e6a1..72dd1cabb9 100644 --- a/hw/xfree86/common/xf86Mode.c +++ b/hw/xfree86/common/xf86Mode.c @@ -1758,7 +1758,8 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, * horizontal timing parameters that CRTs may have * problems with. */ - if ((q->type & M_T_DEFAULT) && + if (!scrp->monitor->reducedblanking && + (q->type & M_T_DEFAULT) && ((double)q->HTotal / (double)q->HDisplay) < 1.15) continue;