From: Petr V. <van...@vc...> - 2004-04-07 23:20:16
|
On Thu, Apr 08, 2004 at 12:42:39AM +0200, Petr Vandrovec wrote: > > diff -Br -b -U 3 -N linux-2.6.5/drivers/video/aty/radeon_accel.c linux-2.6.5-new/drivers/video/aty/radeon_accel.c > > --- linux-2.6.5/drivers/video/aty/radeon_accel.c 2004-02-18 04:58:34.000000000 +0100 > > +++ linux-2.6.5-new/drivers/video/aty/radeon_accel.c 2004-04-07 22:40:41.000000000 +0200 > > @@ -7,13 +7,16 @@ > > static void radeonfb_prim_fillrect(struct radeonfb_info *rinfo, > > const struct fb_fillrect *region) > > { > > + int color; > > radeon_fifo_wait(4); > > > > OUTREG(DP_GUI_MASTER_CNTL, > > rinfo->dp_gui_master_cntl /* contains, like GMC_DST_32BPP */ > > | GMC_BRUSH_SOLID_COLOR > > | ROP3_P); > > - OUTREG(DP_BRUSH_FRGD_CLR, region->color); > > + color = region->color | (region->color << 8); > > + color = color | (color << 16); > > + OUTREG(DP_BRUSH_FRGD_CLR, color); > > OUTREG(DP_WRITE_MSK, 0xffffffff); > > OUTREG(DP_CNTL, (DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM)); > > > > Let me know if it works for you! > > Did you tried that it does not work on 16bpp? I would be really > surprised if it did not work for 16/8bpp too. Maybe better to > apply this patch and try it... Hm, I'm stupid... Patch below works IFF you are using my matroxfb patches. I've packed them all (except patch below) and put them at ftp://platan.vc.cvut.cz/pub/linux/matrox-latest/jurriaan.gz. In addition to matroxfb patches it also contains fixes to get vesafb to work in 8bpp with Matrox Parhelia, and some additional output for 'vga=ask'. Without my patches layout of pseudo_palette varies between color depths, and you need to use if () or switch () instead of simple inline array lookup. Or you have to compose hardware color at fillrect time from RGB bitfields. For properly working with my patches it also needs to support ROP_ZERO fillrect, which I use in clear_margins() to clear right/bottom margin with black and not with some color picked from currently choosen color palette. But you should not need clear_margins() unless you are using 12x22 font. Petr diff -urN linux-2.6.5-rc3-c1777.dist/drivers/video/aty/radeon_accel.c linux-2.6.5-rc3-c1777/drivers/video/aty/radeon_accel.c --- linux-2.6.5-rc3-c1777.dist/drivers/video/aty/radeon_accel.c 2004-04-03 18:37:51.000000000 +0200 +++ linux-2.6.5-rc3-c1777/drivers/video/aty/radeon_accel.c 2004-04-08 00:41:56.000000000 +0200 @@ -7,13 +7,15 @@ static void radeonfb_prim_fillrect(struct radeonfb_info *rinfo, const struct fb_fillrect *region) { + u32 color; radeon_fifo_wait(4); OUTREG(DP_GUI_MASTER_CNTL, rinfo->dp_gui_master_cntl /* contains, like GMC_DST_32BPP */ | GMC_BRUSH_SOLID_COLOR | ROP3_P); - OUTREG(DP_BRUSH_FRGD_CLR, region->color); + color = rinfo->info->pseudo_palette[region->color]; + OUTREG(DP_BRUSH_FRGD_CLR, color); OUTREG(DP_WRITE_MSK, 0xffffffff); OUTREG(DP_CNTL, (DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM)); diff -urN linux-2.6.5-rc3-c1777.dist/drivers/video/aty/radeon_base.c linux-2.6.5-rc3-c1777/drivers/video/aty/radeon_base.c --- linux-2.6.5-rc3-c1777.dist/drivers/video/aty/radeon_base.c 2004-04-03 18:35:39.000000000 +0200 +++ linux-2.6.5-rc3-c1777/drivers/video/aty/radeon_base.c 2004-04-08 00:53:51.000000000 +0200 @@ -1060,6 +1060,9 @@ if (regno < 16) { u32 *pal = info->pseudo_palette; switch (rinfo->depth) { + case 8: + pal[regno] = regno; + break; case 15: pal[regno] = (regno << 10) | (regno << 5) | regno; break; |