diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-02-08 12:51:47 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-12-14 16:10:22 +1000 |
commit | b6cb21b91f7d0409794a14ddbdd606728d4d49e3 (patch) | |
tree | 59cb18fb9c060baf0ae1ceac3bbc8bc5038fefe9 | |
parent | 11510f9ce8c9eab15e7f6d5962b83fc0052c8619 (diff) |
set canDoBGNoneRoot if building against new enough server
-rw-r--r-- | src/drmmode_display.c | 40 | ||||
-rw-r--r-- | src/nv_driver.c | 1 |
2 files changed, 20 insertions, 21 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index c5b57eb..d14dd80 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -187,22 +187,18 @@ void drmmode_fbcon_copy(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); NVPtr pNv = NVPTR(pScrn); +#if XORG_VERSION_CURRENT >= 10999001 ExaDriverPtr exa = pNv->EXADriverPtr; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); struct nouveau_bo *bo = NULL; PixmapPtr pspix, pdpix; drmModeFBPtr fb; unsigned w = pScrn->virtualX, h = pScrn->virtualY; int i, ret, fbcon_id = 0; - if (pNv->NoAccel) { - if (nouveau_bo_map(pNv->scanout, NOUVEAU_BO_WR)) - return; - memset(pNv->scanout->map, 0x00, pNv->scanout->size); - nouveau_bo_unmap(pNv->scanout); - return; - } + if (pNv->NoAccel) + goto fallback; for (i = 0; i < xf86_config->num_crtc; i++) { drmmode_crtc_private_ptr drmmode_crtc = @@ -213,32 +209,27 @@ drmmode_fbcon_copy(ScreenPtr pScreen) } if (!fbcon_id) - return; + goto fallback; fb = drmModeGetFB(nouveau_device(pNv->dev)->fd, fbcon_id); if (!fb) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to retrieve fbcon fb: id %d\n", fbcon_id); - return; + goto fallback; } - if (fb->depth != pScrn->depth) { + if (fb->depth != pScrn->depth || fb->width != w || fb->height != h) { drmFree(fb); - return; + goto fallback; } - if (w > fb->width) - w = fb->width; - if (h > fb->height) - h = fb->height; - ret = nouveau_bo_wrap(pNv->dev, fb->handle, &bo); if (ret) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to retrieve fbcon buffer: handle=0x%08x\n", fb->handle); drmFree(fb); - return; + goto fallback; } pspix = drmmode_pixmap_wrap(pScreen, fb->width, fb->height, @@ -248,7 +239,7 @@ drmmode_fbcon_copy(ScreenPtr pScreen) if (!pspix) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to create pixmap for fbcon contents\n"); - return; + goto fallback; } pdpix = drmmode_pixmap_wrap(pScreen, pScrn->virtualX, @@ -260,7 +251,7 @@ drmmode_fbcon_copy(ScreenPtr pScreen) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Failed to init scanout pixmap for fbcon mirror\n"); pScreen->DestroyPixmap(pspix); - return; + goto fallback; } exa->PrepareCopy(pspix, pdpix, 0, 0, GXcopy, ~0); @@ -276,6 +267,15 @@ drmmode_fbcon_copy(ScreenPtr pScreen) pScreen->DestroyPixmap(pdpix); pScreen->DestroyPixmap(pspix); + pScreen->canDoBGNoneRoot = TRUE; + return; + +fallback: +#endif + if (nouveau_bo_map(pNv->scanout, NOUVEAU_BO_WR)) + return; + memset(pNv->scanout->map, 0x00, pNv->scanout->size); + nouveau_bo_unmap(pNv->scanout); } static Bool diff --git a/src/nv_driver.c b/src/nv_driver.c index f351fac..ed72194 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -1210,7 +1210,6 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); drmmode_screen_init(pScreen); - return TRUE; } |