Commit cbd53542 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab

[media] exynos4-is: Fix TRY format propagation at MIPI-CSIS subdev

Ensure TRY format is propagated from the sink to source pad.
The format at both pads is always same so the TRY format buffer
for pad 0 is used to hold format for both pads.
While at it remove redundant fmt->pad checking.
Reported-by: default avatarJacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent aceb59ed
...@@ -549,10 +549,10 @@ static struct csis_pix_format const *s5pcsis_try_format( ...@@ -549,10 +549,10 @@ static struct csis_pix_format const *s5pcsis_try_format(
static struct v4l2_mbus_framefmt *__s5pcsis_get_format( static struct v4l2_mbus_framefmt *__s5pcsis_get_format(
struct csis_state *state, struct v4l2_subdev_fh *fh, struct csis_state *state, struct v4l2_subdev_fh *fh,
u32 pad, enum v4l2_subdev_format_whence which) enum v4l2_subdev_format_whence which)
{ {
if (which == V4L2_SUBDEV_FORMAT_TRY) if (which == V4L2_SUBDEV_FORMAT_TRY)
return fh ? v4l2_subdev_get_try_format(fh, pad) : NULL; return fh ? v4l2_subdev_get_try_format(fh, 0) : NULL;
return &state->format; return &state->format;
} }
...@@ -564,10 +564,7 @@ static int s5pcsis_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, ...@@ -564,10 +564,7 @@ static int s5pcsis_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
struct csis_pix_format const *csis_fmt; struct csis_pix_format const *csis_fmt;
struct v4l2_mbus_framefmt *mf; struct v4l2_mbus_framefmt *mf;
if (fmt->pad != CSIS_PAD_SOURCE && fmt->pad != CSIS_PAD_SINK) mf = __s5pcsis_get_format(state, fh, fmt->which);
return -EINVAL;
mf = __s5pcsis_get_format(state, fh, fmt->pad, fmt->which);
if (fmt->pad == CSIS_PAD_SOURCE) { if (fmt->pad == CSIS_PAD_SOURCE) {
if (mf) { if (mf) {
...@@ -594,10 +591,7 @@ static int s5pcsis_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, ...@@ -594,10 +591,7 @@ static int s5pcsis_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
struct csis_state *state = sd_to_csis_state(sd); struct csis_state *state = sd_to_csis_state(sd);
struct v4l2_mbus_framefmt *mf; struct v4l2_mbus_framefmt *mf;
if (fmt->pad != CSIS_PAD_SOURCE && fmt->pad != CSIS_PAD_SINK) mf = __s5pcsis_get_format(state, fh, fmt->which);
return -EINVAL;
mf = __s5pcsis_get_format(state, fh, fmt->pad, fmt->which);
if (!mf) if (!mf)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment