aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/cfbimgblt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/cfbimgblt.c')
-rw-r--r--drivers/video/cfbimgblt.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/video/cfbimgblt.c b/drivers/video/cfbimgblt.c
index 4c123abaa843..da664cea7eca 100644
--- a/drivers/video/cfbimgblt.c
+++ b/drivers/video/cfbimgblt.c
@@ -272,33 +272,13 @@ void cfb_imageblit(struct fb_info *p, const struct fb_image *image)
272{ 272{
273 u32 fgcolor, bgcolor, start_index, bitstart, pitch_index = 0; 273 u32 fgcolor, bgcolor, start_index, bitstart, pitch_index = 0;
274 u32 bpl = sizeof(u32), bpp = p->var.bits_per_pixel; 274 u32 bpl = sizeof(u32), bpp = p->var.bits_per_pixel;
275 u32 width = image->width, height = image->height; 275 u32 width = image->width;
276 u32 dx = image->dx, dy = image->dy; 276 u32 dx = image->dx, dy = image->dy;
277 int x2, y2, vxres, vyres;
278 u8 __iomem *dst1; 277 u8 __iomem *dst1;
279 278
280 if (p->state != FBINFO_STATE_RUNNING) 279 if (p->state != FBINFO_STATE_RUNNING)
281 return; 280 return;
282 281
283 vxres = p->var.xres_virtual;
284 vyres = p->var.yres_virtual;
285 /*
286 * We could use hardware clipping but on many cards you get around
287 * hardware clipping by writing to framebuffer directly like we are
288 * doing here.
289 */
290 if (image->dx > vxres || image->dy > vyres)
291 return;
292
293 x2 = image->dx + image->width;
294 y2 = image->dy + image->height;
295 dx = image->dx > 0 ? image->dx : 0;
296 dy = image->dy > 0 ? image->dy : 0;
297 x2 = x2 < vxres ? x2 : vxres;
298 y2 = y2 < vyres ? y2 : vyres;
299 width = x2 - dx;
300 height = y2 - dy;
301
302 bitstart = (dy * p->fix.line_length * 8) + (dx * bpp); 282 bitstart = (dy * p->fix.line_length * 8) + (dx * bpp);
303 start_index = bitstart & (32 - 1); 283 start_index = bitstart & (32 - 1);
304 pitch_index = (p->fix.line_length & (bpl - 1)) * 8; 284 pitch_index = (p->fix.line_length & (bpl - 1)) * 8;