diff options
author | Liu Ying <Ying.Liu@freescale.com> | 2015-06-09 10:20:00 +0800 |
---|---|---|
committer | Liu Ying <Ying.Liu@freescale.com> | 2015-06-09 15:39:25 +0800 |
commit | 75153a91382c85c7ba8e56e46bdb3b8d125be40b (patch) | |
tree | 2e6c58233a7dc4861589cecc1b71bedfc0be577d | |
parent | 1697eb6715294dc6671746718f3e3f3ea056ec7b (diff) |
MLK-11066 video: mxc ipuv3 fb: check tile block after blank check in pan display
We may wrongly check tile block in pan display for a linear framebuffer in the
following case:
step 1) framebuffer works in linear RGB24 pixel format(unblanked)
step 2) blank the framebuffer
step 3) change framebuffer to be a GPU tile format
step 4) change framebuffer back to linear RGB24 pixel format
The cached variable mxc_fbi->cur_var will not change in all of the 4 steps
because the framebuffer is blanked in step 2). In step 3), the format change
is successful since step 2) to 3) would definitely changes the pixel format
from linear RGB24 to a GPU tile format - mxc_fbi->cur_var is not the same
to fbi->var, which leads to mxcfb_need_to_set_par() returns true. However,
in step 4), the format change is not successful since mxc_fbi->cur_var and
fbi->var is the same, which leads to mxcfb_need_to_set_par() returns false.
Note that we set mxc_fbi->resolve to be true in step 3), so it keeps to be
true in step 4) as we return at mxcfb_need_to_set_par() before we may change
it to be false. Finally, in step 4), after doing ->fb_set_par() in
fb_set_var(), we do fb_pan_display() and wrongly check tile block for the
linear RGB24 pixel format as mxc_fbi->resolve is true - hit the BUG_ON() in
fmt_to_tile_block(). To fix this issue, this patch moves the code for tile
block check down below blank check in ->fb_pan_display().
Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
(cherry picked from commit f1889f599400d9cc766fba09e709434cbca33fd2)
-rw-r--r-- | drivers/video/mxc/mxc_ipuv3_fb.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/video/mxc/mxc_ipuv3_fb.c b/drivers/video/mxc/mxc_ipuv3_fb.c index 7afe9ed1e785..b699c44df25d 100644 --- a/drivers/video/mxc/mxc_ipuv3_fb.c +++ b/drivers/video/mxc/mxc_ipuv3_fb.c @@ -2314,17 +2314,6 @@ mxcfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) int i; int ret; - if (mxc_fbi->resolve) { - fmt_to_tile_block(info->var.nonstd, &bw, &bh); - - if (mxc_fbi->cur_var.xoffset % bw != var->xoffset % bw || - mxc_fbi->cur_var.yoffset % bh != var->yoffset % bh) { - dev_err(info->device, "do not support panning " - "with tile crop settings changed\n"); - return -EINVAL; - } - } - /* no pan display during fb blank */ if (mxc_fbi->ipu_ch == MEM_FG_SYNC) { struct mxcfb_info *bg_mxcfbi = NULL; @@ -2341,6 +2330,17 @@ mxcfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) if (mxc_fbi->cur_blank != FB_BLANK_UNBLANK) return -EINVAL; + if (mxc_fbi->resolve) { + fmt_to_tile_block(info->var.nonstd, &bw, &bh); + + if (mxc_fbi->cur_var.xoffset % bw != var->xoffset % bw || + mxc_fbi->cur_var.yoffset % bh != var->yoffset % bh) { + dev_err(info->device, "do not support panning " + "with tile crop settings changed\n"); + return -EINVAL; + } + } + y_bottom = var->yoffset; if (y_bottom > info->var.yres_virtual) |