]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00291111 mxc vout:Restore when new config fails
authorLiu Ying <Ying.Liu@freescale.com>
Tue, 10 Dec 2013 09:28:09 +0000 (17:28 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:48 +0000 (10:06 +0200)
Users may call VIDIOC_S_CTRL and VIDIOC_S_CROP ioctrls
to change rotation and cropping settings when streaming.
The driver should restore the original settings if new
configuration fails, otherwise, it might break the
present pipeline.

This patch fixes the issue which can be reproduced by
this test case with a 1080P HDMI primary display:
gplay Mpeg4_SP1_480x260_24_1200_aac_48_128_2_terminator3.mp4
Type 't' to set rotation to 90.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
drivers/media/platform/mxc/output/mxc_vout.c

index 05b9d93f8cb5d8bb57eed5329c78fa9feb2501dd..bd7d1f0446f33dbf3359db116f73cd7602ebaaed 100644 (file)
@@ -1515,6 +1515,7 @@ static int mxc_vidioc_s_crop(struct file *file, void *fh,
                if (ret < 0) {
                        v4l2_err(vout->vfd->v4l2_dev,
                                        "vout check task failed\n");
+                       memcpy(vout, pre_vout, sizeof(*vout));
                        goto done;
                }
 
@@ -1683,6 +1684,7 @@ static int mxc_vidioc_s_ctrl(struct file *file, void *fh,
                if (ret < 0) {
                        v4l2_err(vout->vfd->v4l2_dev,
                                        "vout check task failed\n");
+                       memcpy(vout, pre_vout, sizeof(*vout));
                        goto done;
                }