src/via_outputs.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
New commits: commit 802544370dd827ed3488965e39804e3cb630888a Author: Kevin Brace <kevinbr...@gmx.com> Date: Sat Mar 5 19:48:33 2016 -0800 Checking the validity of I2C buses before initializing VGA output The validity of I2C buses is checked before VGA output is registered with X Server. Reported-by: Christopher Havel <laserhaw...@gmail.com> Tested-by: Justin Chevrier <jchevr...@gmail.com> Signed-off-by: Kevin Brace <kevinbr...@gmx.com> diff --git a/src/via_outputs.c b/src/via_outputs.c index 31013a4..d97d585 100644 --- a/src/via_outputs.c +++ b/src/via_outputs.c @@ -913,16 +913,22 @@ via_analog_init(ScrnInfoPtr pScrn) DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered via_analog_init.\n")); - if (pVia->pI2CBus1) { - output = xf86OutputCreate(pScrn, &via_analog_funcs, "VGA-1"); - - output->possible_crtcs = 0x3; - output->possible_clones = 0; - output->interlaceAllowed = TRUE; - output->doubleScanAllowed = FALSE; - pBIOSInfo->analog = output; + if (!pVia->pI2CBus1 || !pVia->pI2CBus2) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "I2C Bus 1 or I2C Bus 2 does not exist.\n"); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Exiting via_analog_init.\n")); + return; } + output = xf86OutputCreate(pScrn, &via_analog_funcs, "VGA-1"); + + output->possible_crtcs = 0x3; + output->possible_clones = 0; + output->interlaceAllowed = TRUE; + output->doubleScanAllowed = FALSE; + pBIOSInfo->analog = output; + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting via_analog_init.\n")); } _______________________________________________ Openchrome-devel mailing list Openchrome-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/openchrome-devel