From e9447f5335681a78cf87ebf8c9659a6fecfc9746 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Wed, 9 Sep 2009 22:13:40 -0300 Subject: LX: validate display modes To avoid using virtual desktop by default we now validate the display modes. Signed-off-by: Otavio Salvador --- src/lx_output.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'src/lx_output.c') 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 -- cgit v1.2.3