From 80117cad86812c9bd7be65066be33dd8b7d86da3 Mon Sep 17 00:00:00 2001 From: Connor Behan Date: Tue, 1 Dec 2015 20:37:55 -0500 Subject: [PATCH] Do not rely on DDC detection Since an output has no pDDCBus when it is in serial mode, we cannot assume that an EDID detection is always safe. When we have to guess modes like the pre-RandR driver did, there is probably not much pruning to do. Various parts of the driver code indicate that most modes are valid. Signed-off-by: Connor Behan --- src/geode.h | 4 ++++ src/lx_driver.c | 3 --- src/lx_output.c | 10 ++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/geode.h b/src/geode.h index eb61c28..b00dfa7 100644 --- a/src/geode.h +++ b/src/geode.h @@ -114,6 +114,10 @@ the size of the *actual* cursor. */ #define LX_CURSOR_MAX_WIDTH 32 #define LX_CURSOR_MAX_HEIGHT 32 +#define LX_MAX_PITCH 8192 +#define LX_MAX_WIDTH 1940 +#define LX_MAX_HEIGHT 1600 + /* FIXME: Get rid of this from GX */ #define DEBUGMSG(cond, drv_msg) diff --git a/src/lx_driver.c b/src/lx_driver.c index 47f6875..6ffbee9 100644 --- a/src/lx_driver.c +++ b/src/lx_driver.c @@ -59,9 +59,6 @@ /* Bring in VGA functions */ #include "lx_vga.c" -#define LX_MAX_WIDTH 1940 -#define LX_MAX_HEIGHT 1600 - /* Size of the register blocks */ #define LX_GP_REG_SIZE 0x4000 diff --git a/src/lx_output.c b/src/lx_output.c index 40455ce..ad40deb 100644 --- a/src/lx_output.c +++ b/src/lx_output.c @@ -228,13 +228,19 @@ lx_output_get_modes(xf86OutputPtr output) xf86MonPtr mon; DisplayModePtr modes; - if (!(pGeode->Output & OUTPUT_PANEL)) { + if (pGeode->Output & OUTPUT_PANEL) { + modes = xf86DuplicateMode(pGeode->panelMode); + } + else if (lx_output->pDDCBus) { mon = xf86OutputGetEDID(output, lx_output->pDDCBus); xf86OutputSetEDID(output, mon); modes = xf86OutputGetEDIDModes(output); } else { - modes = xf86DuplicateMode(pGeode->panelMode); + modes = xf86GetDefaultModes(); + xf86ValidateModesSize(pScrni, modes, LX_MAX_WIDTH, LX_MAX_HEIGHT, LX_MAX_PITCH); + xf86ValidateModesUserConfig(pScrni, modes); + xf86PruneInvalidModes(pScrni, &modes, FALSE); } return modes; -- 2.6.2