diff options
author | Kevin Brace <kevinbrace@gmx.com> | 2018-06-03 01:43:38 -0500 |
---|---|---|
committer | Connor Behan <connor.behan@gmail.com> | 2018-06-11 00:50:45 -0400 |
commit | 3c2a02971b423359747d328e1ce16e6f4f800d9a (patch) | |
tree | eca477980718998e95d9c3650b47059ad573ce97 /src/r128_driver.c | |
parent | 56ff44e0afd4d11d9a9daa4efd3031733b14d464 (diff) |
Move assignment of color depth variables away from R128PreInitVisual
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
Diffstat (limited to 'src/r128_driver.c')
-rw-r--r-- | src/r128_driver.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/r128_driver.c b/src/r128_driver.c index 347c804..8bfa784 100644 --- a/src/r128_driver.c +++ b/src/r128_driver.c @@ -643,8 +643,6 @@ static Bool R128GetPLLParameters(ScrnInfoPtr pScrn) /* This is called by R128PreInit to set up the default visual. */ static Bool R128PreInitVisual(ScrnInfoPtr pScrn) { - R128InfoPtr info = R128PTR(pScrn); - if (!xf86SetDepthBpp(pScrn, 0, 0, 0, (Support24bppFb | Support32bppFb | SupportConvert32to24 @@ -666,23 +664,6 @@ static Bool R128PreInitVisual(ScrnInfoPtr pScrn) xf86PrintDepthBpp(pScrn); - info->fifo_slots = 0; - info->pix24bpp = xf86GetBppFromDepth(pScrn, pScrn->depth); - info->CurrentLayout.bitsPerPixel = pScrn->bitsPerPixel; - info->CurrentLayout.depth = pScrn->depth; - info->CurrentLayout.pixel_bytes = pScrn->bitsPerPixel / 8; - info->CurrentLayout.pixel_code = (pScrn->bitsPerPixel != 16 - ? pScrn->bitsPerPixel - : pScrn->depth); - - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Pixel depth = %d bits stored in %d byte%s (%d bpp pixmaps)\n", - pScrn->depth, - info->CurrentLayout.pixel_bytes, - info->CurrentLayout.pixel_bytes > 1 ? "s" : "", - info->pix24bpp); - - if (!xf86SetDefaultVisual(pScrn, -1)) return FALSE; if (pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) { @@ -1310,6 +1291,22 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags) goto fail; } + info->fifo_slots = 0; + info->pix24bpp = xf86GetBppFromDepth(pScrn, pScrn->depth); + info->CurrentLayout.bitsPerPixel = pScrn->bitsPerPixel; + info->CurrentLayout.depth = pScrn->depth; + info->CurrentLayout.pixel_bytes = pScrn->bitsPerPixel / 8; + info->CurrentLayout.pixel_code = (pScrn->bitsPerPixel != 16 + ? pScrn->bitsPerPixel + : pScrn->depth); + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Pixel depth = %d bits stored in %d byte%s (%d bpp pixmaps)\n", + pScrn->depth, + info->CurrentLayout.pixel_bytes, + info->CurrentLayout.pixel_bytes > 1 ? "s" : "", + info->pix24bpp); + /* We can't do this until we have a pScrn->display. */ xf86CollectOptions(pScrn, NULL); |