diff options
Diffstat (limited to 'src/armsoc_driver.c')
-rw-r--r-- | src/armsoc_driver.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/armsoc_driver.c b/src/armsoc_driver.c index 590352e..3181ed3 100644 --- a/src/armsoc_driver.c +++ b/src/armsoc_driver.c @@ -760,7 +760,7 @@ ARMSOCPreInit(ScrnInfoPtr pScrn, int flags) pScrn->monitor = pScrn->confScreen->monitor; - /* Get the current depth, and set it for XFree86: */ + /* Get the current color depth & bpp, and set it for XFree86: */ default_depth = 24; /* TODO: MIDEGL-1445: get from kernel */ fbbpp = 32; /* TODO: MIDEGL-1445: get from kernel */ @@ -880,7 +880,7 @@ ARMSOCPreInit(ScrnInfoPtr pScrn, int flags) /* Let XFree86 calculate or get (from command line) the display DPI: */ xf86SetDpi(pScrn, 0, 0); - /* Ensure we have a supported depth: */ + /* Ensure we have a supported bitsPerPixel: */ switch (pScrn->bitsPerPixel) { case 16: case 24: @@ -893,9 +893,7 @@ ARMSOCPreInit(ScrnInfoPtr pScrn, int flags) goto fail2; } - /* Load external sub-modules now: */ - if (!(xf86LoadSubModule(pScrn, "dri2") && xf86LoadSubModule(pScrn, "exa") && xf86LoadSubModule(pScrn, "fb"))) { @@ -952,6 +950,7 @@ ARMSOCScreenInit(SCREEN_INIT_ARGS_DECL) xf86CrtcConfigPtr xf86_config; int j; char *fbdev; + int depth; TRACE_ENTER(); @@ -960,12 +959,22 @@ ARMSOCScreenInit(SCREEN_INIT_ARGS_DECL) ERROR_MSG("Cannot get DRM master: %s", strerror(errno)); goto fail; } - /* Allocate initial scanout buffer */ - DEBUG_MSG("allocating new scanout buffer: %dx%d", - pScrn->virtualX, pScrn->virtualY); + + /* We create a single visual with the depth set to the + * screen's bpp as otherwise XComposite will add an alternate + * visual and ARGB8888 windows will be implicitly redirected. + * The initial scanout buffer is created with the same depth + * to match the visual. + */ + depth = pScrn->bitsPerPixel; + + /* Allocate initial scanout buffer.*/ + DEBUG_MSG("allocating new scanout buffer: %dx%d %d %d", + pScrn->virtualX, pScrn->virtualY, + depth, pScrn->bitsPerPixel); assert(!pARMSOC->scanout); pARMSOC->scanout = armsoc_bo_new_with_dim(pARMSOC->dev, pScrn->virtualX, - pScrn->virtualY, pScrn->depth, pScrn->bitsPerPixel, + pScrn->virtualY, depth, pScrn->bitsPerPixel, ARMSOC_BO_SCANOUT); if (!pARMSOC->scanout) { ERROR_MSG("Cannot allocate scanout buffer\n"); @@ -995,26 +1004,17 @@ ARMSOCScreenInit(SCREEN_INIT_ARGS_DECL) /* Reset the visual list. */ miClearVisualTypes(); - if (!miSetVisualTypes(pScrn->bitsPerPixel, - miGetDefaultVisualMask(pScrn->depth), + + if (!miSetVisualTypes(depth, + miGetDefaultVisualMask(depth), pScrn->rgbBits, pScrn->defaultVisual)) { ERROR_MSG( - "Cannot initialize the visual type for %d bits per pixel!", + "Cannot initialize the visual type for %d depth, %d bits per pixel!", + depth, pScrn->bitsPerPixel); goto fail2; } - if (pScrn->bitsPerPixel == 32 && pScrn->depth == 24) { - /* Also add a 24 bit depth visual */ - if (!miSetVisualTypes(24, miGetDefaultVisualMask(pScrn->depth), - pScrn->rgbBits, pScrn->defaultVisual)) { - WARNING_MSG( - "Cannot initialize a 24 depth visual for 32bpp"); - } else { - INFO_MSG("Initialized a 24 depth visual for 32bpp"); - } - } - if (!miSetPixmapDepths()) { ERROR_MSG("Cannot initialize the pixmap depth!"); goto fail3; |