diff options
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c')
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c index 14e689239..b2dc24dcf 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c @@ -20,9 +20,8 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c,v 1.3 2000/12/02 15:30:57 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c,v 1.5 2001/05/16 06:48:11 keithp Exp $ */ -#define PSZ 8 #include "xf86.h" #include "xf86_OSproc.h" #include "xf86_ansic.h" @@ -31,13 +30,11 @@ #include "mibstore.h" #include "micmap.h" -#include "cfb.h" -#undef PSZ -#include "cfb32.h" +#include "fb.h" #include "xf86cmap.h" #include "tcx.h" -static OptionInfoPtr TCXAvailableOptions(int chipid, int busid); +static const OptionInfoRec * TCXAvailableOptions(int chipid, int busid); static void TCXIdentify(int flags); static Bool TCXProbe(DriverPtr drv, int flags); static Bool TCXPreInit(ScrnInfoPtr pScrn, int flags); @@ -91,7 +88,7 @@ typedef enum { OPTION_HW_CURSOR } TCXOpts; -static OptionInfoRec TCXOptions[] = { +static const OptionInfoRec TCXOptions[] = { { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } @@ -175,8 +172,7 @@ TCXFreeRec(ScrnInfoPtr pScrn) return; } -static -OptionInfoPtr +static const OptionInfoRec * TCXAvailableOptions(int chipid, int busid) { return TCXOptions; @@ -374,7 +370,10 @@ TCXPreInit(ScrnInfoPtr pScrn, int flags) /* Collect all of the relevant option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, TCXOptions); + if (!(pTcx->Options = xalloc(sizeof(TCXOptions)))) + return FALSE; + memcpy(pTcx->Options, TCXOptions, sizeof(TCXOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pTcx->Options); /* * This must happen after pScrn->display has been set because @@ -420,9 +419,9 @@ TCXPreInit(ScrnInfoPtr pScrn, int flags) if (hwCursor) { from = X_DEFAULT; pTcx->HWCursor = TRUE; - if (xf86GetOptValBool(TCXOptions, OPTION_HW_CURSOR, &pTcx->HWCursor)) + if (xf86GetOptValBool(pTcx->Options, OPTION_HW_CURSOR, &pTcx->HWCursor)) from = X_CONFIG; - if (xf86ReturnOptValBool(TCXOptions, OPTION_SW_CURSOR, FALSE)) { + if (xf86ReturnOptValBool(pTcx->Options, OPTION_SW_CURSOR, FALSE)) { from = X_CONFIG; pTcx->HWCursor = FALSE; } @@ -431,8 +430,7 @@ TCXPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pTcx->HWCursor ? "HW" : "SW"); - if (xf86LoadSubModule(pScrn, pScrn->depth > 8 ? "cfb32" : "cfb") == - NULL) { + if (xf86LoadSubModule(pScrn, "fb") == NULL) { TCXFreeRec(pScrn); return FALSE; } @@ -537,25 +535,26 @@ TCXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; + miSetPixmapDepths (); + /* * Call the framebuffer layer's ScreenInit function, and fill in other * pScreen fields. */ - if (pScrn->depth == 8) - ret = cfbScreenInit(pScreen, pTcx->fb, pScrn->virtualX, - pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, - pScrn->virtualX); - else { + if (pScrn->bitsPerPixel != 8) TCXInitCplane24(pScrn); - ret = cfb32ScreenInit(pScreen, pTcx->fb, pScrn->virtualX, - pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, - pScrn->virtualX); - } + ret = fbScreenInit(pScreen, pTcx->fb, pScrn->virtualX, + pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, + pScrn->virtualX, pScrn->bitsPerPixel); if (!ret) return FALSE; +#ifdef RENDER + fbPictureInit (pScreen, 0, 0); +#endif + miInitializeBackingStore(pScreen); xf86SetBackingStore(pScreen); xf86SetSilkenMouse(pScreen); |