summaryrefslogtreecommitdiff
path: root/linux-core/drm_edid.c
diff options
context:
space:
mode:
authorJerome Glisse <glisse@freedesktop.org>2008-03-10 23:36:27 +0100
committerJohn Doe <glisse@freedesktop.org>2008-03-10 23:36:27 +0100
commita7e6ca62ad0d9c3c45fd9e1d81b59c2db2d714cf (patch)
tree8f757eeaa2c234af14ca1df515de7810e770ed91 /linux-core/drm_edid.c
parenta7dc4d08b9b4f8fe6fcaa4c778f6dd3718d1e36a (diff)
parent9f19e79f955281b9de393219e4ad9835ffe29c49 (diff)
Merge branch 'modesetting-101' of ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
Diffstat (limited to 'linux-core/drm_edid.c')
-rw-r--r--linux-core/drm_edid.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/linux-core/drm_edid.c b/linux-core/drm_edid.c
index 41aa8f5e..9762567b 100644
--- a/linux-core/drm_edid.c
+++ b/linux-core/drm_edid.c
@@ -223,8 +223,10 @@ 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]);
- drm_mode_probed_add(output, newmode);
- modes++;
+ if (newmode) {
+ drm_mode_probed_add(output, newmode);
+ modes++;
+ }
}
return modes;
@@ -251,8 +253,10 @@ static int add_standard_modes(struct drm_output *output, struct edid *edid)
continue;
newmode = drm_mode_std(dev, &edid->standard_timings[i]);
- drm_mode_probed_add(output, newmode);
- modes++;
+ 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 (i == 0 && edid->preferred_timing)
- newmode->type |= DRM_MODE_TYPE_PREFERRED;
- drm_mode_probed_add(output, newmode);
+ if (newmode) {
+ if (i == 0 && edid->preferred_timing)
+ newmode->type |= DRM_MODE_TYPE_PREFERRED;
+ drm_mode_probed_add(output, newmode);
- modes++;
+ modes++;
+ }
continue;
}
@@ -312,8 +318,10 @@ static int add_detailed_info(struct drm_output *output, struct edid *edid)
std = &data->data.timings[j];
newmode = drm_mode_std(dev, std);
- drm_mode_probed_add(output, newmode);
- modes++;
+ if (newmode) {
+ drm_mode_probed_add(output, newmode);
+ modes++;
+ }
}
break;
default: