diff options
author | Robby Cai <R63905@freescale.com> | 2013-12-25 02:46:37 -0500 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:47:31 -0400 |
commit | 40205c7fd8b37d7670f229c677db38f322b34be4 (patch) | |
tree | 31c98553b749f435f26b0a52b56dcee18bd86200 /drivers/media | |
parent | c60c2626756cdf54d48bd6070f25928b2edf6088 (diff) |
ENGR00293132-2 pxp/v4l2: restore smem_start for framebuffer even exit abnormally
Previously, the framebuffer for UI display may only be restored after
STREAMOFF ioctl is called. But sometimes the application may exit abnormally
(without call STREAMOFF) for some reason. Now restore previously-saved
smem_start in release function to make sure it's set correctly, to avoid some
video frame remain.
Signed-off-by: Robby Cai <R63905@freescale.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/mxc/output/mxc_pxp_v4l2.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c b/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c index 08ea59ab5510..dc078320acb0 100644 --- a/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c +++ b/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c | |||
@@ -317,14 +317,18 @@ static int _get_cur_fb_blank(struct pxps *pxp) | |||
317 | return err; | 317 | return err; |
318 | } | 318 | } |
319 | 319 | ||
320 | static int pxp_show_buf(struct pxps *pxp, bool toshow) | 320 | static int pxp_show_buf(struct pxps *pxp, unsigned long paddr) |
321 | { | 321 | { |
322 | struct fb_info *fbi = pxp->fbi; | 322 | struct fb_info *fbi = pxp->fbi; |
323 | int ret; | 323 | int ret = -EINVAL; |
324 | |||
325 | if (paddr == 0) { | ||
326 | dev_err(&pxp->pdev->dev, "Invalid paddr\n"); | ||
327 | return ret; | ||
328 | } | ||
324 | 329 | ||
325 | console_lock(); | 330 | console_lock(); |
326 | fbi->fix.smem_start = toshow ? | 331 | fbi->fix.smem_start = paddr; |
327 | pxp->outbuf.paddr : (unsigned long)pxp->fb.base; | ||
328 | ret = fb_pan_display(fbi, &fbi->var); | 332 | ret = fb_pan_display(fbi, &fbi->var); |
329 | console_unlock(); | 333 | console_unlock(); |
330 | 334 | ||
@@ -675,7 +679,7 @@ static int pxp_streamon(struct file *file, void *priv, | |||
675 | ret = videobuf_streamon(&pxp->s0_vbq); | 679 | ret = videobuf_streamon(&pxp->s0_vbq); |
676 | 680 | ||
677 | if (!ret && (pxp->output == 0)) | 681 | if (!ret && (pxp->output == 0)) |
678 | pxp_show_buf(pxp, true); | 682 | pxp_show_buf(pxp, pxp->outbuf.paddr); |
679 | 683 | ||
680 | return ret; | 684 | return ret; |
681 | } | 685 | } |
@@ -691,8 +695,7 @@ static int pxp_streamoff(struct file *file, void *priv, | |||
691 | 695 | ||
692 | ret = videobuf_streamoff(&pxp->s0_vbq); | 696 | ret = videobuf_streamoff(&pxp->s0_vbq); |
693 | 697 | ||
694 | if (!ret) | 698 | pxp_show_buf(pxp, (unsigned long)pxp->fb.base); |
695 | pxp_show_buf(pxp, false); | ||
696 | 699 | ||
697 | if (pxp->fb_blank) | 700 | if (pxp->fb_blank) |
698 | set_fb_blank(FB_BLANK_POWERDOWN); | 701 | set_fb_blank(FB_BLANK_POWERDOWN); |
@@ -1124,6 +1127,7 @@ static int pxp_close(struct file *file) | |||
1124 | { | 1127 | { |
1125 | struct pxps *pxp = video_get_drvdata(video_devdata(file)); | 1128 | struct pxps *pxp = video_get_drvdata(video_devdata(file)); |
1126 | 1129 | ||
1130 | pxp_streamoff(file, NULL, V4L2_BUF_TYPE_VIDEO_OUTPUT); | ||
1127 | videobuf_stop(&pxp->s0_vbq); | 1131 | videobuf_stop(&pxp->s0_vbq); |
1128 | videobuf_mmap_free(&pxp->s0_vbq); | 1132 | videobuf_mmap_free(&pxp->s0_vbq); |
1129 | pxp->active = NULL; | 1133 | pxp->active = NULL; |