From 755b08bd59a5ff968040d657401c0779ba7828d0 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Sat, 3 Oct 2009 14:46:52 -0300 Subject: GX: refactory mode validation code to be easier to ready Signed-off-by: Otavio Salvador --- src/gx_driver.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/gx_driver.c b/src/gx_driver.c index 7ff5418..1c25e1a 100644 --- a/src/gx_driver.c +++ b/src/gx_driver.c @@ -1412,7 +1412,7 @@ GXValidMode(int scrnIndex, DisplayModePtr pMode, Bool Verbose, int flags) { ScrnInfoPtr pScrni = xf86Screens[scrnIndex]; GeodeRec *pGeode = GEODEPTR(pScrni); - int p, ret; + int p; int custom = 0; if (pGeode->Panel) @@ -1422,23 +1422,24 @@ GXValidMode(int scrnIndex, DisplayModePtr pMode, Bool Verbose, int flags) /* Use the durango lookup for !custom modes */ - if (!custom) { - if (pGeode->Panel) { - if (pMode->CrtcHDisplay > pGeode->PanelX || - pMode->CrtcVDisplay > pGeode->PanelY || - gfx_is_panel_mode_supported(pGeode->PanelX, pGeode->PanelY, - pMode->CrtcHDisplay, pMode->CrtcVDisplay, - pScrni->bitsPerPixel) < 0) { - - return MODE_BAD; - } - } + if (!custom && pGeode->Panel) { + if (pMode->CrtcHDisplay > pGeode->PanelX || + pMode->CrtcVDisplay > pGeode->PanelY || + gfx_is_panel_mode_supported(pGeode->PanelX, + pGeode->PanelY, + pMode->CrtcHDisplay, + pMode->CrtcVDisplay, + pScrni->bitsPerPixel) < 0) { + + return MODE_BAD; + } + } - ret = gfx_is_display_mode_supported(pMode->CrtcHDisplay, - pMode->CrtcVDisplay, - pScrni->bitsPerPixel, GeodeGetRefreshRate(pMode)); - if (ret < 0) - return MODE_BAD; + if (gfx_is_display_mode_supported(pMode->CrtcHDisplay, + pMode->CrtcVDisplay, + pScrni->bitsPerPixel, + GeodeGetRefreshRate(pMode)) < 0) { + return MODE_BAD; } if (pMode->Flags & V_INTERLACE) -- cgit v1.2.3