All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nv04-nv40/exa: Reorder the commands in PrepareCopy to match the blob.
@ 2009-10-22  0:36 Francisco Jerez
       [not found] ` <1256171762-666-1-git-send-email-currojerez-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Francisco Jerez @ 2009-10-22  0:36 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

This fixes a somewhat indeterministic corruption problem on nv17 when
there is stuff going on the other fifos (e.g. gallium but I've also
reproduced it with an app just SIFM-ing memory around): in some cases
it made the blits the X server had scheduled use the wrong pitch.

Signed-off-by: Francisco Jerez <currojerez-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
---
 src/nv04_exa.c |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/nv04_exa.c b/src/nv04_exa.c
index 132c9d5..7384cbc 100644
--- a/src/nv04_exa.c
+++ b/src/nv04_exa.c
@@ -197,16 +197,9 @@ NV04EXAPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int dx, int dy,
 		return FALSE;
 
 	planemask |= ~0 << pDstPixmap->drawable.bitsPerPixel;
-	if (planemask != ~0 || alu != GXcopy) {
-		if (pDstPixmap->drawable.bitsPerPixel == 32)
-			return FALSE;
-		BEGIN_RING(chan, blit, NV04_IMAGE_BLIT_OPERATION, 1);
-		OUT_RING  (chan, 1); /* ROP_AND */
-		NV04EXASetROP(pScrn, alu, planemask);
-	} else {
-		BEGIN_RING(chan, blit, NV04_IMAGE_BLIT_OPERATION, 1);
-		OUT_RING  (chan, 3); /* SRCCOPY */
-	}
+	if ((planemask != ~0 || alu != GXcopy)
+	    && pDstPixmap->drawable.bitsPerPixel == 32)
+		return FALSE;
 
 	if (!NVAccelGetCtxSurf2DFormatFromPixmap(pDstPixmap, &fmt))
 		return FALSE;
@@ -218,6 +211,15 @@ NV04EXAPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int dx, int dy,
 	OUT_RELOCl(chan, src_bo, src_delta, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD);
 	OUT_RELOCl(chan, dst_bo, dst_delta, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
 
+	if (planemask != ~0 || alu != GXcopy) {
+		BEGIN_RING(chan, blit, NV04_IMAGE_BLIT_OPERATION, 1);
+		OUT_RING  (chan, 1); /* ROP_AND */
+		NV04EXASetROP(pScrn, alu, planemask);
+	} else {
+		BEGIN_RING(chan, blit, NV04_IMAGE_BLIT_OPERATION, 1);
+		OUT_RING  (chan, 3); /* SRCCOPY */
+	}
+
 	pNv->pspix = pSrcPixmap;
 	pNv->pdpix = pDstPixmap;
 	pNv->alu = alu;
-- 
1.6.4.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCHv2] nv04-nv40/exa: Match the blob behavior more closely on PrepareCopy.
       [not found] ` <1256171762-666-1-git-send-email-currojerez-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
@ 2009-11-06 15:14   ` Francisco Jerez
       [not found]     ` <1257520480-18855-1-git-send-email-currojerez-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Francisco Jerez @ 2009-11-06 15:14 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Fix a somewhat indeterministic corruption problem on nv17 when there
is stuff going on the other fifos (e.g. gallium but I've also
reproduced it with an app just SIFM-ing memory around): in some cases
it made the blits the X server had scheduled fail corrupting the
nearby screen areas.

Signed-off-by: Francisco Jerez <currojerez-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
---
 src/nv04_exa.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/nv04_exa.c b/src/nv04_exa.c
index 71a4ac2..f4966a4 100644
--- a/src/nv04_exa.c
+++ b/src/nv04_exa.c
@@ -209,10 +209,16 @@ NV04EXAPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int dx, int dy,
 			MARK_UNDO(chan);
 			return FALSE;
 		}
+
+		BEGIN_RING(chan, blit, NV04_IMAGE_BLIT_SURFACE, 1);
+		OUT_RING  (chan, pNv->NvContextSurfaces->handle);
 		BEGIN_RING(chan, blit, NV04_IMAGE_BLIT_OPERATION, 1);
 		OUT_RING  (chan, 1); /* ROP_AND */
+
 		NV04EXASetROP(pScrn, alu, planemask);
 	} else {
+		BEGIN_RING(chan, blit, NV04_IMAGE_BLIT_SURFACE, 1);
+		OUT_RING  (chan, pNv->NvContextSurfaces->handle);
 		BEGIN_RING(chan, blit, NV04_IMAGE_BLIT_OPERATION, 1);
 		OUT_RING  (chan, 3); /* SRCCOPY */
 	}
-- 
1.6.4.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCHv2] nv04-nv40/exa: Match the blob behavior more closely on PrepareCopy.
       [not found]     ` <1257520480-18855-1-git-send-email-currojerez-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
@ 2009-11-08 22:20       ` Ben Skeggs
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Skeggs @ 2009-11-08 22:20 UTC (permalink / raw)
  To: Francisco Jerez; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Fri, 2009-11-06 at 16:14 +0100, Francisco Jerez wrote:
> Fix a somewhat indeterministic corruption problem on nv17 when there
> is stuff going on the other fifos (e.g. gallium but I've also
> reproduced it with an app just SIFM-ing memory around): in some cases
> it made the blits the X server had scheduled fail corrupting the
> nearby screen areas.
> 
> Signed-off-by: Francisco Jerez <currojerez-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
Reviewed-by: Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

> ---
>  src/nv04_exa.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/src/nv04_exa.c b/src/nv04_exa.c
> index 71a4ac2..f4966a4 100644
> --- a/src/nv04_exa.c
> +++ b/src/nv04_exa.c
> @@ -209,10 +209,16 @@ NV04EXAPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int dx, int dy,
>  			MARK_UNDO(chan);
>  			return FALSE;
>  		}
> +
> +		BEGIN_RING(chan, blit, NV04_IMAGE_BLIT_SURFACE, 1);
> +		OUT_RING  (chan, pNv->NvContextSurfaces->handle);
>  		BEGIN_RING(chan, blit, NV04_IMAGE_BLIT_OPERATION, 1);
>  		OUT_RING  (chan, 1); /* ROP_AND */
> +
>  		NV04EXASetROP(pScrn, alu, planemask);
>  	} else {
> +		BEGIN_RING(chan, blit, NV04_IMAGE_BLIT_SURFACE, 1);
> +		OUT_RING  (chan, pNv->NvContextSurfaces->handle);
>  		BEGIN_RING(chan, blit, NV04_IMAGE_BLIT_OPERATION, 1);
>  		OUT_RING  (chan, 3); /* SRCCOPY */
>  	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-08 22:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-22  0:36 [PATCH] nv04-nv40/exa: Reorder the commands in PrepareCopy to match the blob Francisco Jerez
     [not found] ` <1256171762-666-1-git-send-email-currojerez-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
2009-11-06 15:14   ` [PATCHv2] nv04-nv40/exa: Match the blob behavior more closely on PrepareCopy Francisco Jerez
     [not found]     ` <1257520480-18855-1-git-send-email-currojerez-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>
2009-11-08 22:20       ` Ben Skeggs

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.