|
From: Sottek, M. J <mat...@in...> - 2002-01-30 01:40:38
|
James,
If the upper layers don't know what the data is (Because it is
device specific) then why can they even see it? Device specific
data should remain in device specific data structures. Just because
almost all cards are going to need a similar place to store the
console colors doesn't mean it goes in a device independent data
structure. (I realize it's always been there, and it isn't the only
device dependent thing in there, but that doesn't make it correct)
What you need is a color format in your region (which I think you
have when doing image blit). Then you just send the palette entry
for the color. Fillrect does a switch for the types of things it can
do in hardware or via a quick lookup or it returns an error.
Basically fill rect acts just like an image blit.
Something like this:
void fbcon_accel_clear(struct vc_data *vc, struct display *p, int sy,
int sx, int height, int width)
{
struct fb_info *info = p->fb_info;
struct fb_fillrect region;
region.color = attr_bgcol_ec(p,vc);
region.visual = FB_VISUAL_PSEUDOCOLOR;
height++;
region.dx = sx * fontwidth(p);
region.dy = sy * fontheight(p);
region.width = width * fontwidth(p);
region.height = height * fontheight(p);
region.rop = ROP_COPY;
info->fbops->fb_fillrect(info, ®ion);
}
Perhaps we can take a step back and look at all the data structures
and justify why things are the way they are. If you are changing the
data structures we might as well make sure they make sense.
-Matt
|