[Intel-gfx] [PATCH] gfx: Add the default modes for LVDS when no DS_RANGE block is found

yakui.zhao at intel.com yakui.zhao at intel.com
Wed Dec 2 07:51:19 CET 2009


From: Zhao Yakui <yakui.zhao at intel.com>

No DS_RANGE block is found in EDID for LVDS on some laptops. In such case even
when we add the default modes for LVDS, most defaul modes will be removed
after applying range limit check.

Try to add the default modes for LVDS when no DS_RANGE block is found. Then
we will guess the range limit check. The defautl mode won't be removed
by applying range limit check. In such case we had better clear the GTF flag
to avoid that xorg adds the default mode list again.

Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
---
 src/drmmode_display.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index a469f6c..58435bf 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -721,6 +721,13 @@ static int drmmode_output_lvds_edid(xf86OutputPtr output,
 			ranges->max_v = 200;
 			ranges->min_h = 0;
 			ranges->max_h = 200;
+		} else {
+			/* When DS_RANGE block is not found, we will to add the
+			 * default mode list in our driver.
+			 * In such case we will clear the GTF flag to avoid
+			 * that xorg adds the default mode list again.
+			 */
+			edid_mon->features.msc &= ~(0x01);
 		}
 		return 0;
 	}
@@ -796,6 +803,7 @@ drmmode_output_get_modes(xf86OutputPtr output)
 	drmModePropertyPtr props;
 	struct fixed_panel_lvds *p_lvds;
 	drmModeModeInfo *mode_ptr;
+	xf86MonPtr	edid_mon = NULL;
 
 	/* look for an EDID property */
 	for (i = 0; i < koutput->count_props; i++) {
@@ -855,6 +863,14 @@ drmmode_output_get_modes(xf86OutputPtr output)
 			xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
 				"Incorrect KMS mode.\n");
 		drmmode_output_lvds_edid(output, p_lvds);
+		edid_mon = output->MonInfo;
+		if ((edid_mon->features.msc & 0x01) == 0) {
+			/* If the GTF flag is not set, it means that DS_RANGE
+			 * block is found. And we had better add the default
+			 * mode list.
+			 */
+			Modes = xf86ModesAdd(Modes, xf86GetDefaultModes());
+		}
 	}
 	return Modes;
 }
-- 
1.5.4.5




More information about the Intel-gfx mailing list