diff options
Diffstat (limited to 'drivers/video/cfbcopyarea.c')
-rw-r--r-- | drivers/video/cfbcopyarea.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/drivers/video/cfbcopyarea.c b/drivers/video/cfbcopyarea.c index 67711f7b11b1..cdc71572cf35 100644 --- a/drivers/video/cfbcopyarea.c +++ b/drivers/video/cfbcopyarea.c | |||
@@ -349,46 +349,10 @@ void cfb_copyarea(struct fb_info *p, const struct fb_copyarea *area) | |||
349 | unsigned long __iomem *dst = NULL, *src = NULL; | 349 | unsigned long __iomem *dst = NULL, *src = NULL; |
350 | int bits = BITS_PER_LONG, bytes = bits >> 3; | 350 | int bits = BITS_PER_LONG, bytes = bits >> 3; |
351 | int dst_idx = 0, src_idx = 0, rev_copy = 0; | 351 | int dst_idx = 0, src_idx = 0, rev_copy = 0; |
352 | int x2, y2, vxres, vyres; | ||
353 | 352 | ||
354 | if (p->state != FBINFO_STATE_RUNNING) | 353 | if (p->state != FBINFO_STATE_RUNNING) |
355 | return; | 354 | return; |
356 | 355 | ||
357 | /* We want rotation but lack hardware to do it for us. */ | ||
358 | if (!p->fbops->fb_rotate && p->var.rotate) { | ||
359 | } | ||
360 | |||
361 | vxres = p->var.xres_virtual; | ||
362 | vyres = p->var.yres_virtual; | ||
363 | |||
364 | if (area->dx > vxres || area->sx > vxres || | ||
365 | area->dy > vyres || area->sy > vyres) | ||
366 | return; | ||
367 | |||
368 | /* clip the destination | ||
369 | * We could use hardware clipping but on many cards you get around | ||
370 | * hardware clipping by writing to framebuffer directly. | ||
371 | */ | ||
372 | x2 = area->dx + area->width; | ||
373 | y2 = area->dy + area->height; | ||
374 | dx = area->dx > 0 ? area->dx : 0; | ||
375 | dy = area->dy > 0 ? area->dy : 0; | ||
376 | x2 = x2 < vxres ? x2 : vxres; | ||
377 | y2 = y2 < vyres ? y2 : vyres; | ||
378 | width = x2 - dx; | ||
379 | height = y2 - dy; | ||
380 | |||
381 | if ((width==0) ||(height==0)) | ||
382 | return; | ||
383 | |||
384 | /* update sx1,sy1 */ | ||
385 | sx += (dx - area->dx); | ||
386 | sy += (dy - area->dy); | ||
387 | |||
388 | /* the source must be completely inside the virtual screen */ | ||
389 | if (sx < 0 || sy < 0 || (sx + width) > vxres || (sy + height) > vyres) | ||
390 | return; | ||
391 | |||
392 | /* if the beginning of the target area might overlap with the end of | 356 | /* if the beginning of the target area might overlap with the end of |
393 | the source area, be have to copy the area reverse. */ | 357 | the source area, be have to copy the area reverse. */ |
394 | if ((dy == sy && dx > sx) || (dy > sy)) { | 358 | if ((dy == sy && dx > sx) || (dy > sy)) { |