Commit 2e9e4f11 authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

[media] coda: prefix v4l2_ioctl_ops with coda_ instead of vidioc_

Moving the ioctl handler callbacks into the coda namespace helps
tremendously to make sense of backtraces.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
[k.debski@samsung.com: fix whitespace error near coda_subscribe_event]
Signed-off-by: default avatarKamil Debski <k.debski@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 5166028d
...@@ -412,8 +412,8 @@ static char *coda_product_name(int product) ...@@ -412,8 +412,8 @@ static char *coda_product_name(int product)
/* /*
* V4L2 ioctl() operations. * V4L2 ioctl() operations.
*/ */
static int vidioc_querycap(struct file *file, void *priv, static int coda_querycap(struct file *file, void *priv,
struct v4l2_capability *cap) struct v4l2_capability *cap)
{ {
struct coda_ctx *ctx = fh_to_ctx(priv); struct coda_ctx *ctx = fh_to_ctx(priv);
...@@ -484,8 +484,8 @@ static int enum_fmt(void *priv, struct v4l2_fmtdesc *f, ...@@ -484,8 +484,8 @@ static int enum_fmt(void *priv, struct v4l2_fmtdesc *f,
return -EINVAL; return -EINVAL;
} }
static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, static int coda_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f) struct v4l2_fmtdesc *f)
{ {
struct coda_ctx *ctx = fh_to_ctx(priv); struct coda_ctx *ctx = fh_to_ctx(priv);
struct vb2_queue *src_vq; struct vb2_queue *src_vq;
...@@ -503,13 +503,14 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, ...@@ -503,13 +503,14 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
return enum_fmt(priv, f, V4L2_BUF_TYPE_VIDEO_CAPTURE, 0); return enum_fmt(priv, f, V4L2_BUF_TYPE_VIDEO_CAPTURE, 0);
} }
static int vidioc_enum_fmt_vid_out(struct file *file, void *priv, static int coda_enum_fmt_vid_out(struct file *file, void *priv,
struct v4l2_fmtdesc *f) struct v4l2_fmtdesc *f)
{ {
return enum_fmt(priv, f, V4L2_BUF_TYPE_VIDEO_OUTPUT, 0); return enum_fmt(priv, f, V4L2_BUF_TYPE_VIDEO_OUTPUT, 0);
} }
static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f) static int coda_g_fmt(struct file *file, void *priv,
struct v4l2_format *f)
{ {
struct vb2_queue *vq; struct vb2_queue *vq;
struct coda_q_data *q_data; struct coda_q_data *q_data;
...@@ -536,7 +537,7 @@ static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f) ...@@ -536,7 +537,7 @@ static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f)
return 0; return 0;
} }
static int vidioc_try_fmt(struct coda_codec *codec, struct v4l2_format *f) static int coda_try_fmt(struct coda_codec *codec, struct v4l2_format *f)
{ {
unsigned int max_w, max_h; unsigned int max_w, max_h;
enum v4l2_field field; enum v4l2_field field;
...@@ -575,8 +576,8 @@ static int vidioc_try_fmt(struct coda_codec *codec, struct v4l2_format *f) ...@@ -575,8 +576,8 @@ static int vidioc_try_fmt(struct coda_codec *codec, struct v4l2_format *f)
return 0; return 0;
} }
static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, static int coda_try_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f) struct v4l2_format *f)
{ {
struct coda_ctx *ctx = fh_to_ctx(priv); struct coda_ctx *ctx = fh_to_ctx(priv);
struct coda_codec *codec; struct coda_codec *codec;
...@@ -604,7 +605,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, ...@@ -604,7 +605,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
f->fmt.pix.colorspace = ctx->colorspace; f->fmt.pix.colorspace = ctx->colorspace;
ret = vidioc_try_fmt(codec, f); ret = coda_try_fmt(codec, f);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -620,8 +621,8 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, ...@@ -620,8 +621,8 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
return 0; return 0;
} }
static int vidioc_try_fmt_vid_out(struct file *file, void *priv, static int coda_try_fmt_vid_out(struct file *file, void *priv,
struct v4l2_format *f) struct v4l2_format *f)
{ {
struct coda_ctx *ctx = fh_to_ctx(priv); struct coda_ctx *ctx = fh_to_ctx(priv);
struct coda_codec *codec; struct coda_codec *codec;
...@@ -633,10 +634,10 @@ static int vidioc_try_fmt_vid_out(struct file *file, void *priv, ...@@ -633,10 +634,10 @@ static int vidioc_try_fmt_vid_out(struct file *file, void *priv,
if (!f->fmt.pix.colorspace) if (!f->fmt.pix.colorspace)
f->fmt.pix.colorspace = V4L2_COLORSPACE_REC709; f->fmt.pix.colorspace = V4L2_COLORSPACE_REC709;
return vidioc_try_fmt(codec, f); return coda_try_fmt(codec, f);
} }
static int vidioc_s_fmt(struct coda_ctx *ctx, struct v4l2_format *f) static int coda_s_fmt(struct coda_ctx *ctx, struct v4l2_format *f)
{ {
struct coda_q_data *q_data; struct coda_q_data *q_data;
struct vb2_queue *vq; struct vb2_queue *vq;
...@@ -666,61 +667,62 @@ static int vidioc_s_fmt(struct coda_ctx *ctx, struct v4l2_format *f) ...@@ -666,61 +667,62 @@ static int vidioc_s_fmt(struct coda_ctx *ctx, struct v4l2_format *f)
return 0; return 0;
} }
static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, static int coda_s_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f) struct v4l2_format *f)
{ {
struct coda_ctx *ctx = fh_to_ctx(priv); struct coda_ctx *ctx = fh_to_ctx(priv);
int ret; int ret;
ret = vidioc_try_fmt_vid_cap(file, priv, f); ret = coda_try_fmt_vid_cap(file, priv, f);
if (ret) if (ret)
return ret; return ret;
return vidioc_s_fmt(ctx, f); return coda_s_fmt(ctx, f);
} }
static int vidioc_s_fmt_vid_out(struct file *file, void *priv, static int coda_s_fmt_vid_out(struct file *file, void *priv,
struct v4l2_format *f) struct v4l2_format *f)
{ {
struct coda_ctx *ctx = fh_to_ctx(priv); struct coda_ctx *ctx = fh_to_ctx(priv);
int ret; int ret;
ret = vidioc_try_fmt_vid_out(file, priv, f); ret = coda_try_fmt_vid_out(file, priv, f);
if (ret) if (ret)
return ret; return ret;
ret = vidioc_s_fmt(ctx, f); ret = coda_s_fmt(ctx, f);
if (ret) if (ret)
ctx->colorspace = f->fmt.pix.colorspace; ctx->colorspace = f->fmt.pix.colorspace;
return ret; return ret;
} }
static int vidioc_reqbufs(struct file *file, void *priv, static int coda_reqbufs(struct file *file, void *priv,
struct v4l2_requestbuffers *reqbufs) struct v4l2_requestbuffers *reqbufs)
{ {
struct coda_ctx *ctx = fh_to_ctx(priv); struct coda_ctx *ctx = fh_to_ctx(priv);
return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, reqbufs); return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, reqbufs);
} }
static int vidioc_querybuf(struct file *file, void *priv, static int coda_querybuf(struct file *file, void *priv,
struct v4l2_buffer *buf) struct v4l2_buffer *buf)
{ {
struct coda_ctx *ctx = fh_to_ctx(priv); struct coda_ctx *ctx = fh_to_ctx(priv);
return v4l2_m2m_querybuf(file, ctx->m2m_ctx, buf); return v4l2_m2m_querybuf(file, ctx->m2m_ctx, buf);
} }
static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf) static int coda_qbuf(struct file *file, void *priv,
struct v4l2_buffer *buf)
{ {
struct coda_ctx *ctx = fh_to_ctx(priv); struct coda_ctx *ctx = fh_to_ctx(priv);
return v4l2_m2m_qbuf(file, ctx->m2m_ctx, buf); return v4l2_m2m_qbuf(file, ctx->m2m_ctx, buf);
} }
static int vidioc_expbuf(struct file *file, void *priv, static int coda_expbuf(struct file *file, void *priv,
struct v4l2_exportbuffer *eb) struct v4l2_exportbuffer *eb)
{ {
struct coda_ctx *ctx = fh_to_ctx(priv); struct coda_ctx *ctx = fh_to_ctx(priv);
...@@ -738,7 +740,8 @@ static bool coda_buf_is_end_of_stream(struct coda_ctx *ctx, ...@@ -738,7 +740,8 @@ static bool coda_buf_is_end_of_stream(struct coda_ctx *ctx,
(buf->sequence == (ctx->qsequence - 1))); (buf->sequence == (ctx->qsequence - 1)));
} }
static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf) static int coda_dqbuf(struct file *file, void *priv,
struct v4l2_buffer *buf)
{ {
struct coda_ctx *ctx = fh_to_ctx(priv); struct coda_ctx *ctx = fh_to_ctx(priv);
int ret; int ret;
...@@ -758,24 +761,24 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf) ...@@ -758,24 +761,24 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
return ret; return ret;
} }
static int vidioc_create_bufs(struct file *file, void *priv, static int coda_create_bufs(struct file *file, void *priv,
struct v4l2_create_buffers *create) struct v4l2_create_buffers *create)
{ {
struct coda_ctx *ctx = fh_to_ctx(priv); struct coda_ctx *ctx = fh_to_ctx(priv);
return v4l2_m2m_create_bufs(file, ctx->m2m_ctx, create); return v4l2_m2m_create_bufs(file, ctx->m2m_ctx, create);
} }
static int vidioc_streamon(struct file *file, void *priv, static int coda_streamon(struct file *file, void *priv,
enum v4l2_buf_type type) enum v4l2_buf_type type)
{ {
struct coda_ctx *ctx = fh_to_ctx(priv); struct coda_ctx *ctx = fh_to_ctx(priv);
return v4l2_m2m_streamon(file, ctx->m2m_ctx, type); return v4l2_m2m_streamon(file, ctx->m2m_ctx, type);
} }
static int vidioc_streamoff(struct file *file, void *priv, static int coda_streamoff(struct file *file, void *priv,
enum v4l2_buf_type type) enum v4l2_buf_type type)
{ {
struct coda_ctx *ctx = fh_to_ctx(priv); struct coda_ctx *ctx = fh_to_ctx(priv);
int ret; int ret;
...@@ -792,8 +795,8 @@ static int vidioc_streamoff(struct file *file, void *priv, ...@@ -792,8 +795,8 @@ static int vidioc_streamoff(struct file *file, void *priv,
return ret; return ret;
} }
static int vidioc_decoder_cmd(struct file *file, void *fh, static int coda_decoder_cmd(struct file *file, void *fh,
struct v4l2_decoder_cmd *dc) struct v4l2_decoder_cmd *dc)
{ {
struct coda_ctx *ctx = fh_to_ctx(fh); struct coda_ctx *ctx = fh_to_ctx(fh);
...@@ -816,8 +819,8 @@ static int vidioc_decoder_cmd(struct file *file, void *fh, ...@@ -816,8 +819,8 @@ static int vidioc_decoder_cmd(struct file *file, void *fh,
return 0; return 0;
} }
static int vidioc_subscribe_event(struct v4l2_fh *fh, static int coda_subscribe_event(struct v4l2_fh *fh,
const struct v4l2_event_subscription *sub) const struct v4l2_event_subscription *sub)
{ {
switch (sub->type) { switch (sub->type) {
case V4L2_EVENT_EOS: case V4L2_EVENT_EOS:
...@@ -828,32 +831,32 @@ static int vidioc_subscribe_event(struct v4l2_fh *fh, ...@@ -828,32 +831,32 @@ static int vidioc_subscribe_event(struct v4l2_fh *fh,
} }
static const struct v4l2_ioctl_ops coda_ioctl_ops = { static const struct v4l2_ioctl_ops coda_ioctl_ops = {
.vidioc_querycap = vidioc_querycap, .vidioc_querycap = coda_querycap,
.vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, .vidioc_enum_fmt_vid_cap = coda_enum_fmt_vid_cap,
.vidioc_g_fmt_vid_cap = vidioc_g_fmt, .vidioc_g_fmt_vid_cap = coda_g_fmt,
.vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap, .vidioc_try_fmt_vid_cap = coda_try_fmt_vid_cap,
.vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap, .vidioc_s_fmt_vid_cap = coda_s_fmt_vid_cap,
.vidioc_enum_fmt_vid_out = vidioc_enum_fmt_vid_out, .vidioc_enum_fmt_vid_out = coda_enum_fmt_vid_out,
.vidioc_g_fmt_vid_out = vidioc_g_fmt, .vidioc_g_fmt_vid_out = coda_g_fmt,
.vidioc_try_fmt_vid_out = vidioc_try_fmt_vid_out, .vidioc_try_fmt_vid_out = coda_try_fmt_vid_out,
.vidioc_s_fmt_vid_out = vidioc_s_fmt_vid_out, .vidioc_s_fmt_vid_out = coda_s_fmt_vid_out,
.vidioc_reqbufs = vidioc_reqbufs, .vidioc_reqbufs = coda_reqbufs,
.vidioc_querybuf = vidioc_querybuf, .vidioc_querybuf = coda_querybuf,
.vidioc_qbuf = vidioc_qbuf, .vidioc_qbuf = coda_qbuf,
.vidioc_expbuf = vidioc_expbuf, .vidioc_expbuf = coda_expbuf,
.vidioc_dqbuf = vidioc_dqbuf, .vidioc_dqbuf = coda_dqbuf,
.vidioc_create_bufs = vidioc_create_bufs, .vidioc_create_bufs = coda_create_bufs,
.vidioc_streamon = vidioc_streamon, .vidioc_streamon = coda_streamon,
.vidioc_streamoff = vidioc_streamoff, .vidioc_streamoff = coda_streamoff,
.vidioc_decoder_cmd = vidioc_decoder_cmd, .vidioc_decoder_cmd = coda_decoder_cmd,
.vidioc_subscribe_event = vidioc_subscribe_event, .vidioc_subscribe_event = coda_subscribe_event,
.vidioc_unsubscribe_event = v4l2_event_unsubscribe, .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
}; };
......
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