diff options
author | Martin-Éric Racine <q-funk@iki.fi> | 2010-10-28 13:13:09 +0300 |
---|---|---|
committer | Martin-Éric Racine <q-funk@iki.fi> | 2010-10-28 13:13:09 +0300 |
commit | ff091333b506855c17ec8ea5f933026221600be9 (patch) | |
tree | 36595d8fdc0a1a5038f41ac6b5ab5089e82bcdcb | |
parent | fab58e111b6655602b4f739260a01247ff478f35 (diff) |
Revert "Simplify the mode_valid function"
This reverts commit fab58e111b6655602b4f739260a01247ff478f35.
-rw-r--r-- | src/lx_output.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/lx_output.c b/src/lx_output.c index 17634d4..cd1809b 100644 --- a/src/lx_output.c +++ b/src/lx_output.c @@ -152,8 +152,35 @@ lx_output_restore(xf86OutputPtr output) static int lx_output_mode_valid(xf86OutputPtr output, DisplayModePtr pMode) { - /* FIXME: Mode validation code should be placed here for the modes - * that geode can not support */ + ScrnInfoPtr pScrni = output->scrn; + GeodeRec *pGeode = GEODEPTR(pScrni); + + /* DCON Panel specific resolution - OLPC's one */ + if (pGeode->Output & OUTPUT_DCON) { + if (pGeode->panelMode->HDisplay == 1200 && + pGeode->panelMode->VDisplay == 900) + return MODE_OK; + } + + if ((pGeode->Output & OUTPUT_PANEL) && + gfx_is_panel_mode_supported(pGeode->panelMode->HDisplay, + pGeode->panelMode->VDisplay, + pMode->HDisplay, + pMode->VDisplay, + pScrni->bitsPerPixel) != -1) { + + return MODE_OK; + } + + if (gfx_is_display_mode_supported(pMode->HDisplay, + pMode->VDisplay, + pScrni->bitsPerPixel, + GeodeGetRefreshRate(pMode)) != -1) { + return MODE_OK; + } + + if (pMode->type & (M_T_DRIVER | M_T_PREFERRED)) + return MODE_OK; return MODE_OK; } |