Skip to content

Commit

Permalink
mxc_ipuv3_fb: clear frame buffer when line length changes
Browse files Browse the repository at this point in the history
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
  • Loading branch information
tkisky committed Jan 13, 2021
1 parent 5272544 commit d1c9594
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/video/fbdev/mxc/mxc_ipuv3_fb.c
Expand Up @@ -1147,6 +1147,7 @@ static int mxcfb_set_par(struct fb_info *fbi)
struct mxcfb_info *mxc_fbi_fg = NULL;
bool ovfbi_enable = false, on_the_fly;
ipu_channel_params_t params;
int prev_line_length;

if (ipu_ch_param_bad_alpha_pos(FB_PIX(fbi)) &&
mxc_fbi->alpha_chan_en) {
Expand All @@ -1170,6 +1171,7 @@ static int mxcfb_set_par(struct fb_info *fbi)
if (fbi->var.xres == 0 || fbi->var.yres == 0)
return 0;

prev_line_length = fbi->fix.line_length;
mxcfb_set_fix(fbi);

mxcfb_check_resolve(fbi);
Expand Down Expand Up @@ -1255,6 +1257,11 @@ static int mxcfb_set_par(struct fb_info *fbi)

if (mxcfb_map_video_memory(fbi) < 0)
return -ENOMEM;
} else {
if (prev_line_length && (prev_line_length != fbi->fix.line_length)) {
memset((char *)fbi->screen_base, 0, fbi->fix.smem_len);
mxc_fbi->first_set_par = false;
}
}

if (mxc_fbi->first_set_par) {
Expand Down

0 comments on commit d1c9594

Please sign in to comment.