diff options
author | Maarten Lankhorst <dev@mblankhorst.nl> | 2015-03-21 22:30:10 +0100 |
---|---|---|
committer | Maarten Lankhorst <dev@mblankhorst.nl> | 2015-03-21 22:30:33 +0100 |
commit | f0fdc156039eaa79fb1ad82fcc6437f2432306c6 (patch) | |
tree | 092d738a45bb16cb5d71beb42536863ecf3eb161 /src | |
parent | 7319b54291d59e1cd3cbe4f39ea8cc6dc8bf45bc (diff) |
Try using EXA ops harder in drmmode_fbcon_copy fallback
The memcpy in the fallback path fails with SIGBUS on GK20A because
this memory is not coherent, try to use a solid fill instead.
Diffstat (limited to 'src')
-rw-r--r-- | src/drmmode_display.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 6d225cb..db79e88 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -332,7 +332,7 @@ drmmode_fbcon_copy(ScreenPtr pScreen) ExaDriverPtr exa = pNv->EXADriverPtr; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); struct nouveau_bo *bo = NULL; - PixmapPtr pspix, pdpix; + PixmapPtr pspix, pdpix = NULL; drmModeFBPtr fb; unsigned w = pScrn->virtualX, h = pScrn->virtualY; int i, ret, fbcon_id = 0; @@ -340,6 +340,17 @@ drmmode_fbcon_copy(ScreenPtr pScreen) if (pNv->AccelMethod != EXA) goto fallback; + pdpix = drmmode_pixmap_wrap(pScreen, pScrn->virtualX, + pScrn->virtualY, pScrn->depth, + pScrn->bitsPerPixel, pScrn->displayWidth * + pScrn->bitsPerPixel / 8, pNv->scanout, + NULL); + if (!pdpix) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Failed to init scanout pixmap for fbcon mirror\n"); + goto fallback; + } + for (i = 0; i < xf86_config->num_crtc; i++) { drmmode_crtc_private_ptr drmmode_crtc = xf86_config->crtc[i]->driver_private; @@ -382,18 +393,6 @@ drmmode_fbcon_copy(ScreenPtr pScreen) goto fallback; } - pdpix = drmmode_pixmap_wrap(pScreen, pScrn->virtualX, - pScrn->virtualY, pScrn->depth, - pScrn->bitsPerPixel, pScrn->displayWidth * - pScrn->bitsPerPixel / 8, pNv->scanout, - NULL); - if (!pdpix) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Failed to init scanout pixmap for fbcon mirror\n"); - pScreen->DestroyPixmap(pspix); - goto fallback; - } - exa->PrepareCopy(pspix, pdpix, 0, 0, GXcopy, ~0); exa->Copy(pdpix, 0, 0, 0, 0, w, h); exa->DoneCopy(pdpix); @@ -410,6 +409,14 @@ drmmode_fbcon_copy(ScreenPtr pScreen) return; fallback: + if (pdpix) { + pNv->EXADriverPtr->PrepareSolid(pdpix, GXcopy, ~0, 0); + pNv->EXADriverPtr->Solid(pdpix, 0, 0, w, h); + pNv->EXADriverPtr->DoneSolid(pdpix); + pScreen->DestroyPixmap(pdpix); + nouveau_bo_wait(pNv->scanout, NOUVEAU_BO_RDWR, pNv->client); + return; + } #endif if (nouveau_bo_map(pNv->scanout, NOUVEAU_BO_WR, pNv->client)) return; |