media: ti-vpe: vip: fix try_format for interlaced frames usecase
authorRakesh Movva <r-movva@ti.com>
Mon, 27 Jul 2015 23:38:51 +0000 (18:38 -0500)
committerPraneeth Bajjuri <praneeth@ti.com>
Tue, 4 Aug 2015 21:04:43 +0000 (16:04 -0500)
The try_format call is not comapring the enum_framesizes received
from subdev for interlaced frames.  Added a check for
field == V4L2_FIELD_ALTERNATE as the height defers for interlaced
data.

Change-Id: If16e4d09ff48b4cb36bf9259af77116e3b65e2ff
Signed-off-by: Rakesh Movva <r-movva@ti.com>
drivers/media/platform/ti-vpe/vip.c

index 50f4b1bbddc624e96d6d41e6b13bdbf98089d34e..ab0b961dd1dcaec00ab06e6a76e10dac9949df43 100644 (file)
@@ -1530,7 +1530,9 @@ static int vip_try_fmt_vid_cap(struct file *file, void *priv,
 
                if (fsize.type == V4L2_FRMSIZE_TYPE_DISCRETE) {
                        if ((f->fmt.pix.width == fsize.discrete.width) &&
-                           (f->fmt.pix.height == fsize.discrete.height)) {
+                           (((f->fmt.pix.field == V4L2_FIELD_ALTERNATE) ?
+                           f->fmt.pix.height * 2 : f->fmt.pix.height) ==
+                           fsize.discrete.height)) {
                                found = true;
                                break;
                        }