From 0abce69f0d826a7ca1a41d963cd4730b6e01c145 Mon Sep 17 00:00:00 2001 From: Matthias Hopf Date: Wed, 18 Apr 2007 17:32:52 +0200 Subject: Fix inconsistent use of Mode lists. Some scans used to only check every second entry, some stopped at the entry before the last entry. Bugzilla #10620 (1), original patch by Lisa Wu @ATI --- src/radeon_display.c | 2 +- src/radeon_modes.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/radeon_display.c b/src/radeon_display.c index d661c17b..ac056483 100644 --- a/src/radeon_display.c +++ b/src/radeon_display.c @@ -776,7 +776,7 @@ static void RADEONUpdatePanelSize(ScrnInfoPtr pScrn) for (j = 0; j < 8; j++) { if ((info->PanelXRes < ddc->timings2[j].hsize) && (info->PanelYRes < ddc->timings2[j].vsize)) { - for (p = pScrn->monitor->Modes; p && p->next; p = p->next->next) { + for (p = pScrn->monitor->Modes; p; p = p->next) { if ((ddc->timings2[j].hsize == p->HDisplay) && (ddc->timings2[j].vsize == p->VDisplay)) { float refresh = diff --git a/src/radeon_modes.c b/src/radeon_modes.c index 372b2edd..6b8577eb 100644 --- a/src/radeon_modes.c +++ b/src/radeon_modes.c @@ -212,7 +212,7 @@ static DisplayModePtr RADEONDDCModes(ScrnInfoPtr pScrn, xf86MonPtr ddc) for (j = 0; j < 8; j++) { if (ddc->timings2[j].hsize == 0 || ddc->timings2[j].vsize == 0) continue; - for (p = pScrn->monitor->Modes; p && p->next; p = p->next) { + for (p = pScrn->monitor->Modes; p; p = p->next) { /* Ignore all double scan modes */ if (p->Flags & V_DBLSCAN) continue; @@ -248,7 +248,7 @@ static DisplayModePtr RADEONDDCModes(ScrnInfoPtr pScrn, xf86MonPtr ddc) tmp = (ddc->timings1.t1 << 8) | ddc->timings1.t2; for (j = 0; j < 16; j++) { if (tmp & (1 << j)) { - for (p = pScrn->monitor->Modes; p && p->next; p = p->next) { + for (p = pScrn->monitor->Modes; p; p = p->next) { /* Ignore all double scan modes */ if (p->Flags & V_DBLSCAN) continue; @@ -560,7 +560,7 @@ int RADEONValidateFPModes(ScrnInfoPtr pScrn, char **ppModeName) } /* add in all default vesa modes smaller than panel size, used for randr*/ - for (p = pScrn->monitor->Modes; p && p->next; p = p->next->next) { + for (p = pScrn->monitor->Modes; p; p = p->next) { if ((p->HDisplay <= info->PanelXRes) && (p->VDisplay <= info->PanelYRes)) { tmp = first; while (tmp) { -- cgit v1.2.3