Alexey Dobriyan
2010-Jan-03 09:17 UTC
[Nouveau] [PATCH] nouveau: nv50: fix ->pseudo_palette usage
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 at gmail.com>
---
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);
Ben Skeggs
2010-Jan-03 22:17 UTC
[Nouveau] [PATCH] nouveau: nv50: fix ->pseudo_palette usage
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 at gmail.com> > --- > > 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 at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/nouveau
Possibly Parallel Threads
- [PATCH 2/4] drm/nouveau: Move struct nouveau_framebuffer.vma to struct nouveau_fbdev
- drm bo accessors etc. v2
- [PATCH] drm/nouveau: create function for "dealing" with gpu lockup
- [PATCH 0/4] drm/nouveau: Remove struct nouveau_framebuffer
- [PATCH] drm/nouveau/fbcon: fix font width not divisible by 8