diff --git a/debian/changelog b/debian/changelog index 68d35af..8f67714 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +xserver-xorg-video-nouveau (1:1.0.7-0ubuntu2) UNRELEASED; urgency=low + + * Add patch to not crash if gpu dies + - Doesn't fix underlying cause, but might get rid of all dupes. (LP: #1033533) + + -- Maarten Lankhorst Mon, 08 Apr 2013 10:43:08 +0200 + xserver-xorg-video-nouveau (1:1.0.7-0ubuntu1) raring; urgency=low * Sync to unreleased debian experimental git. diff --git a/debian/patches/fixup-exa-fail.patch b/debian/patches/fixup-exa-fail.patch new file mode 100644 index 0000000..d26002b --- /dev/null +++ b/debian/patches/fixup-exa-fail.patch @@ -0,0 +1,115 @@ +diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c +index bcc0d4e..5591a00 100644 +--- a/src/nouveau_exa.c ++++ b/src/nouveau_exa.c +@@ -92,12 +92,28 @@ static Bool + nouveau_exa_prepare_access(PixmapPtr ppix, int index) + { + struct nouveau_bo *bo = nouveau_pixmap_bo(ppix); +- NVPtr pNv = NVPTR(xf86ScreenToScrn(ppix->drawable.pScreen)); ++ ScrnInfoPtr pScrn = xf86ScreenToScrn(ppix->drawable.pScreen); ++ NVPtr pNv = NVPTR(pScrn); ++ int ret; + + if (nv50_style_tiled_pixmap(ppix) && !pNv->wfb_enabled) + return FALSE; +- if (nouveau_bo_map(bo, NOUVEAU_BO_RDWR, pNv->client)) ++ ret = nouveau_bo_map(bo, NOUVEAU_BO_RDWR, pNv->client); ++ if (!bo->map) { ++ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%s:%d mmap failed with %i %s\n", ++ __func__, __LINE__, ret, strerror(-ret)); ++ return FALSE; ++ } ++ ++ if (ret == -EBUSY) ++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s:%d wait failed with -EBUSY, gpu hung?\n", ++ __func__, __LINE__); ++ else if (ret) { ++ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%s:%d wait failed with %i %s\n", ++ __func__, __LINE__, ret, strerror(-ret)); + return FALSE; ++ } ++ + ppix->devPrivate.ptr = bo->map; + return TRUE; + } +@@ -249,9 +265,8 @@ nouveau_exa_download_from_screen(PixmapPtr pspix, int x, int y, int w, int h, + ScrnInfoPtr pScrn = xf86ScreenToScrn(pspix->drawable.pScreen); + NVPtr pNv = NVPTR(pScrn); + struct nouveau_bo *bo; +- int src_pitch, tmp_pitch, cpp, i; ++ int src_pitch, tmp_pitch, cpp, i, ret; + const char *src; +- Bool ret; + + cpp = pspix->drawable.bitsPerPixel >> 3; + src_pitch = exaGetPixmapPitch(pspix); +@@ -295,14 +310,23 @@ nouveau_exa_download_from_screen(PixmapPtr pspix, int x, int y, int w, int h, + memcpy: + bo = nouveau_pixmap_bo(pspix); + if (nv50_style_tiled_pixmap(pspix)) +- ErrorF("%s:%d - falling back to memcpy ignores tiling\n", ++ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%s:%d - falling back to memcpy ignores tiling\n", + __func__, __LINE__); + +- if (nouveau_bo_map(bo, NOUVEAU_BO_RD, pNv->client)) ++ ret = nouveau_bo_map(bo, NOUVEAU_BO_RD, pNv->client); ++ if (ret && !bo->map) { ++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s:%d mmap failed with %i %s, expect crashes!\n", ++ __func__, __LINE__, ret, strerror(-ret)); + return FALSE; ++ } ++ if (ret == -EBUSY) ++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s:%d wait failed with -EBUSY, gpu hung?\n", ++ __func__, __LINE__); ++ else if (ret) ++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s:%d wait failed with %i %s, continuing anyway\n", ++ __func__, __LINE__, ret, strerror(-ret)); + src = (char *)bo->map + (y * src_pitch) + (x * cpp); +- ret = NVAccelMemcpyRect(dst, src, h, dst_pitch, src_pitch, w*cpp); +- return ret; ++ return NVAccelMemcpyRect(dst, src, h, dst_pitch, src_pitch, w*cpp); + } + + static Bool +@@ -311,10 +335,9 @@ nouveau_exa_upload_to_screen(PixmapPtr pdpix, int x, int y, int w, int h, + { + ScrnInfoPtr pScrn = xf86ScreenToScrn(pdpix->drawable.pScreen); + NVPtr pNv = NVPTR(pScrn); +- int dst_pitch, tmp_pitch, cpp, i; ++ int dst_pitch, tmp_pitch, cpp, i, ret; + struct nouveau_bo *bo; + char *dst; +- Bool ret; + + cpp = pdpix->drawable.bitsPerPixel >> 3; + dst_pitch = exaGetPixmapPitch(pdpix); +@@ -380,14 +403,24 @@ nouveau_exa_upload_to_screen(PixmapPtr pdpix, int x, int y, int w, int h, + memcpy: + bo = nouveau_pixmap_bo(pdpix); + if (nv50_style_tiled_pixmap(pdpix)) +- ErrorF("%s:%d - falling back to memcpy ignores tiling\n", ++ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%s:%d - falling back to memcpy ignores tiling\n", + __func__, __LINE__); + +- if (nouveau_bo_map(bo, NOUVEAU_BO_WR, pNv->client)) ++ ret = nouveau_bo_map(bo, NOUVEAU_BO_WR, pNv->client); ++ if (ret && !bo->map) { ++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s:%d mmap failed with %i %s, expect crashes!\n", ++ __func__, __LINE__, ret, strerror(-ret)); + return FALSE; ++ } ++ if (ret == -EBUSY) ++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s:%d wait failed with -EBUSY, gpu hung?\n", ++ __func__, __LINE__); ++ else if (ret) ++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "%s:%d wait failed with %i %s\n", ++ __func__, __LINE__, ret, strerror(-ret)); ++ + dst = (char *)bo->map + (y * dst_pitch) + (x * cpp); +- ret = NVAccelMemcpyRect(dst, src, h, dst_pitch, src_pitch, w*cpp); +- return ret; ++ return NVAccelMemcpyRect(dst, src, h, dst_pitch, src_pitch, w*cpp); + } + + Bool diff --git a/debian/patches/series b/debian/patches/series index e8e209c..fd135cd 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ # Ubuntu patches 100-vblank-on.diff +fixup-exa-fail.patch