summaryrefslogtreecommitdiff
path: root/src/nv_output.c
diff options
context:
space:
mode:
authorStuart Bennett <stuart@freedesktop.org>2009-05-28 02:18:52 +0100
committerStuart Bennett <stuart@freedesktop.org>2009-05-28 17:12:13 +0100
commit03167483b41f7205dd1efc5b571ec73ec4b3cdb5 (patch)
tree522dbc3a8e98c052d73082249af471f1d2ea6d16 /src/nv_output.c
parentb60c16cdcbeff2d02ea0866dfbb742c3880b7ae4 (diff)
randr12: line length improvements
Diffstat (limited to 'src/nv_output.c')
-rw-r--r--src/nv_output.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/nv_output.c b/src/nv_output.c
index cb3791e..26c08a6 100644
--- a/src/nv_output.c
+++ b/src/nv_output.c
@@ -425,20 +425,27 @@ get_native_mode_from_edid(xf86OutputPtr output, DisplayModePtr edid_modes)
DisplayModePtr mode;
for (i = 0; i < DET_TIMINGS; i++) {
+ struct detailed_timings *dt =
+ &nv_connector->edid->det_mon[i].section.d_timings;
+
if (nv_connector->edid->det_mon[i].type != DT)
continue;
/* Selecting only based on width ok? */
- if (nv_connector->edid->det_mon[i].section.d_timings.h_active > max_h_active) {
- max_h_active = nv_connector->edid->det_mon[i].section.d_timings.h_active;
- max_v_active = nv_connector->edid->det_mon[i].section.d_timings.v_active;
+ if (dt->h_active > max_h_active) {
+ max_h_active = dt->h_active;
+ max_v_active = dt->v_active;
}
}
- if (!max_h_active || !max_v_active) /* what kind of a joke EDID is this? */
- for (i = 0; i < STD_TIMINGS; i++)
- if (nv_connector->edid->timings2[i].hsize > max_h_active) {
- max_h_active = nv_connector->edid->timings2[i].hsize;
- max_v_active = nv_connector->edid->timings2[i].vsize;
+ if (!max_h_active || !max_v_active) /* clearly a joke EDID */
+ for (i = 0; i < STD_TIMINGS; i++) {
+ struct std_timings *st =
+ &nv_connector->edid->timings2[i];
+
+ if (st->hsize > max_h_active) {
+ max_h_active = st->hsize;
+ max_v_active = st->vsize;
}
+ }
if (!max_h_active || !max_v_active) {
NV_ERROR(output->scrn, "EDID too broken to find native mode\n");
return NULL;
@@ -458,7 +465,8 @@ get_native_mode_from_edid(xf86OutputPtr output, DisplayModePtr edid_modes)
break;
}
/* Find the highest refresh mode otherwise. */
- if (!nv_encoder->native_mode || (mode->VRefresh > nv_encoder->native_mode->VRefresh)) {
+ if (!nv_encoder->native_mode ||
+ (mode->VRefresh > nv_encoder->native_mode->VRefresh)) {
if (nv_encoder->native_mode)
xfree(nv_encoder->native_mode);
mode->type |= M_T_PREFERRED;