From 6263248a0044777a352e4ee7380b4b8f9afd091b Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Wed, 9 May 2007 14:52:00 -0700 Subject: RADEON: - use fixup_mode hook to set RADEON_USE_RMX flag so panel scaling works - use valid_mode hook to prune invalid default modes from list - use adjusted_mode in crtc_mode_set (using adjusted_mode from fixup hook) --- src/radeon_display.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/radeon_display.c b/src/radeon_display.c index 10392093..9a3a87fb 100644 --- a/src/radeon_display.c +++ b/src/radeon_display.c @@ -2288,10 +2288,10 @@ radeon_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, switch (radeon_crtc->crtc_id) { case 0: - RADEONInit2(pScrn, mode, NULL, 1, &info->ModeReg, montype); + RADEONInit2(pScrn, adjusted_mode, NULL, 1, &info->ModeReg, montype); break; case 1: - RADEONInit2(pScrn, NULL, mode, 2, &info->ModeReg, montype); + RADEONInit2(pScrn, NULL, adjusted_mode, 2, &info->ModeReg, montype); break; } @@ -2430,6 +2430,18 @@ radeon_restore(xf86OutputPtr restore) static int radeon_mode_valid(xf86OutputPtr output, DisplayModePtr pMode) { + ScrnInfoPtr pScrn = output->scrn; + RADEONInfoPtr info = RADEONPTR(pScrn); + RADEONOutputPrivatePtr radeon_output = output->driver_private; + DisplayModePtr m; + + if (radeon_output->type != OUTPUT_LVDS) + return MODE_OK; + + if (pMode->HDisplay > info->PanelXRes || + pMode->VDisplay > info->PanelYRes) + return MODE_PANEL; + return MODE_OK; } @@ -2437,8 +2449,18 @@ static Bool radeon_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { - return TRUE; + ScrnInfoPtr pScrn = output->scrn; + RADEONInfoPtr info = RADEONPTR(pScrn); + RADEONOutputPrivatePtr radeon_output = output->driver_private; + + if (radeon_output->type != OUTPUT_LVDS) + return TRUE; + + if (mode->HDisplay < info->PanelXRes || + mode->VDisplay < info->PanelYRes) + adjusted_mode->Flags |= RADEON_USE_RMX; + return TRUE; } static void -- cgit v1.2.3