All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nouveau: nv50: fix ->pseudo_palette usage
@ 2010-01-03  9:17 Alexey Dobriyan
  2010-01-03 22:17 ` Ben Skeggs
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2010-01-03  9:17 UTC (permalink / raw)
  To: bskeggs-H+wXaHxf7aLQT0dZR+AlfA, airlied-H+wXaHxf7aLQT0dZR+AlfA
  Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Sometimes struct fb_fillrect::color is color, sometimes palette index.

Steps to reproduce:

	make menuconfig

Blue background will have quite random black color.

Signed-off-by: Alexey Dobriyan <adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---

 drivers/gpu/drm/nouveau/nv50_fbcon.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/nouveau/nv50_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nv50_fbcon.c
@@ -10,6 +10,7 @@ nv50_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
 	struct drm_device *dev = par->dev;
 	struct drm_nouveau_private *dev_priv = dev->dev_private;
 	struct nouveau_channel *chan = dev_priv->channel;
+	uint32_t color;
 
 	if (info->state != FBINFO_STATE_RUNNING)
 		return;
@@ -31,7 +32,12 @@ nv50_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
 		OUT_RING(chan, 1);
 	}
 	BEGIN_RING(chan, NvSub2D, 0x0588, 1);
-	OUT_RING(chan, rect->color);
+	if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
+	    info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
+		color = ((uint32_t *)info->pseudo_palette)[rect->color];
+	} else
+		color = rect->color;
+	OUT_RING(chan, color);
 	BEGIN_RING(chan, NvSub2D, 0x0600, 4);
 	OUT_RING(chan, rect->dx);
 	OUT_RING(chan, rect->dy);

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

* Re: [PATCH] nouveau: nv50: fix ->pseudo_palette usage
  2010-01-03  9:17 [PATCH] nouveau: nv50: fix ->pseudo_palette usage Alexey Dobriyan
@ 2010-01-03 22:17 ` Ben Skeggs
  2010-01-09 16:05   ` Alexey Dobriyan
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Skeggs @ 2010-01-03 22:17 UTC (permalink / raw)
  To: Alexey Dobriyan
  Cc: airlied-H+wXaHxf7aLQT0dZR+AlfA,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Sun, 2010-01-03 at 11:17 +0200, Alexey Dobriyan wrote:
> Sometimes struct fb_fillrect::color is color, sometimes palette index.
This doesn't apply on current git, which already has a similar (though,
not quite the same) patch applied.  We may yet need some additional
fixes from your patch, I'll look at testing that soon.

Ben.
> 
> Steps to reproduce:
> 
> 	make menuconfig
> 
> Blue background will have quite random black color.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> 
>  drivers/gpu/drm/nouveau/nv50_fbcon.c |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> --- a/drivers/gpu/drm/nouveau/nv50_fbcon.c
> +++ b/drivers/gpu/drm/nouveau/nv50_fbcon.c
> @@ -10,6 +10,7 @@ nv50_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
>  	struct drm_device *dev = par->dev;
>  	struct drm_nouveau_private *dev_priv = dev->dev_private;
>  	struct nouveau_channel *chan = dev_priv->channel;
> +	uint32_t color;
>  
>  	if (info->state != FBINFO_STATE_RUNNING)
>  		return;
> @@ -31,7 +32,12 @@ nv50_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
>  		OUT_RING(chan, 1);
>  	}
>  	BEGIN_RING(chan, NvSub2D, 0x0588, 1);
> -	OUT_RING(chan, rect->color);
> +	if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
> +	    info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
> +		color = ((uint32_t *)info->pseudo_palette)[rect->color];
> +	} else
> +		color = rect->color;
> +	OUT_RING(chan, color);
>  	BEGIN_RING(chan, NvSub2D, 0x0600, 4);
>  	OUT_RING(chan, rect->dx);
>  	OUT_RING(chan, rect->dy);
> _______________________________________________
> Nouveau mailing list
> Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau

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

* Re: [PATCH] nouveau: nv50: fix ->pseudo_palette usage
  2010-01-03 22:17 ` Ben Skeggs
@ 2010-01-09 16:05   ` Alexey Dobriyan
  2010-01-09 16:52     ` Maarten Maathuis
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2010-01-09 16:05 UTC (permalink / raw)
  To: Ben Skeggs
  Cc: airlied-H+wXaHxf7aLQT0dZR+AlfA,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Mon, Jan 04, 2010 at 08:17:36AM +1000, Ben Skeggs wrote:
