aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/cfbfillrect.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/cfbfillrect.c')
-rw-r--r--drivers/video/cfbfillrect.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/drivers/video/cfbfillrect.c b/drivers/video/cfbfillrect.c
index e4fc42b013eb..167d9314e6eb 100644
--- a/drivers/video/cfbfillrect.c
+++ b/drivers/video/cfbfillrect.c
@@ -344,7 +344,8 @@ bitfill_unaligned_rev(unsigned long __iomem *dst, int dst_idx, unsigned long pat
344 344
345void cfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect) 345void cfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
346{ 346{
347 unsigned long x2, y2, vxres, vyres, height, width, pat, fg; 347 unsigned long pat, fg;
348 unsigned long width = rect->width, height = rect->height;
348 int bits = BITS_PER_LONG, bytes = bits >> 3; 349 int bits = BITS_PER_LONG, bytes = bits >> 3;
349 u32 bpp = p->var.bits_per_pixel; 350 u32 bpp = p->var.bits_per_pixel;
350 unsigned long __iomem *dst; 351 unsigned long __iomem *dst;
@@ -353,27 +354,6 @@ void cfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
353 if (p->state != FBINFO_STATE_RUNNING) 354 if (p->state != FBINFO_STATE_RUNNING)
354 return; 355 return;
355 356
356 /* We want rotation but lack hardware to do it for us. */
357 if (!p->fbops->fb_rotate && p->var.rotate) {
358 }
359
360 vxres = p->var.xres_virtual;
361 vyres = p->var.yres_virtual;
362
363 if (!rect->width || !rect->height ||
364 rect->dx > vxres || rect->dy > vyres)
365 return;
366
367 /* We could use hardware clipping but on many cards you get around
368 * hardware clipping by writing to framebuffer directly. */
369
370 x2 = rect->dx + rect->width;
371 y2 = rect->dy + rect->height;
372 x2 = x2 < vxres ? x2 : vxres;
373 y2 = y2 < vyres ? y2 : vyres;
374 width = x2 - rect->dx;
375 height = y2 - rect->dy;
376
377 if (p->fix.visual == FB_VISUAL_TRUECOLOR || 357 if (p->fix.visual == FB_VISUAL_TRUECOLOR ||
378 p->fix.visual == FB_VISUAL_DIRECTCOLOR ) 358 p->fix.visual == FB_VISUAL_DIRECTCOLOR )
379 fg = ((u32 *) (p->pseudo_palette))[rect->color]; 359 fg = ((u32 *) (p->pseudo_palette))[rect->color];