Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c470f33 authored by Florian Tobias Schandinat's avatar Florian Tobias Schandinat
Browse files

Merge branch 'pan-fixes' of git://linuxtv.org/pinchartl/fbdev into fbdev-next

parents fcb8ce5c 0d5c6ca3
Loading
Loading
Loading
Loading
+6 −16
Original line number Diff line number Diff line
@@ -1364,26 +1364,16 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
}

#ifdef XGIFB_PAN
static int XGIfb_pan_var(struct fb_var_screeninfo *var)
static int XGIfb_pan_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
	unsigned int base;

	/* printk("Inside pan_var"); */

	if (var->xoffset > (var->xres_virtual - var->xres)) {
		/* printk("Pan: xo: %d xv %d xr %d\n",
			var->xoffset, var->xres_virtual, var->xres); */
		return -EINVAL;
	}
	if (var->yoffset > (var->yres_virtual - var->yres)) {
		/* printk("Pan: yo: %d yv %d yr %d\n",
			var->yoffset, var->yres_virtual, var->yres); */
		return -EINVAL;
	}
	base = var->yoffset * var->xres_virtual + var->xoffset;
	base = var->yoffset * info->var.xres_virtual + var->xoffset;

	/* calculate base bpp dep. */
	switch (var->bits_per_pixel) {
	switch (info->var.bits_per_pixel) {
	case 16:
		base >>= 1;
		break;
@@ -1681,9 +1671,9 @@ static int XGIfb_pan_display(struct fb_var_screeninfo *var,

	/* printk("\nInside pan_display:\n"); */

	if (var->xoffset > (var->xres_virtual - var->xres))
	if (var->xoffset > (info->var.xres_virtual - info->var.xres))
		return -EINVAL;
	if (var->yoffset > (var->yres_virtual - var->yres))
	if (var->yoffset > (info->var.yres_virtual - info->var.yres))
		return -EINVAL;

	if (var->vmode & FB_VMODE_YWRAP) {
@@ -1696,7 +1686,7 @@ static int XGIfb_pan_display(struct fb_var_screeninfo *var,
						> info->var.yres_virtual)
			return -EINVAL;
	}
	err = XGIfb_pan_var(var);
	err = XGIfb_pan_var(var, info);
	if (err < 0)
		return err;

+2 −2
Original line number Diff line number Diff line
@@ -378,8 +378,8 @@ static int mc68x328fb_pan_display(struct fb_var_screeninfo *var,
		    || var->xoffset)
			return -EINVAL;
	} else {
		if (var->xoffset + var->xres > info->var.xres_virtual ||
		    var->yoffset + var->yres > info->var.yres_virtual)
		if (var->xoffset + info->var.xres > info->var.xres_virtual ||
		    var->yoffset + info->var.yres > info->var.yres_virtual)
			return -EINVAL;
	}
	info->var.xoffset = var->xoffset;
+3 −2
Original line number Diff line number Diff line
@@ -850,9 +850,10 @@ acornfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
	u_int y_bottom = var->yoffset;

	if (!(var->vmode & FB_VMODE_YWRAP))
		y_bottom += var->yres;
		y_bottom += info->var.yres;

	BUG_ON(y_bottom > var->yres_virtual);
	if (y_bottom > info->var.yres_virtual)
		return -EINVAL;

	acornfb_update_dma(info, var);

+5 −4
Original line number Diff line number Diff line
@@ -908,13 +908,14 @@ static int arkfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info
	unsigned int offset;

	/* Calculate the offset */
	if (var->bits_per_pixel == 0) {
		offset = (var->yoffset / 16) * (var->xres_virtual / 2) + (var->xoffset / 2);
	if (info->var.bits_per_pixel == 0) {
		offset = (var->yoffset / 16) * (info->var.xres_virtual / 2)
		       + (var->xoffset / 2);
		offset = offset >> 2;
	} else {
		offset = (var->yoffset * info->fix.line_length) +
			 (var->xoffset * var->bits_per_pixel / 8);
		offset = offset >> ((var->bits_per_pixel == 4) ? 2 : 3);
			 (var->xoffset * info->var.bits_per_pixel / 8);
		offset = offset >> ((info->var.bits_per_pixel == 4) ? 2 : 3);
	}

	/* Set the offset */
+9 −6
Original line number Diff line number Diff line
@@ -39,7 +39,8 @@
					 | FBINFO_HWACCEL_YPAN)

static inline void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo,
					struct fb_var_screeninfo *var)
					struct fb_var_screeninfo *var,
					struct fb_info *info)
{

}
@@ -50,14 +51,16 @@ static inline void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo,
					| FBINFO_HWACCEL_YPAN)

static void atmel_lcdfb_update_dma2d(struct atmel_lcdfb_info *sinfo,
				     struct fb_var_screeninfo *var)
				     struct fb_var_screeninfo *var,
				     struct fb_info *info)
{
	u32 dma2dcfg;
	u32 pixeloff;

	pixeloff = (var->xoffset * var->bits_per_pixel) & 0x1f;
	pixeloff = (var->xoffset * info->var.bits_per_pixel) & 0x1f;

	dma2dcfg = ((var->xres_virtual - var->xres) * var->bits_per_pixel) / 8;
	dma2dcfg = (info->var.xres_virtual - info->var.xres)
		 * info->var.bits_per_pixel / 8;
	dma2dcfg |= pixeloff << ATMEL_LCDC_PIXELOFF_OFFSET;
	lcdc_writel(sinfo, ATMEL_LCDC_DMA2DCFG, dma2dcfg);

@@ -249,14 +252,14 @@ static void atmel_lcdfb_update_dma(struct fb_info *info,
	unsigned long dma_addr;

	dma_addr = (fix->smem_start + var->yoffset * fix->line_length
		    + var->xoffset * var->bits_per_pixel / 8);
		    + var->xoffset * info->var.bits_per_pixel / 8);

	dma_addr &= ~3UL;

	/* Set framebuffer DMA base address and pixel offset */
	lcdc_writel(sinfo, ATMEL_LCDC_DMABADDR1, dma_addr);

	atmel_lcdfb_update_dma2d(sinfo, var);
	atmel_lcdfb_update_dma2d(sinfo, var, info);
}

static inline void atmel_lcdfb_free_video_memory(struct atmel_lcdfb_info *sinfo)
Loading