> On Sun, 2010-01-03 at 11:17 +0200, Alexey Dobriyan wrote:
> > Sometimes struct fb_fillrect::color is color, sometimes palette index.
> This doesn't apply on current git, which already has a similar (though,
> not quite the same) patch applied.  We may yet need some additional
> fixes from your patch, I'll look at testing that soon.

Ehh?
They're the same except I haven't changed nv04, because of no hardware.

> > --- a/drivers/gpu/drm/nouveau/nv50_fbcon.c
> > +++ b/drivers/gpu/drm/nouveau/nv50_fbcon.c
> > @@ -10,6 +10,7 @@ nv50_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
> >  	struct drm_device *dev = par->dev;
> >  	struct drm_nouveau_private *dev_priv = dev->dev_private;
> >  	struct nouveau_channel *chan = dev_priv->channel;
> > +	uint32_t color;
> >  
> >  	if (info->state != FBINFO_STATE_RUNNING)
> >  		return;
> > @@ -31,7 +32,12 @@ nv50_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
> >  		OUT_RING(chan, 1);
> >  	}
> >  	BEGIN_RING(chan, NvSub2D, 0x0588, 1);
> > -	OUT_RING(chan, rect->color);
> > +	if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
> > +	    info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
> > +		color = ((uint32_t *)info->pseudo_palette)[rect->color];
> > +	} else
> > +		color = rect->color;
> > +	OUT_RING(chan, color);
> >  	BEGIN_RING(chan, NvSub2D, 0x0600, 4);

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

* Re: [PATCH] nouveau: nv50: fix ->pseudo_palette usage
  2010-01-09 16:05   ` Alexey Dobriyan
@ 2010-01-09 16:52     ` Maarten Maathuis
  0 siblings, 0 replies; 4+ messages in thread
From: Maarten Maathuis @ 2010-01-09 16:52 UTC (permalink / raw)
  To: Alexey Dobriyan
  Cc: airlied-H+wXaHxf7aLQT0dZR+AlfA,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

This is the patch
http://cgit.freedesktop.org/nouveau/linux-2.6/commit/?id=aac125bb84c73a7637de5e85a6cc23ab81357552

Maybe a rebased patch went upstream (no idea if this happened already)?

Maarten.

On Sat, Jan 9, 2010 at 5:05 PM, Alexey Dobriyan <adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Mon, Jan 04, 2010 at 08:17:36AM +1000, Ben Skeggs wrote:
>> On Sun, 2010-01-03 at 11:17 +0200, Alexey Dobriyan wrote:
>> > Sometimes struct fb_fillrect::color is color, sometimes palette index.
>> This doesn't apply on current git, which already has a similar (though,
>> not quite the same) patch applied.  We may yet need some additional
>> fixes from your patch, I'll look at testing that soon.
>
> Ehh?
> They're the same except I haven't changed nv04, because of no hardware.
>
>> > --- a/drivers/gpu/drm/nouveau/nv50_fbcon.c
>> > +++ b/drivers/gpu/drm/nouveau/nv50_fbcon.c
>> > @@ -10,6 +10,7 @@ nv50_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
>> >     struct drm_device *dev = par->dev;
>> >     struct drm_nouveau_private *dev_priv = dev->dev_private;
>> >     struct nouveau_channel *chan = dev_priv->channel;
>> > +   uint32_t color;
>> >
>> >     if (info->state != FBINFO_STATE_RUNNING)
>> >             return;
>> > @@ -31,7 +32,12 @@ nv50_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
>> >             OUT_RING(chan, 1);
>> >     }
>> >     BEGIN_RING(chan, NvSub2D, 0x0588, 1);
>> > -   OUT_RING(chan, rect->color);
>> > +   if (info->fix.visual == FB_VISUAL_TRUECOLOR ||
>> > +       info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
>> > +           color = ((uint32_t *)info->pseudo_palette)[rect->color];
>> > +   } else
>> > +           color = rect->color;
>> > +   OUT_RING(chan, color);
>> >     BEGIN_RING(chan, NvSub2D, 0x0600, 4);
> _______________________________________________
> Nouveau mailing list
> Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau
>

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

end of thread, other threads:[~2010-01-09 16:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-03  9:17 [PATCH] nouveau: nv50: fix ->pseudo_palette usage Alexey Dobriyan
2010-01-03 22:17 ` Ben Skeggs
2010-01-09 16:05   ` Alexey Dobriyan
2010-01-09 16:52     ` Maarten Maathuis

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.