Browse Source

drm: ignore EDID with really tiny modes.

Some EDIDs lie and report tiny modes that aren't possible. Ignore
these modes.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Adam Jackson 16 years ago
parent
commit
fc43896630
1 changed files with 5 additions and 0 deletions
  1. 5 0
      drivers/gpu/drm/drm_edid.c

+ 5 - 0
drivers/gpu/drm/drm_edid.c

@@ -289,6 +289,11 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
 	struct drm_display_mode *mode;
 	struct drm_display_mode *mode;
 	struct detailed_pixel_timing *pt = &timing->data.pixel_data;
 	struct detailed_pixel_timing *pt = &timing->data.pixel_data;
 
 
+	/* ignore tiny modes */
+	if (((pt->hactive_hi << 8) | pt->hactive_lo) < 64 ||
+	    ((pt->vactive_hi << 8) | pt->hactive_lo) < 64)
+		return NULL;
+
 	if (pt->stereo) {
 	if (pt->stereo) {
 		printk(KERN_WARNING "stereo mode not supported\n");
 		printk(KERN_WARNING "stereo mode not supported\n");
 		return NULL;
 		return NULL;