diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-04-22 18:42:36 -0400 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2009-04-23 11:49:23 -0400 |
commit | 0da80f34b5aa5999d2030ffbc5187328fa4e4ae5 (patch) | |
tree | fdd5f60373d83a06f0f906f73147d2d07b24da61 /src | |
parent | 1a7b982457ead5f21c6e62a409ca0dbf86005607 (diff) |
radeon: minor cleanup and warning fix
Diffstat (limited to 'src')
-rw-r--r-- | src/radeon_crtc.c | 2 | ||||
-rw-r--r-- | src/radeon_cursor.c | 14 | ||||
-rw-r--r-- | src/radeon_pm.c | 14 |
3 files changed, 7 insertions, 23 deletions
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c index a67d3748..51f361d9 100644 --- a/src/radeon_crtc.c +++ b/src/radeon_crtc.c @@ -181,7 +181,7 @@ RADEONComputePLL(RADEONPLLPtr pll, } for (ref_div = min_ref_div; ref_div <= max_ref_div; ++ref_div) { - uint32_t feedback_div, current_freq, error, vco_diff; + uint32_t feedback_div, current_freq = 0, error, vco_diff; uint32_t pll_in = pll->reference_freq / ref_div; uint32_t min_feed_div = pll->min_feedback_div; uint32_t max_feed_div = pll->max_feedback_div+1; diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c index 30bee508..980b81f4 100644 --- a/src/radeon_cursor.c +++ b/src/radeon_cursor.c @@ -194,6 +194,7 @@ void radeon_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y) { ScrnInfoPtr pScrn = crtc->scrn; + RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private; int crtc_id = radeon_crtc->crtc_id; RADEONInfoPtr info = RADEONPTR(pScrn); @@ -208,9 +209,7 @@ radeon_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y) if (yorigin >= CURSOR_HEIGHT) yorigin = CURSOR_HEIGHT - 1; if (IS_AVIVO_VARIANT) { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int w = CURSOR_WIDTH; - int i; /* avivo cursor spans the full fb width */ if (crtc->rotatedData == NULL) { @@ -218,15 +217,8 @@ radeon_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y) y += crtc->y; } - for (i = 0; i < xf86_config->num_crtc; i++) { - xf86CrtcPtr crtc = xf86_config->crtc[i]; - RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private; - - if (!radeon_crtc->enabled) - break; - } - - if (i == xf86_config->num_crtc) { + if (pRADEONEnt->Controller[0]->enabled && + pRADEONEnt->Controller[1]->enabled) { int cursor_end, frame_end; cursor_end = x - xorigin + w; diff --git a/src/radeon_pm.c b/src/radeon_pm.c index faf7af9c..5267fbc3 100644 --- a/src/radeon_pm.c +++ b/src/radeon_pm.c @@ -798,18 +798,10 @@ void RADEONPMFini(ScrnInfoPtr pScrn) void RADEONPMBlockHandler(ScrnInfoPtr pScrn) { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - int i; - - for (i = 0; i < xf86_config->num_crtc; i++) { - xf86CrtcPtr crtc = xf86_config->crtc[i]; - RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private; - - if (radeon_crtc->enabled) - break; - } + RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); - if (i == xf86_config->num_crtc) + if ((!pRADEONEnt->Controller[0]->enabled) && + (!pRADEONEnt->Controller[1]->enabled)) RADEONSetStaticPowerMode(pScrn, POWER_LOW); else RADEONSetStaticPowerMode(pScrn, POWER_HIGH); |