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 (area->dx > vxres || area->sx > vxres || area->dy > vyres || area->sy > vyres) return;  /* clip the destination * We could use hardware clipping but on many cards you get around * hardware clipping by writing to framebuffer directly. */ x2 = area->dx + area->width; y2 = area->dy + area->height; dx = area->dx > 0 ? area->dx : 0; dy = area->dy > 0 ? area->dy : 0; x2 = x2 < vxres ? x2 : vxres; y2 = y2 < vyres ? y2 : vyres; width = x2 - dx; height = y2 - dy;  if ((width==0) ||(height==0)) return;  /* update sx1,sy1 */ sx += (dx - area->dx); sy += (dy - area->dy);  /* the source must be completely inside the virtual screen */ if (sx < 0 || sy < 0 || (sx + width) > vxres || (sy + height) > vyres) 
void cfb_copyarea(struct fb_info *p, const struct fb_copyarea *area){	u32 dx = area->dx, dy = area->dy, sx = area->sx, sy = area->sy;	u32 height = area->height, width = area->width;	unsigned long const bits_per_line = p->fix.line_length*8u;	unsigned long __iomem *dst = NULL, *src = NULL;	int bits = BITS_PER_LONG, bytes = bits >> 3;	int dst_idx = 0, src_idx = 0, rev_copy = 0;	int x2, y2, vxres, vyres;	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 (area->dx > vxres || area->sx > vxres ||	    area->dy > vyres || area->sy > vyres)		return;	/* clip the destination	 * We could use hardware clipping but on many cards you get around	 * hardware clipping by writing to framebuffer directly.	 */	x2 = area->dx + area->width;	y2 = area->dy + area->height;	dx = area->dx > 0 ? area->dx : 0;	dy = area->dy > 0 ? area->dy : 0;	x2 = x2 < vxres ? x2 : vxres;	y2 = y2 < vyres ? y2 : vyres;	width = x2 - dx;	height = y2 - dy;	if ((width==0) ||(height==0))		return;	/* update sx1,sy1 */	sx += (dx - area->dx);	sy += (dy - area->dy);	/* the source must be completely inside the virtual screen */	if (sx < 0 || sy < 0 || (sx + width) > vxres || (sy + height) > vyres)		return;	/* if the beginning of the target area might overlap with the end of	the source area, be have to copy the area reverse. */	if ((dy == sy && dx > sx) || (dy > sy)) {		dy += height;		sy += height;		rev_copy = 1;	}	// split the base of the framebuffer into a long-aligned address and the	// index of the first bit	dst = src = (unsigned long __iomem *)((unsigned long)p->screen_base & ~(bytes-1));	dst_idx = src_idx = 8*((unsigned long)p->screen_base & (bytes-1));	// add offset of source and target area	dst_idx += dy*bits_per_line + dx*p->var.bits_per_pixel;	src_idx += sy*bits_per_line + sx*p->var.bits_per_pixel;	if (p->fbops->fb_sync)		p->fbops->fb_sync(p);	if (rev_copy) {		while (height--) {			dst_idx -= bits_per_line;			src_idx -= bits_per_line;			dst += dst_idx >> (ffs(bits) - 1);			dst_idx &= (bytes - 1);			src += src_idx >> (ffs(bits) - 1);			src_idx &= (bytes - 1);			bitcpy_rev(dst, dst_idx, src, src_idx, bits,				width*p->var.bits_per_pixel);		}	} else {		while (height--) {			dst += dst_idx >> (ffs(bits) - 1);			dst_idx &= (bytes - 1);			src += src_idx >> (ffs(bits) - 1);			src_idx &= (bytes - 1);			bitcpy(dst, dst_idx, src, src_idx, bits,				width*p->var.bits_per_pixel);			dst_idx += bits_per_line;			src_idx += bits_per_line;		}	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b4d8aea6d66aabc1d79aaeb1ecc90562abb8f575/cfbcopyarea.c/buggy/drivers/video/cfbcopyarea.c