mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
media: rockchip: isp1: check for capture S_FMT
Change-Id: I10e75e18cd9f42ac02b4fd0f049851cdf96e8ccf Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
@@ -1583,7 +1583,7 @@ static int rkisp_init_vb2_queue(struct vb2_queue *q,
|
||||
return vb2_queue_init(q);
|
||||
}
|
||||
|
||||
static void rkisp1_set_fmt(struct rkisp1_stream *stream,
|
||||
static int rkisp1_set_fmt(struct rkisp1_stream *stream,
|
||||
struct v4l2_pix_format_mplane *pixm,
|
||||
bool try)
|
||||
{
|
||||
@@ -1596,8 +1596,15 @@ static void rkisp1_set_fmt(struct rkisp1_stream *stream,
|
||||
unsigned int i;
|
||||
|
||||
fmt = find_fmt(stream, pixm->pixelformat);
|
||||
if (!fmt)
|
||||
fmt = config->fmts;
|
||||
if (!fmt) {
|
||||
v4l2_err(&stream->ispdev->v4l2_dev,
|
||||
"nonsupport pixelformat:%c%c%c%c\n",
|
||||
pixm->pixelformat,
|
||||
pixm->pixelformat >> 8,
|
||||
pixm->pixelformat >> 16,
|
||||
pixm->pixelformat >> 24);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (stream->id != RKISP1_STREAM_RAW) {
|
||||
other_stream =
|
||||
@@ -1677,6 +1684,8 @@ static void rkisp1_set_fmt(struct rkisp1_stream *stream,
|
||||
stream->id, pixm->width, pixm->height,
|
||||
stream->out_fmt.width, stream->out_fmt.height);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rkisp1_fh_open(struct file *filp)
|
||||
@@ -1787,9 +1796,7 @@ static int rkisp1_try_fmt_vid_cap_mplane(struct file *file, void *fh,
|
||||
{
|
||||
struct rkisp1_stream *stream = video_drvdata(file);
|
||||
|
||||
rkisp1_set_fmt(stream, &f->fmt.pix_mp, true);
|
||||
|
||||
return 0;
|
||||
return rkisp1_set_fmt(stream, &f->fmt.pix_mp, true);
|
||||
}
|
||||
|
||||
static int rkisp1_enum_fmt_vid_cap_mplane(struct file *file, void *priv,
|
||||
@@ -1820,9 +1827,7 @@ static int rkisp1_s_fmt_vid_cap_mplane(struct file *file,
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
rkisp1_set_fmt(stream, &f->fmt.pix_mp, false);
|
||||
|
||||
return 0;
|
||||
return rkisp1_set_fmt(stream, &f->fmt.pix_mp, false);
|
||||
}
|
||||
|
||||
static int rkisp1_g_fmt_vid_cap_mplane(struct file *file, void *fh,
|
||||
|
||||
Reference in New Issue
Block a user