X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fvideo%2Fcfbfillrect.c;h=f00b50aab6061e509f957aebd5fd48f603617a48;hb=27b3f643e42d8a10f8b7fb0fe3640e739001c486;hp=e4fc42b013ebdb7f3bab16ef7f33c0d4d7a2573f;hpb=b14c9c33594c5c8da3a20863d663f3709ed508ec;p=linux-2.6.git diff --git a/drivers/video/cfbfillrect.c b/drivers/video/cfbfillrect.c index e4fc42b01..f00b50aab 100644 --- a/drivers/video/cfbfillrect.c +++ b/drivers/video/cfbfillrect.c @@ -17,7 +17,6 @@ * the native cpu endians. I also need to deal with MSB position in the word. * */ -#include #include #include #include @@ -110,8 +109,8 @@ bitfill_aligned(unsigned long __iomem *dst, int dst_idx, unsigned long pat, unsi if (!n) return; - first = ~0UL >> dst_idx; - last = ~(~0UL >> ((dst_idx+n) % bits)); + first = FB_SHIFT_HIGH(~0UL, dst_idx); + last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits)); if (dst_idx+n <= bits) { // Single word @@ -167,8 +166,8 @@ bitfill_unaligned(unsigned long __iomem *dst, int dst_idx, unsigned long pat, if (!n) return; - first = ~0UL >> dst_idx; - last = ~(~0UL >> ((dst_idx+n) % bits)); + first = FB_SHIFT_HIGH(~0UL, dst_idx); + last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits)); if (dst_idx+n <= bits) { // Single word @@ -221,8 +220,8 @@ bitfill_aligned_rev(unsigned long __iomem *dst, int dst_idx, unsigned long pat, if (!n) return; - first = ~0UL >> dst_idx; - last = ~(~0UL >> ((dst_idx+n) % bits)); + first = FB_SHIFT_HIGH(~0UL, dst_idx); + last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits)); if (dst_idx+n <= bits) { // Single word @@ -290,8 +289,8 @@ bitfill_unaligned_rev(unsigned long __iomem *dst, int dst_idx, unsigned long pat if (!n) return; - first = ~0UL >> dst_idx; - last = ~(~0UL >> ((dst_idx+n) % bits)); + first = FB_SHIFT_HIGH(~0UL, dst_idx); + last = ~(FB_SHIFT_HIGH(~0UL, (dst_idx+n) % bits)); if (dst_idx+n <= bits) { // Single word @@ -344,7 +343,8 @@ bitfill_unaligned_rev(unsigned long __iomem *dst, int dst_idx, unsigned long pat void cfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect) { - unsigned long x2, y2, vxres, vyres, height, width, pat, fg; + unsigned long pat, fg; + unsigned long width = rect->width, height = rect->height; int bits = BITS_PER_LONG, bytes = bits >> 3; u32 bpp = p->var.bits_per_pixel; unsigned long __iomem *dst; @@ -353,27 +353,6 @@ void cfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect) if (p->state != FBINFO_STATE_RUNNING) return; - /* We want rotation but lack hardware to do it for us. */ - if (!p->fbops->fb_rotate && p->var.rotate) { - } - - vxres = p->var.xres_virtual; - vyres = p->var.yres_virtual; - - if (!rect->width || !rect->height || - rect->dx > vxres || rect->dy > vyres) - return; - - /* We could use hardware clipping but on many cards you get around - * hardware clipping by writing to framebuffer directly. */ - - x2 = rect->dx + rect->width; - y2 = rect->dy + rect->height; - x2 = x2 < vxres ? x2 : vxres; - y2 = y2 < vyres ? y2 : vyres; - width = x2 - rect->dx; - height = y2 - rect->dy; - if (p->fix.visual == FB_VISUAL_TRUECOLOR || p->fix.visual == FB_VISUAL_DIRECTCOLOR ) fg = ((u32 *) (p->pseudo_palette))[rect->color];