media: imx-jpeg: Refine the function mxc_jpeg_find_format
remove the unused parameter ctx Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
302b988ca0
commit
492b99c2cd
@ -420,8 +420,7 @@ static int enum_fmt(const struct mxc_jpeg_fmt *mxc_formats, int n,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct mxc_jpeg_fmt *mxc_jpeg_find_format(struct mxc_jpeg_ctx *ctx,
|
||||
u32 pixelformat)
|
||||
static const struct mxc_jpeg_fmt *mxc_jpeg_find_format(u32 pixelformat)
|
||||
{
|
||||
unsigned int k;
|
||||
|
||||
@ -1566,7 +1565,7 @@ static int mxc_jpeg_parse(struct mxc_jpeg_ctx *ctx, struct vb2_buffer *vb)
|
||||
if (fourcc == 0)
|
||||
return -EINVAL;
|
||||
|
||||
jpeg_src_buf->fmt = mxc_jpeg_find_format(ctx, fourcc);
|
||||
jpeg_src_buf->fmt = mxc_jpeg_find_format(fourcc);
|
||||
jpeg_src_buf->w = header.frame.width;
|
||||
jpeg_src_buf->h = header.frame.height;
|
||||
ctx->header_parsed = true;
|
||||
@ -1706,11 +1705,11 @@ static void mxc_jpeg_set_default_params(struct mxc_jpeg_ctx *ctx)
|
||||
int i;
|
||||
|
||||
if (ctx->mxc_jpeg->mode == MXC_JPEG_ENCODE) {
|
||||
out_q->fmt = mxc_jpeg_find_format(ctx, MXC_JPEG_DEFAULT_PFMT);
|
||||
cap_q->fmt = mxc_jpeg_find_format(ctx, V4L2_PIX_FMT_JPEG);
|
||||
out_q->fmt = mxc_jpeg_find_format(MXC_JPEG_DEFAULT_PFMT);
|
||||
cap_q->fmt = mxc_jpeg_find_format(V4L2_PIX_FMT_JPEG);
|
||||
} else {
|
||||
out_q->fmt = mxc_jpeg_find_format(ctx, V4L2_PIX_FMT_JPEG);
|
||||
cap_q->fmt = mxc_jpeg_find_format(ctx, MXC_JPEG_DEFAULT_PFMT);
|
||||
out_q->fmt = mxc_jpeg_find_format(V4L2_PIX_FMT_JPEG);
|
||||
cap_q->fmt = mxc_jpeg_find_format(MXC_JPEG_DEFAULT_PFMT);
|
||||
}
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
@ -1954,7 +1953,7 @@ static int mxc_jpeg_try_fmt(struct v4l2_format *f,
|
||||
pix_mp->height : MXC_JPEG_MAX_HEIGHT;
|
||||
int i;
|
||||
|
||||
fmt = mxc_jpeg_find_format(ctx, fourcc);
|
||||
fmt = mxc_jpeg_find_format(fourcc);
|
||||
if (!fmt || fmt->flags != mxc_jpeg_get_fmt_type(ctx, f->type)) {
|
||||
dev_warn(ctx->mxc_jpeg->dev, "Format not supported: %c%c%c%c, use the default.\n",
|
||||
(fourcc & 0xff),
|
||||
@ -1962,7 +1961,7 @@ static int mxc_jpeg_try_fmt(struct v4l2_format *f,
|
||||
(fourcc >> 16) & 0xff,
|
||||
(fourcc >> 24) & 0xff);
|
||||
fourcc = mxc_jpeg_get_default_fourcc(ctx, f->type);
|
||||
fmt = mxc_jpeg_find_format(ctx, fourcc);
|
||||
fmt = mxc_jpeg_find_format(fourcc);
|
||||
if (!fmt)
|
||||
return -EINVAL;
|
||||
f->fmt.pix_mp.pixelformat = fourcc;
|
||||
|
Loading…
x
Reference in New Issue
Block a user