[Intel-gfx] [PATCH] gfx: update the mmheight/mmwidth again after parsing EDID

yakui.zhao at intel.com yakui.zhao at intel.com
Tue Oct 20 08:31:47 CEST 2009

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

Sometimes the display mmheight/mmwidth defined in EDID detailed timing block
is incorrect for some monitors. After calling the function of xf86OutputSetEDID,
it will update the height/midth for the corresponding output by using the value
defined in detailed timing. In such case it will cause that the dpi is
also incorrect, which causes that font is displayed incorrectly.
   For example:
     The height/width in EDID detailed timing block is :289 x 21 mm
     But the height/wdith about monitor size is 330 x 210 mm.

So after calling the function of xf86OutputSetEDID, Update the height/width
again by using the output info, which is obtained in course of output detection.


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

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 3417cab..626ca1d 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -783,7 +783,14 @@ static int drmmode_output_lvds_edid(xf86OutputPtr output,
 	output->MonInfo = edid_mon;
 	return 0;
+static void drmmode_update_output(xf86OutputPtr output)
+	drmmode_output_private_ptr drmmode_output = output->driver_private;
+	drmModeConnectorPtr koutput = drmmode_output->mode_output;
+	output->mm_width = koutput->mmWidth;
+	output->mm_height = koutput->mmHeight;
 static DisplayModePtr
 drmmode_output_get_modes(xf86OutputPtr output)
@@ -824,6 +831,7 @@ drmmode_output_get_modes(xf86OutputPtr output)
+	drmmode_update_output(output);
 	/* modes should already be available */
 	for (i = 0; i < koutput->count_modes; i++) {
 		Mode = xnfalloc(sizeof(DisplayModeRec));

More information about the Intel-gfx mailing list