Check mode before adding to EDID

main
Alan Hourihane 2008-03-04 17:53:04 +00:00
parent 8bfe29d9e4
commit 1a959a2095
1 changed files with 18 additions and 10 deletions

View File

@ -223,9 +223,11 @@ static int add_established_modes(struct drm_output *output, struct edid *edid)
if (est_bits & (1<<i)) {
struct drm_display_mode *newmode;
newmode = drm_mode_duplicate(dev, &edid_est_modes[i]);
if (newmode) {
drm_mode_probed_add(output, newmode);
modes++;
}
}
return modes;
}
@ -251,9 +253,11 @@ static int add_standard_modes(struct drm_output *output, struct edid *edid)
continue;
newmode = drm_mode_std(dev, &edid->standard_timings[i]);
if (newmode) {
drm_mode_probed_add(output, newmode);
modes++;
}
}
return modes;
}
@ -283,11 +287,13 @@ static int add_detailed_info(struct drm_output *output, struct edid *edid)
if (timing->pixel_clock) {
newmode = drm_mode_detailed(dev, timing);
/* First detailed mode is preferred */
if (newmode) {
if (i == 0 && edid->preferred_timing)
newmode->type |= DRM_MODE_TYPE_PREFERRED;
drm_mode_probed_add(output, newmode);
modes++;
}
continue;
}
@ -312,9 +318,11 @@ static int add_detailed_info(struct drm_output *output, struct edid *edid)
std = &data->data.timings[j];
newmode = drm_mode_std(dev, std);
if (newmode) {
drm_mode_probed_add(output, newmode);
modes++;
}
}
break;
default:
break;