aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-08-31 07:00:55 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-09-05 12:37:14 -0400
commitdc1d5adab5cc57eb732407d80c9e7ae48891ffca (patch)
treef175232ed9e28871eaafef9bb47646ef8861296e
parented5bebf29e82beab3456901e26a495ae0a49ebad (diff)
fbdev: sh_mobile_lcdc: use display information in info for panning
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> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-rw-r--r--drivers/video/sh_mobile_lcdcfb.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index f9f420d3c403..1ff215c42c41 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -877,12 +877,12 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
877 unsigned long base_addr_y, base_addr_c; 877 unsigned long base_addr_y, base_addr_c;
878 unsigned long c_offset; 878 unsigned long c_offset;
879 879
880 if (!var->nonstd) 880 if (!info->var.nonstd)
881 new_pan_offset = (var->yoffset * info->fix.line_length) + 881 new_pan_offset = var->yoffset * info->fix.line_length
882 (var->xoffset * (info->var.bits_per_pixel / 8)); 882 + var->xoffset * (info->var.bits_per_pixel / 8);
883 else 883 else
884 new_pan_offset = (var->yoffset * info->fix.line_length) + 884 new_pan_offset = var->yoffset * info->fix.line_length
885 (var->xoffset); 885 + var->xoffset;
886 886
887 if (new_pan_offset == ch->pan_offset) 887 if (new_pan_offset == ch->pan_offset)
888 return 0; /* No change, do nothing */ 888 return 0; /* No change, do nothing */
@@ -891,13 +891,13 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
891 891
892 /* Set the source address for the next refresh */ 892 /* Set the source address for the next refresh */
893 base_addr_y = ch->dma_handle + new_pan_offset; 893 base_addr_y = ch->dma_handle + new_pan_offset;
894 if (var->nonstd) { 894 if (info->var.nonstd) {
895 /* Set y offset */ 895 /* Set y offset */
896 c_offset = (var->yoffset * 896 c_offset = var->yoffset * info->fix.line_length
897 info->fix.line_length * 897 * (info->var.bits_per_pixel - 8) / 8;
898 (info->var.bits_per_pixel - 8)) / 8; 898 base_addr_c = ch->dma_handle
899 base_addr_c = ch->dma_handle + var->xres * var->yres_virtual + 899 + info->var.xres * info->var.yres_virtual
900 c_offset; 900 + c_offset;
901 /* Set x offset */ 901 /* Set x offset */
902 if (info->var.bits_per_pixel == 24) 902 if (info->var.bits_per_pixel == 24)
903 base_addr_c += 2 * var->xoffset; 903 base_addr_c += 2 * var->xoffset;
@@ -923,7 +923,7 @@ static int sh_mobile_fb_pan_display(struct fb_var_screeninfo *var,
923 ch->base_addr_c = base_addr_c; 923 ch->base_addr_c = base_addr_c;
924 924
925 lcdc_write_chan_mirror(ch, LDSA1R, base_addr_y); 925 lcdc_write_chan_mirror(ch, LDSA1R, base_addr_y);
926 if (var->nonstd) 926 if (info->var.nonstd)
927 lcdc_write_chan_mirror(ch, LDSA2R, base_addr_c); 927 lcdc_write_chan_mirror(ch, LDSA2R, base_addr_c);
928 928
929 if (lcdc_chan_is_sublcd(ch)) 929 if (lcdc_chan_is_sublcd(ch))