All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Check before trying a solid fill
@ 2015-05-19 20:28 Ilia Mirkin
       [not found] ` <1432067309-14175-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Ilia Mirkin @ 2015-05-19 20:28 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Pre-nv50 has all sorts of funny requirements for non-copy alu
operations, and will bail out of solid fills left and right. Account for
that case and fall back to the memset.

Reported-by: Andrew Randrianasulu <randrianasulu@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
---
 src/drmmode_display.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 7c1d2bb..2ca1dba 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -410,12 +410,15 @@ drmmode_fbcon_copy(ScreenPtr pScreen)
 
 fallback:
 	if (pdpix) {
-		pNv->EXADriverPtr->PrepareSolid(pdpix, GXclear, ~0, 0);
-		pNv->EXADriverPtr->Solid(pdpix, 0, 0, w, h);
-		pNv->EXADriverPtr->DoneSolid(pdpix);
-		nouveau_bo_wait(pNv->scanout, NOUVEAU_BO_RDWR, pNv->client);
+		if (exa->PrepareSolid(pdpix, GXclear, ~0, 0)) {
+			exa->Solid(pdpix, 0, 0, w, h);
+			exa->DoneSolid(pdpix);
+			PUSH_KICK(pNv->pushbuf);
+			nouveau_bo_wait(pNv->scanout, NOUVEAU_BO_RDWR, pNv->client);
+			pScreen->DestroyPixmap(pdpix);
+			return;
+		}
 		pScreen->DestroyPixmap(pdpix);
-		return;
 	}
 #endif
 	if (nouveau_bo_map(pNv->scanout, NOUVEAU_BO_WR, pNv->client))
-- 
2.3.6

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

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

* [PATCH 2/2] nv04-nv40: don't attempt to do 32-bit shifts
       [not found] ` <1432067309-14175-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
@ 2015-05-19 20:28   ` Ilia Mirkin
       [not found]     ` <1432067309-14175-2-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Ilia Mirkin @ 2015-05-19 20:28 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

A 32-bit shift is a no-op, which will also make the new planemask get
or'd with ~0, thus negating the usefulness of the subsequent
planemask != ~0 check. Only do this if it's a less-than-32-bit per pixel
format, in which case it will have the desired effect of setting the
high bits.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
---
 src/nv04_exa.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/nv04_exa.c b/src/nv04_exa.c
index 7a58dd7..d5dec68 100644
--- a/src/nv04_exa.c
+++ b/src/nv04_exa.c
@@ -49,7 +49,8 @@ NV04EXASetROP(PixmapPtr ppix, int subc, int mthd, int alu, Pixel planemask)
 	NVPtr pNv = NVPTR(pScrn);
 	struct nouveau_pushbuf *push = pNv->pushbuf;
 
-	planemask |= ~0 << ppix->drawable.bitsPerPixel;
+	if (ppix->drawable.bitsPerPixel < 32)
+		planemask |= ~0 << ppix->drawable.bitsPerPixel;
 	if (planemask != ~0 || alu != GXcopy) {
 		if (ppix->drawable.bitsPerPixel == 32)
 			return FALSE;
-- 
2.3.6

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

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

* Re: [PATCH 2/2] nv04-nv40: don't attempt to do 32-bit shifts
       [not found]     ` <1432067309-14175-2-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
@ 2015-05-19 20:35       ` Martin Peres
       [not found]         ` <555B9E83.8000509-GANU6spQydw@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Peres @ 2015-05-19 20:35 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 19/05/15 23:28, Ilia Mirkin wrote:
> A 32-bit shift is a no-op, which will also make the new planemask get
> or'd with ~0, thus negating the usefulness of the subsequent
> planemask != ~0 check. Only do this if it's a less-than-32-bit per pixel
> format, in which case it will have the desired effect of setting the
> high bits.
>
> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
> ---
>   src/nv04_exa.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/nv04_exa.c b/src/nv04_exa.c
> index 7a58dd7..d5dec68 100644
> --- a/src/nv04_exa.c
> +++ b/src/nv04_exa.c
> @@ -49,7 +49,8 @@ NV04EXASetROP(PixmapPtr ppix, int subc, int mthd, int alu, Pixel planemask)
>   	NVPtr pNv = NVPTR(pScrn);
>   	struct nouveau_pushbuf *push = pNv->pushbuf;
>   
> -	planemask |= ~0 << ppix->drawable.bitsPerPixel;
> +	if (ppix->drawable.bitsPerPixel < 32)
> +		planemask |= ~0 << ppix->drawable.bitsPerPixel;
>   	if (planemask != ~0 || alu != GXcopy) {
>   		if (ppix->drawable.bitsPerPixel == 32)
>   			return FALSE;

Both patches look good to me. Thanks for tracking those bugs down :)

Reviewed-by: Martin Peres <martin.peres@free.fr>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

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

* Re: [PATCH 2/2] nv04-nv40: don't attempt to do 32-bit shifts
       [not found]         ` <555B9E83.8000509-GANU6spQydw@public.gmane.org>
@ 2015-05-19 20:42           ` Ilia Mirkin
  0 siblings, 0 replies; 4+ messages in thread
From: Ilia Mirkin @ 2015-05-19 20:42 UTC (permalink / raw)
  To: Martin Peres; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Tue, May 19, 2015 at 4:35 PM, Martin Peres <martin.peres@free.fr> wrote:
> On 19/05/15 23:28, Ilia Mirkin wrote:
>>
>> A 32-bit shift is a no-op, which will also make the new planemask get
>> or'd with ~0, thus negating the usefulness of the subsequent
>> planemask != ~0 check. Only do this if it's a less-than-32-bit per pixel
>> format, in which case it will have the desired effect of setting the
>> high bits.
>>
>> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
>> ---
>>   src/nv04_exa.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/nv04_exa.c b/src/nv04_exa.c
>> index 7a58dd7..d5dec68 100644
>> --- a/src/nv04_exa.c
>> +++ b/src/nv04_exa.c
>> @@ -49,7 +49,8 @@ NV04EXASetROP(PixmapPtr ppix, int subc, int mthd, int
>> alu, Pixel planemask)
>>         NVPtr pNv = NVPTR(pScrn);
>>         struct nouveau_pushbuf *push = pNv->pushbuf;
>>   -     planemask |= ~0 << ppix->drawable.bitsPerPixel;
>> +       if (ppix->drawable.bitsPerPixel < 32)
>> +               planemask |= ~0 << ppix->drawable.bitsPerPixel;
>>         if (planemask != ~0 || alu != GXcopy) {
>>                 if (ppix->drawable.bitsPerPixel == 32)
>>                         return FALSE;
>
>
> Both patches look good to me. Thanks for tracking those bugs down :)
>
> Reviewed-by: Martin Peres <martin.peres@free.fr>

Thanks! FWIW I just happened to notice this as I was reading the code,
so it's untested and not in response to any bug. I have no idea if it
actually affects things... I suspect planemask != ~0U is pretty rare
to begin with, outside of things that test it explicitly.

  -ilia
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

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

end of thread, other threads:[~2015-05-19 20:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-19 20:28 [PATCH 1/2] Check before trying a solid fill Ilia Mirkin
     [not found] ` <1432067309-14175-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
2015-05-19 20:28   ` [PATCH 2/2] nv04-nv40: don't attempt to do 32-bit shifts Ilia Mirkin
     [not found]     ` <1432067309-14175-2-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
2015-05-19 20:35       ` Martin Peres
     [not found]         ` <555B9E83.8000509-GANU6spQydw@public.gmane.org>
2015-05-19 20:42           ` Ilia Mirkin

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.