Esempio n. 1
0
/**
 *	s3cfb_pan_display
 *	@var: frame buffer variable screen structure
 *	@info: frame buffer structure that represents a single frame buffer
 *
 *	Pan (or wrap, depending on the `vmode' field) the display using the
 *	`xoffset' and `yoffset' fields of the `var' structure.
 *	If the values don't fit, return -EINVAL.
 *
 *	Returns negative errno on error, or zero on success.
 */
static int s3cfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
{
	s3c_fb_info_t *fbi = (s3c_fb_info_t *)info;

	DPRINTK("s3c_fb_pan_display(var=%p, info=%p)\n", var, info);
	
	if (var->xoffset != 0)
	{
		printk("%s::var->xoffset(%d)\n", __func__, var->xoffset);
		return -EINVAL;
	}

	if (var->yoffset + info->var.yres > info->var.yres_virtual)
	{
		printk("%s::var->yoffset(%d) + info->var.yres(%d) > info->var.yres_virtual(%d)\n", __func__,
		        var->yoffset, info->var.yres, info->var.yres_virtual);
		return -EINVAL;
	}

	fbi->fb.var.xoffset = var->xoffset;
	fbi->fb.var.yoffset = var->yoffset;

	s3cfb_set_fb_addr(fbi);

	return 0;
}
Esempio n. 2
0
/**
 *	s3cfb_pan_display
 *	@var: frame buffer variable screen structure
 *	@info: frame buffer structure that represents a single frame buffer
 *
 *	Pan (or wrap, depending on the `vmode' field) the display using the
 *	`xoffset' and `yoffset' fields of the `var' structure.
 *	If the values don't fit, return -EINVAL.
 *
 *	Returns negative errno on error, or zero on success.
 */
static int s3cfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
{
	struct s3c_fb_info *fbi = (struct s3c_fb_info *)info;

	/*
	 * All values are checked for correctness in fbmem.c,
	 * so let's just apply the new parameters.
	 */

	fbi->fb_start_addr = fbi->map_dma + var->yoffset * fbi->fb.fix.line_length;
	fbi->fb_end_addr = fbi->fb_start_addr + var->yres * fbi->fb.fix.line_length;

	s3cfb_set_fb_addr(fbi);

	return 0;
}
Esempio n. 3
0
/**
 *	s3cfb_pan_display
 *	@var: frame buffer variable screen structure
 *	@info: frame buffer structure that represents a single frame buffer
 *
 *	Pan (or wrap, depending on the `vmode' field) the display using the
 *	`xoffset' and `yoffset' fields of the `var' structure.
 *	If the values don't fit, return -EINVAL.
 *
 *	Returns negative errno on error, or zero on success.
 */
static int s3cfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
{
	s3cfb_info_t *fbi = (s3cfb_info_t *)info;

	DPRINTK("s3c_fb_pan_display(var=%p, info=%p)\n", var, info);

	if (var->xoffset != 0)
		return -EINVAL;

	if (var->yoffset + info->var.yres > info->var.yres_virtual)
		return -EINVAL;

	fbi->fb.var.xoffset = var->xoffset;
	fbi->fb.var.yoffset = var->yoffset;

	s3cfb_set_fb_addr(fbi);

	return 0;
}