# \[PATCH v2 27/29\] vt8500lcdfb: use display information in info not in var for panning

- Subsystems: FRAMEBUFFER LAYER, THE REST
- Maintainers: Helge Deller, Linus Torvalds
- Status: REVIEWED · 1 review, 1 by a maintainer (M Alexey Charkov)
- Reviewed.
- 1 review trailer.
- List: linux-fbdev
- 1 message, 1 author
- Page: https://ratatoskr.run/linux-fbdev/2011/06/13461655/t

## \[PATCH v2 27/29\] vt8500lcdfb: use display information in info not in var for panning

- From: Laurent Pinchart \<laurent.pinchart@ideasonboard.com\>
- Date: 2011-06-14 09:25:05 
- Message: https://ratatoskr.run/linux-fbdev/2011/06/13461655.md

```text
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>
Acked-by: Alexey Charkov <alchark@gmail.com>
---
 drivers/video/vt8500lcdfb.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/vt8500lcdfb.c b/drivers/video/vt8500lcdfb.c
index 0e120d6..c13c246 100644
--- a/drivers/video/vt8500lcdfb.c
+++ b/drivers/video/vt8500lcdfb.c
@@ -210,8 +210,8 @@ static int vt8500lcd_pan_display(struct fb_var_screeninfo *var,
 	struct vt8500lcd_info *fbi = to_vt8500lcd_info(info);
 
 	writel((1 << 31)
-		| (((var->xres_virtual - var->xres) * pixlen / 4) << 20)
-		| (off >> 2), fbi->regbase + 0x20);
+	     | (((info->var.xres_virtual - info->var.xres) * pixlen / 4) << 20)
+	     | (off >> 2), fbi->regbase + 0x20);
 	return 0;
 }
 
-- 
1.7.3.4

```
