All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 05/29] atmel_lcdfb: use display information in info not in var for panning
@ 2011-06-14  9:24 Laurent Pinchart
  2011-06-28  8:10 ` [PATCH v2 05/29] atmel_lcdfb: use display information in info Nicolas Ferre
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Laurent Pinchart @ 2011-06-14  9:24 UTC (permalink / raw)
  To: linux-fbdev

We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/video/atmel_lcdfb.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 4484c72..8b5d755 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -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)
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 05/29] atmel_lcdfb: use display information in info
  2011-06-14  9:24 [PATCH v2 05/29] atmel_lcdfb: use display information in info not in var for panning Laurent Pinchart
@ 2011-06-28  8:10 ` Nicolas Ferre
  2011-06-28  9:09 ` [PATCH v2 05/29] atmel_lcdfb: use display information in info not in var for panning Laurent Pinchart
  2011-06-28  9:13 ` [PATCH v2 05/29] atmel_lcdfb: use display information in info Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Nicolas Ferre @ 2011-06-28  8:10 UTC (permalink / raw)
  To: linux-fbdev

Laurent,

Le 14/06/2011 11:24, Laurent Pinchart :
> We must not use any information in the passed var besides xoffset,
> yoffset and vmode as otherwise applications might abuse it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
>  drivers/video/atmel_lcdfb.c |   15 +++++++++------
>  1 files changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> index 4484c72..8b5d755 100644
> --- a/drivers/video/atmel_lcdfb.c
> +++ b/drivers/video/atmel_lcdfb.c
> @@ -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)

------------------------^^^
Wolfram Sang identified this error: it cannot compile!
Thank you Wolfram.

> +		 * 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)


*When* the error will be corrected, you can submit it to linux-fbdev
with my:

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Thanks, best regards,
-- 
Nicolas Ferre


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 05/29] atmel_lcdfb: use display information in info not in var for panning
  2011-06-14  9:24 [PATCH v2 05/29] atmel_lcdfb: use display information in info not in var for panning Laurent Pinchart
  2011-06-28  8:10 ` [PATCH v2 05/29] atmel_lcdfb: use display information in info Nicolas Ferre
@ 2011-06-28  9:09 ` Laurent Pinchart
  2011-06-28  9:13 ` [PATCH v2 05/29] atmel_lcdfb: use display information in info Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2011-06-28  9:09 UTC (permalink / raw)
  To: linux-fbdev

Hi Nicolas,

On Tuesday 28 June 2011 10:10:13 Nicolas Ferre wrote:
> Le 14/06/2011 11:24, Laurent Pinchart :
> > We must not use any information in the passed var besides xoffset,
> > yoffset and vmode as otherwise applications might abuse it.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> > ---
> > 
> >  drivers/video/atmel_lcdfb.c |   15 +++++++++------
> >  1 files changed, 9 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
> > index 4484c72..8b5d755 100644
> > --- a/drivers/video/atmel_lcdfb.c
> > +++ b/drivers/video/atmel_lcdfb.c
> > @@ -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)
> 
> ------------------------^^^
> Wolfram Sang identified this error: it cannot compile!
> Thank you Wolfram.

Oops, sorry for that.

> > +		 * 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)
> 
> *When* the error will be corrected, you can submit it to linux-fbdev
> with my:
> 
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Thank you. I will resubmit fixed patches with your ack.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 05/29] atmel_lcdfb: use display information in info
  2011-06-14  9:24 [PATCH v2 05/29] atmel_lcdfb: use display information in info not in var for panning Laurent Pinchart
  2011-06-28  8:10 ` [PATCH v2 05/29] atmel_lcdfb: use display information in info Nicolas Ferre
  2011-06-28  9:09 ` [PATCH v2 05/29] atmel_lcdfb: use display information in info not in var for panning Laurent Pinchart
@ 2011-06-28  9:13 ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2011-06-28  9:13 UTC (permalink / raw)
  To: linux-fbdev

[-- Attachment #1: Type: text/plain, Size: 616 bytes --]

> > ------------------------^^^
> > Wolfram Sang identified this error: it cannot compile!
> > Thank you Wolfram.
> 
> Oops, sorry for that.

Thanks for fixing the issue :)

> > *When* the error will be corrected, you can submit it to linux-fbdev
> > with my:
> > 
> > Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> 
> Thank you. I will resubmit fixed patches with your ack.

And my

Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-28  9:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-14  9:24 [PATCH v2 05/29] atmel_lcdfb: use display information in info not in var for panning Laurent Pinchart
2011-06-28  8:10 ` [PATCH v2 05/29] atmel_lcdfb: use display information in info Nicolas Ferre
2011-06-28  9:09 ` [PATCH v2 05/29] atmel_lcdfb: use display information in info not in var for panning Laurent Pinchart
2011-06-28  9:13 ` [PATCH v2 05/29] atmel_lcdfb: use display information in info Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.