[media] s5p-fimc: fimc-lite: Propagate frame format on the subdev
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Fri, 31 Aug 2012 15:50:45 +0000 (12:50 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 1 Oct 2012 22:25:34 +0000 (19:25 -0300)
When setting image format on subdev's sink pad there was no
propagation to the source pad. This resulted in wrong reported
format on the source pad and wrong device configuration when
used from subdev interace level only. Correct this by propagating
format from the sink to the source pad.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/s5p-fimc/fimc-lite.c

index 928900842715e9110b932340eb0187af8f4ad725..cd4cf12d20e3a4afb976a590f56baa9b29397b37 100644 (file)
@@ -1064,6 +1064,7 @@ static int fimc_lite_subdev_set_fmt(struct v4l2_subdev *sd,
        struct fimc_lite *fimc = v4l2_get_subdevdata(sd);
        struct v4l2_mbus_framefmt *mf = &fmt->format;
        struct flite_frame *sink = &fimc->inp_frame;
+       struct flite_frame *source = &fimc->out_frame;
        const struct fimc_fmt *ffmt;
 
        v4l2_dbg(1, debug, sd, "pad%d: code: 0x%x, %dx%d",
@@ -1097,8 +1098,10 @@ static int fimc_lite_subdev_set_fmt(struct v4l2_subdev *sd,
                sink->rect.height = mf->height;
                sink->rect.left = 0;
                sink->rect.top = 0;
-               /* Reset source crop rectangle */
-               fimc->out_frame.rect = sink->rect;
+               /* Reset source format and crop rectangle */
+               source->rect = sink->rect;
+               source->f_width = mf->width;
+               source->f_height = mf->height;
        } else {
                /* Allow changing format only on sink pad */
                mf->code = fimc->fmt->mbus_code;