diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2009-09-09 22:13:40 -0300 |
---|---|---|
committer | Martin-Éric Racine <q-funk@iki.fi> | 2010-05-29 20:59:06 +0300 |
commit | e9447f5335681a78cf87ebf8c9659a6fecfc9746 (patch) | |
tree | 90f28212c2f1d1ac44ef3b7fcaf1bcc5ac2f190a | |
parent | 3a0e9730634f6894ef57793ae6e072656cd125f0 (diff) |
LX: validate display modes
To avoid using virtual desktop by default we now validate the display
modes.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
-rw-r--r-- | src/lx_output.c | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/src/lx_output.c b/src/lx_output.c index 72e5e2a..beb1634 100644 --- a/src/lx_output.c +++ b/src/lx_output.c @@ -155,15 +155,34 @@ lx_output_mode_valid(xf86OutputPtr output, DisplayModePtr pMode) ScrnInfoPtr pScrni = output->scrn; GeodeRec *pGeode = GEODEPTR(pScrni); - /* No scaling > for modes with > 1024 width */ + /* DCON Panel specific resolution - OLPC's one */ + if (pGeode->Output & (OUTPUT_PANEL | 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) { - if (pGeode->Output & OUTPUT_PANEL) { - if ((pMode->HDisplay != pGeode->panelMode->HDisplay) && - pMode->HDisplay > 1024) - return MODE_BAD; + return MODE_OK; } - 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_BAD; } static Bool |