diff options
author | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-01-08 15:23:59 -0500 |
---|---|---|
committer | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-01-08 15:23:59 -0500 |
commit | cb69ce0f54569c68c79173e144c3c90e46e64f8b (patch) | |
tree | d4f1653568d44bdfdc71f8f6b7dc7e7b681941d8 | |
parent | c4f21aaaaf6d101e7c8828e246e06be3ff0591c3 (diff) |
Minor DCON fixes.
Wire up the DCON init to GXPreInit, and set the panel geometry appropriately
if found.
-rw-r--r-- | src/amd.h | 1 | ||||
-rw-r--r-- | src/amd_gx_dcon.c | 15 | ||||
-rw-r--r-- | src/amd_gx_driver.c | 4 |
3 files changed, 14 insertions, 6 deletions
@@ -515,5 +515,6 @@ GX_GeodeOpts; #define DCON_DEFAULT_YRES 900 #define DCON_DEFAULT_BPP 16 #define DCON_DEFAULT_REFRESH 50 +extern Bool gx_dcon_init(ScrnInfoPtr pScrni); #endif /* _AMD_GEODE_H_ */ diff --git a/src/amd_gx_dcon.c b/src/amd_gx_dcon.c index 4bf4c8e..f39f8fb 100644 --- a/src/amd_gx_dcon.c +++ b/src/amd_gx_dcon.c @@ -131,28 +131,31 @@ dcon_avail(void) return cmos_read(440 / 8) & 1; } -void +Bool gx_dcon_init(ScrnInfoPtr pScrni) { - + GeodeRec *pGeode = GEODEPTR(pScrni); int rev = boardrev(pScrni); int i; if (rev == -1) { xf86DrvMsg(pScrni->scrnIndex, X_DEFAULT, "This is not an OLPC board\n"); - return; + return FALSE; } if (dcon_avail() == 0) { xf86DrvMsg(pScrni->scrnIndex, X_DEFAULT, "No DCON is present\n"); - return; + return FALSE; } xf86DrvMsg(pScrni->scrnIndex, X_DEFAULT, "OLPC board revision %s\n", rev == REV_TESTB ? "testB" : "testA"); xf86DrvMsg(pScrni->scrnIndex, X_DEFAULT, "DCON detected.\n"); - /* FIXME: Panel setup should go here */ + /* Panel size setup */ + pGeode->FPBX = DCON_DEFAULT_XRES; + pGeode->FPBY = DCON_DEFAULT_YRES; + /* FIXME: Mode setup should go here */ /* FIXME: Controller setup should go here */ @@ -170,4 +173,6 @@ gx_dcon_init(ScrnInfoPtr pScrni) ((r >> 2) << 16) | ((g >> 1) << 8) | (b >> 2); } } + + return TRUE; } diff --git a/src/amd_gx_driver.c b/src/amd_gx_driver.c index df919ed..7eac3a3 100644 --- a/src/amd_gx_driver.c +++ b/src/amd_gx_driver.c @@ -651,7 +651,9 @@ GXPreInit(ScrnInfoPtr pScrni, int flags) /* Set up the panel */ - if (pGeode->Panel) { + if (gx_dcon_init(pScrni)) { + pGeode->Panel = TRUE; + } else if (pGeode->Panel) { if (panelgeo != NULL) { if (GXGetFPInfo(panelgeo, &pGeode->FPBX, &pGeode->FPBY)) pGeode->Panel = FALSE; |