@@ -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;
}