提交 dcdf2f7e 编写于 作者: A Anatolij Gustschin

video: mb862xxfb: correct fix.smem_len field initialization

Initialize smem_len field to the actual frame buffer size and
not to the whole video RAM size. This prevents overwriting
other video memory (which could be used by other layers, cursors
or accelerated drivers) by frame buffer applications relying on
fix.smem_len.
Signed-off-by: NAnatolij Gustschin <agust@denx.de>
上级 af1ce6b2
...@@ -336,7 +336,6 @@ static int mb862xxfb_init_fbinfo(struct fb_info *fbi) ...@@ -336,7 +336,6 @@ static int mb862xxfb_init_fbinfo(struct fb_info *fbi)
strcpy(fbi->fix.id, DRV_NAME); strcpy(fbi->fix.id, DRV_NAME);
fbi->fix.smem_start = (unsigned long)par->fb_base_phys; fbi->fix.smem_start = (unsigned long)par->fb_base_phys;
fbi->fix.smem_len = par->mapped_vram;
fbi->fix.mmio_start = (unsigned long)par->mmio_base_phys; fbi->fix.mmio_start = (unsigned long)par->mmio_base_phys;
fbi->fix.mmio_len = par->mmio_len; fbi->fix.mmio_len = par->mmio_len;
fbi->fix.accel = FB_ACCEL_NONE; fbi->fix.accel = FB_ACCEL_NONE;
...@@ -420,6 +419,7 @@ static int mb862xxfb_init_fbinfo(struct fb_info *fbi) ...@@ -420,6 +419,7 @@ static int mb862xxfb_init_fbinfo(struct fb_info *fbi)
FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
fbi->fix.line_length = (fbi->var.xres_virtual * fbi->fix.line_length = (fbi->var.xres_virtual *
fbi->var.bits_per_pixel) / 8; fbi->var.bits_per_pixel) / 8;
fbi->fix.smem_len = fbi->fix.line_length * fbi->var.yres_virtual;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册