Hi all,
Cleanups and fixes, third iteration.
The main idea here is to address two issues, and while
at it, clean the driver a bit.
The first issue can be found in Patch 1, when the Request
API is used, the CAPTURE buffer should be returned _before_
the OUTPUT buffer, to avoid waking up userspace prematurely.
I noticed this issue while working on the rkvdec driver,
but this time I've decided to tackle it at the core,
in v4l2_m2m_buf_done_and_job_finish().
The second issue is a simple compliance issue, which is solved
by refactoring the driver, dealing with internal set format
properly.
Note that patch 7 still needs reviews from device tree maintainers.
Changes v3:
* Rebased media master.
* Revert buffer sequence removal change.
Changes v2:
* Fix compile warning introduced by patch 6.
* I'm adding two additional patches this time.
Patch 7 converts the binding to json-schema,
and patch 8 puts linux-rockchip mailing list in MAINTAINERS.
Thanks,
Ezequiel
Ezequiel Garcia (7):
v4l2-mem2mem: return CAPTURE buffer first
hantro: Set buffers' zeroth plane payload in .buf_prepare
hantro: Use v4l2_m2m_buf_done_and_job_finish
hantro: Remove unneeded hantro_dec_buf_finish
hantro: Move H264 motion vector calculation to a helper
hantro: Refactor for V4L2 API spec compliancy
dt-bindings: rockchip-vpu: Convert bindings to json-schema
.../bindings/media/rockchip-vpu.txt | 43 -------
.../bindings/media/rockchip-vpu.yaml | 82 +++++++++++++
MAINTAINERS | 2 +-
drivers/media/v4l2-core/v4l2-mem2mem.c | 11 +-
drivers/staging/media/hantro/hantro.h | 7 +-
drivers/staging/media/hantro/hantro_drv.c | 28 ++---
drivers/staging/media/hantro/hantro_hw.h | 31 +++++
drivers/staging/media/hantro/hantro_v4l2.c | 111 +++++++++---------
8 files changed, 193 insertions(+), 122 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.txt
create mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.yaml
--
2.26.0.rc2
When the request API is used, typically an OUTPUT (src) buffer
will be part of a request. A userspace process will be typically
blocked, waiting on the request file descriptor.
Returning the OUTPUT (src) buffer will wake-up such processes,
who will immediately attempt to dequeue the CAPTURE buffer,
only to find it's still unavailable.
Therefore, change v4l2_m2m_buf_done_and_job_finish returning
the CAPTURE (dst) buffer first, to avoid signalling the request
file descriptor prematurely, i.e. before the CAPTURE buffer is done.
When the request API is not used, this change should have
no impact.
Tested-by: Nicolas Dufresne <[email protected]>
Signed-off-by: Ezequiel Garcia <[email protected]>
---
drivers/media/v4l2-core/v4l2-mem2mem.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c
index 8986c31176e9..62ac9424c92a 100644
--- a/drivers/media/v4l2-core/v4l2-mem2mem.c
+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c
@@ -504,12 +504,21 @@ void v4l2_m2m_buf_done_and_job_finish(struct v4l2_m2m_dev *m2m_dev,
if (WARN_ON(!src_buf || !dst_buf))
goto unlock;
- v4l2_m2m_buf_done(src_buf, state);
dst_buf->is_held = src_buf->flags & V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF;
if (!dst_buf->is_held) {
v4l2_m2m_dst_buf_remove(m2m_ctx);
v4l2_m2m_buf_done(dst_buf, state);
}
+ /*
+ * If the request API is being used, returning the OUTPUT
+ * (src) buffer will wake-up any process waiting on the
+ * request file descriptor.
+ *
+ * Therefore, return the CAPTURE (dst) buffer first,
+ * to avoid signalling the request file descriptor
+ * before the CAPTURE buffer is done.
+ */
+ v4l2_m2m_buf_done(src_buf, state);
schedule_next = _v4l2_m2m_job_finish(m2m_dev, m2m_ctx);
unlock:
spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags);
--
2.26.0.rc2
Let the core sort out the nuances of returning buffers
to userspace, by using the v4l2_m2m_buf_done_and_job_finish
helper.
Signed-off-by: Ezequiel Garcia <[email protected]>
--
drivers/staging/media/hantro/hantro_drv.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
index ace13973e2d0..d0097c5fe7d9 100644
--- a/drivers/staging/media/hantro/hantro_drv.c
+++ b/drivers/staging/media/hantro/hantro_drv.c
@@ -101,8 +101,8 @@ static void hantro_job_finish(struct hantro_dev *vpu,
pm_runtime_put_autosuspend(vpu->dev);
clk_bulk_disable(vpu->variant->num_clocks, vpu->clocks);
- src = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
- dst = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
+ src = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
+ dst = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
if (WARN_ON(!src))
return;
@@ -112,14 +112,14 @@ static void hantro_job_finish(struct hantro_dev *vpu,
src->sequence = ctx->sequence_out++;
dst->sequence = ctx->sequence_cap++;
- ret = ctx->buf_finish(ctx, &dst->vb2_buf, bytesused);
- if (ret)
- result = VB2_BUF_STATE_ERROR;
-
- v4l2_m2m_buf_done(src, result);
- v4l2_m2m_buf_done(dst, result);
+ if (ctx->buf_finish) {
+ ret = ctx->buf_finish(ctx, &dst->vb2_buf, bytesused);
+ if (ret)
+ result = VB2_BUF_STATE_ERROR;
+ }
- v4l2_m2m_job_finish(vpu->m2m_dev, ctx->fh.m2m_ctx);
+ v4l2_m2m_buf_done_and_job_finish(ctx->dev->m2m_dev, ctx->fh.m2m_ctx,
+ result);
}
void hantro_irq_done(struct hantro_dev *vpu, unsigned int bytesused,
--
2.26.0.rc2
Since now .buf_prepare takes care of setting the
buffer payload size, we can get rid of this,
at least for decoders.
Signed-off-by: Ezequiel Garcia <[email protected]>
---
drivers/staging/media/hantro/hantro_drv.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
index d0097c5fe7d9..0db8ad455160 100644
--- a/drivers/staging/media/hantro/hantro_drv.c
+++ b/drivers/staging/media/hantro/hantro_drv.c
@@ -80,15 +80,6 @@ hantro_enc_buf_finish(struct hantro_ctx *ctx, struct vb2_buffer *buf,
return 0;
}
-static int
-hantro_dec_buf_finish(struct hantro_ctx *ctx, struct vb2_buffer *buf,
- unsigned int bytesused)
-{
- /* For decoders set bytesused as per the output picture. */
- buf->planes[0].bytesused = ctx->dst_fmt.plane_fmt[0].sizeimage;
- return 0;
-}
-
static void hantro_job_finish(struct hantro_dev *vpu,
struct hantro_ctx *ctx,
unsigned int bytesused,
@@ -431,7 +422,6 @@ static int hantro_open(struct file *filp)
ctx->buf_finish = hantro_enc_buf_finish;
} else if (func->id == MEDIA_ENT_F_PROC_VIDEO_DECODER) {
allowed_codecs = vpu->variant->codec & HANTRO_DECODERS;
- ctx->buf_finish = hantro_dec_buf_finish;
} else {
ret = -ENODEV;
goto err_ctx_free;
--
2.26.0.rc2
Move the extra bytes calculation that are needed for H264
motion vector to a helper. This is just a cosmetic cleanup.
Signed-off-by: Ezequiel Garcia <[email protected]>
---
drivers/staging/media/hantro/hantro.h | 4 ---
drivers/staging/media/hantro/hantro_hw.h | 31 ++++++++++++++++++++++
drivers/staging/media/hantro/hantro_v4l2.c | 25 ++---------------
3 files changed, 33 insertions(+), 27 deletions(-)
diff --git a/drivers/staging/media/hantro/hantro.h b/drivers/staging/media/hantro/hantro.h
index 327ddef45345..2089f88a44a2 100644
--- a/drivers/staging/media/hantro/hantro.h
+++ b/drivers/staging/media/hantro/hantro.h
@@ -26,10 +26,6 @@
#include "hantro_hw.h"
-#define MB_DIM 16
-#define MB_WIDTH(w) DIV_ROUND_UP(w, MB_DIM)
-#define MB_HEIGHT(h) DIV_ROUND_UP(h, MB_DIM)
-
struct hantro_ctx;
struct hantro_codec_ops;
diff --git a/drivers/staging/media/hantro/hantro_hw.h b/drivers/staging/media/hantro/hantro_hw.h
index 7dfc9bad7297..4053d8710e04 100644
--- a/drivers/staging/media/hantro/hantro_hw.h
+++ b/drivers/staging/media/hantro/hantro_hw.h
@@ -18,6 +18,10 @@
#define DEC_8190_ALIGN_MASK 0x07U
+#define MB_DIM 16
+#define MB_WIDTH(w) DIV_ROUND_UP(w, MB_DIM)
+#define MB_HEIGHT(h) DIV_ROUND_UP(h, MB_DIM)
+
struct hantro_dev;
struct hantro_ctx;
struct hantro_buf;
@@ -176,6 +180,33 @@ void hantro_g1_h264_dec_run(struct hantro_ctx *ctx);
int hantro_h264_dec_init(struct hantro_ctx *ctx);
void hantro_h264_dec_exit(struct hantro_ctx *ctx);
+static inline size_t
+hantro_h264_mv_size(unsigned int width, unsigned int height)
+{
+ /*
+ * A decoded 8-bit 4:2:0 NV12 frame may need memory for up to
+ * 448 bytes per macroblock with additional 32 bytes on
+ * multi-core variants.
+ *
+ * The H264 decoder needs extra space on the output buffers
+ * to store motion vectors. This is needed for reference
+ * frames and only if the format is non-post-processed NV12.
+ *
+ * Memory layout is as follow:
+ *
+ * +---------------------------+
+ * | Y-plane 256 bytes x MBs |
+ * +---------------------------+
+ * | UV-plane 128 bytes x MBs |
+ * +---------------------------+
+ * | MV buffer 64 bytes x MBs |
+ * +---------------------------+
+ * | MC sync 32 bytes |
+ * +---------------------------+
+ */
+ return 64 * MB_WIDTH(width) * MB_WIDTH(height) + 32;
+}
+
void hantro_g1_mpeg2_dec_run(struct hantro_ctx *ctx);
void rk3399_vpu_mpeg2_dec_run(struct hantro_ctx *ctx);
void hantro_mpeg2_dec_copy_qtable(u8 *qtable,
diff --git a/drivers/staging/media/hantro/hantro_v4l2.c b/drivers/staging/media/hantro/hantro_v4l2.c
index 3142ab6697d5..458b502ff01b 100644
--- a/drivers/staging/media/hantro/hantro_v4l2.c
+++ b/drivers/staging/media/hantro/hantro_v4l2.c
@@ -273,32 +273,11 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f,
/* Fill remaining fields */
v4l2_fill_pixfmt_mp(pix_mp, fmt->fourcc, pix_mp->width,
pix_mp->height);
- /*
- * A decoded 8-bit 4:2:0 NV12 frame may need memory for up to
- * 448 bytes per macroblock with additional 32 bytes on
- * multi-core variants.
- *
- * The H264 decoder needs extra space on the output buffers
- * to store motion vectors. This is needed for reference
- * frames and only if the format is non-post-processed NV12.
- *
- * Memory layout is as follow:
- *
- * +---------------------------+
- * | Y-plane 256 bytes x MBs |
- * +---------------------------+
- * | UV-plane 128 bytes x MBs |
- * +---------------------------+
- * | MV buffer 64 bytes x MBs |
- * +---------------------------+
- * | MC sync 32 bytes |
- * +---------------------------+
- */
if (ctx->vpu_src_fmt->fourcc == V4L2_PIX_FMT_H264_SLICE &&
!hantro_needs_postproc(ctx, fmt))
pix_mp->plane_fmt[0].sizeimage +=
- 64 * MB_WIDTH(pix_mp->width) *
- MB_WIDTH(pix_mp->height) + 32;
+ hantro_h264_mv_size(pix_mp->width,
+ pix_mp->height);
} else if (!pix_mp->plane_fmt[0].sizeimage) {
/*
* For coded formats the application can specify
--
2.26.0.rc2
Refactor how S_FMT and TRY_FMT are handled, and also make sure
internal initial format and format reset are done properly.
The latter is achieved by making sure the same hantro_{set,try}_fmt
helpers are called on all paths that set the format (which is
part of the driver state).
This commit removes the following v4l2-compliance warnings:
test VIDIOC_G_FMT: OK
fail: v4l2-test-formats.cpp(711): Video Capture Multiplanar: TRY_FMT(G_FMT) != G_FMT
test VIDIOC_TRY_FMT: FAIL
fail: v4l2-test-formats.cpp(1116): Video Capture Multiplanar: S_FMT(G_FMT) != G_FMT
test VIDIOC_S_FMT: FAIL
Reported-by: Nicolas Dufresne <[email protected]>
Signed-off-by: Ezequiel Garcia <[email protected]>
---
drivers/staging/media/hantro/hantro.h | 3 +-
drivers/staging/media/hantro/hantro_v4l2.c | 70 ++++++++++++++--------
2 files changed, 47 insertions(+), 26 deletions(-)
diff --git a/drivers/staging/media/hantro/hantro.h b/drivers/staging/media/hantro/hantro.h
index 2089f88a44a2..3005207fc6fb 100644
--- a/drivers/staging/media/hantro/hantro.h
+++ b/drivers/staging/media/hantro/hantro.h
@@ -417,7 +417,8 @@ hantro_get_dst_buf(struct hantro_ctx *ctx)
}
static inline bool
-hantro_needs_postproc(struct hantro_ctx *ctx, const struct hantro_fmt *fmt)
+hantro_needs_postproc(const struct hantro_ctx *ctx,
+ const struct hantro_fmt *fmt)
{
return !hantro_is_encoder_ctx(ctx) && fmt->fourcc != V4L2_PIX_FMT_NV12;
}
diff --git a/drivers/staging/media/hantro/hantro_v4l2.c b/drivers/staging/media/hantro/hantro_v4l2.c
index 458b502ff01b..f28a94e2fa93 100644
--- a/drivers/staging/media/hantro/hantro_v4l2.c
+++ b/drivers/staging/media/hantro/hantro_v4l2.c
@@ -30,6 +30,11 @@
#include "hantro_hw.h"
#include "hantro_v4l2.h"
+static int hantro_set_fmt_out(struct hantro_ctx *ctx,
+ struct v4l2_pix_format_mplane *pix_mp);
+static int hantro_set_fmt_cap(struct hantro_ctx *ctx,
+ struct v4l2_pix_format_mplane *pix_mp);
+
static const struct hantro_fmt *
hantro_get_formats(const struct hantro_ctx *ctx, unsigned int *num_fmts)
{
@@ -227,12 +232,12 @@ static int vidioc_g_fmt_cap_mplane(struct file *file, void *priv,
return 0;
}
-static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f,
- bool capture)
+static int hantro_try_fmt(const struct hantro_ctx *ctx,
+ struct v4l2_pix_format_mplane *pix_mp,
+ enum v4l2_buf_type type)
{
- struct hantro_ctx *ctx = fh_to_ctx(priv);
- struct v4l2_pix_format_mplane *pix_mp = &f->fmt.pix_mp;
const struct hantro_fmt *fmt, *vpu_fmt;
+ bool capture = !V4L2_TYPE_IS_OUTPUT(type);
bool coded;
coded = capture == hantro_is_encoder_ctx(ctx);
@@ -246,7 +251,7 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f,
fmt = hantro_find_format(ctx, pix_mp->pixelformat);
if (!fmt) {
fmt = hantro_get_default_fmt(ctx, coded);
- f->fmt.pix_mp.pixelformat = fmt->fourcc;
+ pix_mp->pixelformat = fmt->fourcc;
}
if (coded) {
@@ -294,13 +299,13 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f,
static int vidioc_try_fmt_cap_mplane(struct file *file, void *priv,
struct v4l2_format *f)
{
- return vidioc_try_fmt(file, priv, f, true);
+ return hantro_try_fmt(fh_to_ctx(priv), &f->fmt.pix_mp, f->type);
}
static int vidioc_try_fmt_out_mplane(struct file *file, void *priv,
struct v4l2_format *f)
{
- return vidioc_try_fmt(file, priv, f, false);
+ return hantro_try_fmt(fh_to_ctx(priv), &f->fmt.pix_mp, f->type);
}
static void
@@ -334,11 +339,12 @@ hantro_reset_encoded_fmt(struct hantro_ctx *ctx)
}
hantro_reset_fmt(fmt, vpu_fmt);
- fmt->num_planes = 1;
fmt->width = vpu_fmt->frmsize.min_width;
fmt->height = vpu_fmt->frmsize.min_height;
- fmt->plane_fmt[0].sizeimage = vpu_fmt->header_size +
- fmt->width * fmt->height * vpu_fmt->max_depth;
+ if (hantro_is_encoder_ctx(ctx))
+ hantro_set_fmt_cap(ctx, fmt);
+ else
+ hantro_set_fmt_out(ctx, fmt);
}
static void
@@ -360,9 +366,12 @@ hantro_reset_raw_fmt(struct hantro_ctx *ctx)
}
hantro_reset_fmt(raw_fmt, raw_vpu_fmt);
- v4l2_fill_pixfmt_mp(raw_fmt, raw_vpu_fmt->fourcc,
- encoded_fmt->width,
- encoded_fmt->height);
+ raw_fmt->width = encoded_fmt->width;
+ raw_fmt->width = encoded_fmt->width;
+ if (hantro_is_encoder_ctx(ctx))
+ hantro_set_fmt_out(ctx, raw_fmt);
+ else
+ hantro_set_fmt_cap(ctx, raw_fmt);
}
void hantro_reset_fmts(struct hantro_ctx *ctx)
@@ -388,15 +397,15 @@ hantro_update_requires_request(struct hantro_ctx *ctx, u32 fourcc)
}
}
-static int
-vidioc_s_fmt_out_mplane(struct file *file, void *priv, struct v4l2_format *f)
+static int hantro_set_fmt_out(struct hantro_ctx *ctx,
+ struct v4l2_pix_format_mplane *pix_mp)
{
- struct v4l2_pix_format_mplane *pix_mp = &f->fmt.pix_mp;
- struct hantro_ctx *ctx = fh_to_ctx(priv);
- struct vb2_queue *vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type);
+ struct vb2_queue *vq;
int ret;
- ret = vidioc_try_fmt_out_mplane(file, priv, f);
+ vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx,
+ V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
+ ret = hantro_try_fmt(ctx, pix_mp, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
if (ret)
return ret;
@@ -458,16 +467,15 @@ vidioc_s_fmt_out_mplane(struct file *file, void *priv, struct v4l2_format *f)
return 0;
}
-static int vidioc_s_fmt_cap_mplane(struct file *file, void *priv,
- struct v4l2_format *f)
+static int hantro_set_fmt_cap(struct hantro_ctx *ctx,
+ struct v4l2_pix_format_mplane *pix_mp)
{
- struct v4l2_pix_format_mplane *pix_mp = &f->fmt.pix_mp;
- struct hantro_ctx *ctx = fh_to_ctx(priv);
struct vb2_queue *vq;
int ret;
/* Change not allowed if queue is busy. */
- vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type);
+ vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx,
+ V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
if (vb2_is_busy(vq))
return -EBUSY;
@@ -488,7 +496,7 @@ static int vidioc_s_fmt_cap_mplane(struct file *file, void *priv,
return -EBUSY;
}
- ret = vidioc_try_fmt_cap_mplane(file, priv, f);
+ ret = hantro_try_fmt(ctx, pix_mp, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
if (ret)
return ret;
@@ -522,6 +530,18 @@ static int vidioc_s_fmt_cap_mplane(struct file *file, void *priv,
return 0;
}
+static int
+vidioc_s_fmt_out_mplane(struct file *file, void *priv, struct v4l2_format *f)
+{
+ return hantro_set_fmt_out(fh_to_ctx(priv), &f->fmt.pix_mp);
+}
+
+static int
+vidioc_s_fmt_cap_mplane(struct file *file, void *priv, struct v4l2_format *f)
+{
+ return hantro_set_fmt_cap(fh_to_ctx(priv), &f->fmt.pix_mp);
+}
+
const struct v4l2_ioctl_ops hantro_ioctl_ops = {
.vidioc_querycap = vidioc_querycap,
.vidioc_enum_framesizes = vidioc_enum_framesizes,
--
2.26.0.rc2
Buffers' zeroth plane payload size is calculated at format
negotiation time, and so it can be set in .buf_prepare.
Keep in mind that, to make this change easier, hantro_buf_prepare
is refactored, using the cedrus driver as reference. This results
in cleaner code as byproduct.
Signed-off-by: Ezequiel Garcia <[email protected]>
---
drivers/staging/media/hantro/hantro_v4l2.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/media/hantro/hantro_v4l2.c b/drivers/staging/media/hantro/hantro_v4l2.c
index f4ae2cee0f18..3142ab6697d5 100644
--- a/drivers/staging/media/hantro/hantro_v4l2.c
+++ b/drivers/staging/media/hantro/hantro_v4l2.c
@@ -608,7 +608,7 @@ hantro_queue_setup(struct vb2_queue *vq, unsigned int *num_buffers,
}
static int
-hantro_buf_plane_check(struct vb2_buffer *vb, const struct hantro_fmt *vpu_fmt,
+hantro_buf_plane_check(struct vb2_buffer *vb,
struct v4l2_pix_format_mplane *pixfmt)
{
unsigned int sz;
@@ -630,12 +630,18 @@ static int hantro_buf_prepare(struct vb2_buffer *vb)
{
struct vb2_queue *vq = vb->vb2_queue;
struct hantro_ctx *ctx = vb2_get_drv_priv(vq);
+ struct v4l2_pix_format_mplane *pix_fmt;
+ int ret;
if (V4L2_TYPE_IS_OUTPUT(vq->type))
- return hantro_buf_plane_check(vb, ctx->vpu_src_fmt,
- &ctx->src_fmt);
-
- return hantro_buf_plane_check(vb, ctx->vpu_dst_fmt, &ctx->dst_fmt);
+ pix_fmt = &ctx->src_fmt;
+ else
+ pix_fmt = &ctx->dst_fmt;
+ ret = hantro_buf_plane_check(vb, pix_fmt);
+ if (ret)
+ return ret;
+ vb2_set_plane_payload(vb, 0, pix_fmt->plane_fmt[0].sizeimage);
+ return 0;
}
static void hantro_buf_queue(struct vb2_buffer *vb)
--
2.26.0.rc2
Convert Rockchip VPU (Hantro IP block) codec driver documentation to
json-schema.
Cc: Mark Rutland <[email protected]>
Cc: Rob Herring <[email protected]>
Signed-off-by: Ezequiel Garcia <[email protected]>
---
.../bindings/media/rockchip-vpu.txt | 43 ----------
.../bindings/media/rockchip-vpu.yaml | 82 +++++++++++++++++++
MAINTAINERS | 2 +-
3 files changed, 83 insertions(+), 44 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.txt
create mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.yaml
diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.txt b/Documentation/devicetree/bindings/media/rockchip-vpu.txt
deleted file mode 100644
index 339252d9c515..000000000000
--- a/Documentation/devicetree/bindings/media/rockchip-vpu.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-device-tree bindings for rockchip VPU codec
-
-Rockchip (Video Processing Unit) present in various Rockchip platforms,
-such as RK3288, RK3328 and RK3399.
-
-Required properties:
-- compatible: value should be one of the following
- "rockchip,rk3288-vpu";
- "rockchip,rk3328-vpu";
- "rockchip,rk3399-vpu";
-- interrupts: encoding and decoding interrupt specifiers
-- interrupt-names: should be
- "vepu", "vdpu" on RK3288 and RK3399,
- "vdpu" on RK3328.
-- clocks: phandle to VPU aclk, hclk clocks
-- clock-names: should be "aclk" and "hclk"
-- power-domains: phandle to power domain node
-- iommus: phandle to a iommu node
-
-Example:
-SoC-specific DT entry:
- vpu: video-codec@ff9a0000 {
- compatible = "rockchip,rk3288-vpu";
- reg = <0x0 0xff9a0000 0x0 0x800>;
- interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "vepu", "vdpu";
- clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
- clock-names = "aclk", "hclk";
- power-domains = <&power RK3288_PD_VIDEO>;
- iommus = <&vpu_mmu>;
- };
-
- vpu: video-codec@ff350000 {
- compatible = "rockchip,rk3328-vpu";
- reg = <0x0 0xff350000 0x0 0x800>;
- interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "vdpu";
- clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
- clock-names = "aclk", "hclk";
- power-domains = <&power RK3328_PD_VPU>;
- iommus = <&vpu_mmu>;
- };
diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
new file mode 100644
index 000000000000..a0c45e05cf03
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
@@ -0,0 +1,82 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/media/rockchip-vpu.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Hantro G1 VPU codecs implemented on Rockchip SoCs
+
+maintainers:
+ - Ezequiel Garcia <[email protected]>
+
+description:
+ Hantro G1 video encode and decode accelerators present on Rockchip SoCs.
+
+properties:
+ compatible:
+ enum:
+ - rockchip,rk3288-vpu
+ - rockchip,rk3328-vpu
+ - rockchip,rk3399-vpu
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 2
+
+ interrupt-names:
+ items:
+ - const: vepu
+ - const: vdpu
+
+ clocks:
+ maxItems: 2
+
+ clock-names:
+ items:
+ - const: aclk
+ - const: hclk
+
+ power-domains:
+ maxItems: 1
+
+ iommus:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - interrupt-names
+ - clocks
+ - clock-names
+
+examples:
+ - |
+ #include <dt-bindings/clock/rk3288-cru.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+ vpu: video-codec@ff9a0000 {
+ compatible = "rockchip,rk3288-vpu";
+ reg = <0x0 0xff9a0000 0x0 0x800>;
+ interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "vepu", "vdpu";
+ clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
+ clock-names = "aclk", "hclk";
+ power-domains = <&power RK3288_PD_VIDEO>;
+ iommus = <&vpu_mmu>;
+ };
+
+ vpu: video-codec@ff350000 {
+ compatible = "rockchip,rk3328-vpu";
+ reg = <0x0 0xff350000 0x0 0x800>;
+ interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "vdpu";
+ clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
+ clock-names = "aclk", "hclk";
+ power-domains = <&power RK3328_PD_VPU>;
+ iommus = <&vpu_mmu>;
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index d66ac41ef587..2b8b3e7f3df3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14320,7 +14320,7 @@ L: [email protected]
S: Maintained
F: drivers/staging/media/hantro/
F: Documentation/devicetree/bindings/media/nxp,imx8mq-vpu.yaml
-F: Documentation/devicetree/bindings/media/rockchip-vpu.txt
+F: Documentation/devicetree/bindings/media/rockchip-vpu.yaml
ROCKER DRIVER
M: Jiri Pirko <[email protected]>
--
2.26.0.rc2
On Wed, 25 Mar 2020 18:34:38 -0300, Ezequiel Garcia wrote:
> Convert Rockchip VPU (Hantro IP block) codec driver documentation to
> json-schema.
>
> Cc: Mark Rutland <[email protected]>
> Cc: Rob Herring <[email protected]>
> Signed-off-by: Ezequiel Garcia <[email protected]>
> ---
> .../bindings/media/rockchip-vpu.txt | 43 ----------
> .../bindings/media/rockchip-vpu.yaml | 82 +++++++++++++++++++
> MAINTAINERS | 2 +-
> 3 files changed, 83 insertions(+), 44 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.txt
> create mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>
My bot found errors running 'make dt_binding_check' on your patch:
Error: Documentation/devicetree/bindings/media/rockchip-vpu.example.dts:28.41-42 syntax error
FATAL ERROR: Unable to parse input tree
scripts/Makefile.lib:311: recipe for target 'Documentation/devicetree/bindings/media/rockchip-vpu.example.dt.yaml' failed
make[1]: *** [Documentation/devicetree/bindings/media/rockchip-vpu.example.dt.yaml] Error 1
make[1]: *** Waiting for unfinished jobs....
Makefile:1262: recipe for target 'dt_binding_check' failed
make: *** [dt_binding_check] Error 2
See https://patchwork.ozlabs.org/patch/1261669
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure dt-schema is up to date:
pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade
Please check and re-submit.
On Wed, Mar 25, 2020 at 3:35 PM Ezequiel Garcia <[email protected]> wrote:
>
> Convert Rockchip VPU (Hantro IP block) codec driver documentation to
> json-schema.
>
> Cc: Mark Rutland <[email protected]>
> Cc: Rob Herring <[email protected]>
> Signed-off-by: Ezequiel Garcia <[email protected]>
> ---
> .../bindings/media/rockchip-vpu.txt | 43 ----------
> .../bindings/media/rockchip-vpu.yaml | 82 +++++++++++++++++++
> MAINTAINERS | 2 +-
> 3 files changed, 83 insertions(+), 44 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.txt
> create mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>
> diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.txt b/Documentation/devicetree/bindings/media/rockchip-vpu.txt
> deleted file mode 100644
> index 339252d9c515..000000000000
> --- a/Documentation/devicetree/bindings/media/rockchip-vpu.txt
> +++ /dev/null
> @@ -1,43 +0,0 @@
> -device-tree bindings for rockchip VPU codec
> -
> -Rockchip (Video Processing Unit) present in various Rockchip platforms,
> -such as RK3288, RK3328 and RK3399.
> -
> -Required properties:
> -- compatible: value should be one of the following
> - "rockchip,rk3288-vpu";
> - "rockchip,rk3328-vpu";
> - "rockchip,rk3399-vpu";
> -- interrupts: encoding and decoding interrupt specifiers
> -- interrupt-names: should be
> - "vepu", "vdpu" on RK3288 and RK3399,
> - "vdpu" on RK3328.
> -- clocks: phandle to VPU aclk, hclk clocks
> -- clock-names: should be "aclk" and "hclk"
> -- power-domains: phandle to power domain node
> -- iommus: phandle to a iommu node
> -
> -Example:
> -SoC-specific DT entry:
> - vpu: video-codec@ff9a0000 {
> - compatible = "rockchip,rk3288-vpu";
> - reg = <0x0 0xff9a0000 0x0 0x800>;
> - interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
> - <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
> - interrupt-names = "vepu", "vdpu";
> - clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
> - clock-names = "aclk", "hclk";
> - power-domains = <&power RK3288_PD_VIDEO>;
> - iommus = <&vpu_mmu>;
> - };
> -
> - vpu: video-codec@ff350000 {
> - compatible = "rockchip,rk3328-vpu";
> - reg = <0x0 0xff350000 0x0 0x800>;
> - interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
> - interrupt-names = "vdpu";
> - clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
> - clock-names = "aclk", "hclk";
> - power-domains = <&power RK3328_PD_VPU>;
> - iommus = <&vpu_mmu>;
> - };
> diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> new file mode 100644
> index 000000000000..a0c45e05cf03
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> @@ -0,0 +1,82 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/media/rockchip-vpu.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: Hantro G1 VPU codecs implemented on Rockchip SoCs
> +
> +maintainers:
> + - Ezequiel Garcia <[email protected]>
> +
> +description:
> + Hantro G1 video encode and decode accelerators present on Rockchip SoCs.
> +
> +properties:
> + compatible:
> + enum:
> + - rockchip,rk3288-vpu
> + - rockchip,rk3328-vpu
> + - rockchip,rk3399-vpu
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 2
> +
> + interrupt-names:
> + items:
> + - const: vepu
> + - const: vdpu
> +
> + clocks:
> + maxItems: 2
> +
> + clock-names:
> + items:
> + - const: aclk
> + - const: hclk
> +
> + power-domains:
> + maxItems: 1
> +
> + iommus:
> + maxItems: 1
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - interrupt-names
> + - clocks
> + - clock-names
Add:
additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/rk3288-cru.h>
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> + vpu: video-codec@ff9a0000 {
> + compatible = "rockchip,rk3288-vpu";
> + reg = <0x0 0xff9a0000 0x0 0x800>;
> + interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
> + interrupt-names = "vepu", "vdpu";
> + clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
> + clock-names = "aclk", "hclk";
> + power-domains = <&power RK3288_PD_VIDEO>;
Header for this define?
> + iommus = <&vpu_mmu>;
> + };
> +
> + vpu: video-codec@ff350000 {
> + compatible = "rockchip,rk3328-vpu";
> + reg = <0x0 0xff350000 0x0 0x800>;
> + interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
> + interrupt-names = "vdpu";
> + clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
> + clock-names = "aclk", "hclk";
> + power-domains = <&power RK3328_PD_VPU>;
> + iommus = <&vpu_mmu>;
> + };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index d66ac41ef587..2b8b3e7f3df3 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -14320,7 +14320,7 @@ L: [email protected]
> S: Maintained
> F: drivers/staging/media/hantro/
> F: Documentation/devicetree/bindings/media/nxp,imx8mq-vpu.yaml
> -F: Documentation/devicetree/bindings/media/rockchip-vpu.txt
> +F: Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>
> ROCKER DRIVER
> M: Jiri Pirko <[email protected]>
> --
> 2.26.0.rc2
>
On Thu, 2020-03-26 at 10:55 -0600, Rob Herring wrote:
> On Wed, 25 Mar 2020 18:34:38 -0300, Ezequiel Garcia wrote:
> > Convert Rockchip VPU (Hantro IP block) codec driver documentation to
> > json-schema.
> >
> > Cc: Mark Rutland <[email protected]>
> > Cc: Rob Herring <[email protected]>
> > Signed-off-by: Ezequiel Garcia <[email protected]>
> > ---
> > .../bindings/media/rockchip-vpu.txt | 43 ----------
> > .../bindings/media/rockchip-vpu.yaml | 82 +++++++++++++++++++
> > MAINTAINERS | 2 +-
> > 3 files changed, 83 insertions(+), 44 deletions(-)
> > delete mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.txt
> > create mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> >
>
> My bot found errors running 'make dt_binding_check' on your patch:
>
> Error: Documentation/devicetree/bindings/media/rockchip-vpu.example.dts:28.41-42 syntax error
> FATAL ERROR: Unable to parse input tree
> scripts/Makefile.lib:311: recipe for target 'Documentation/devicetree/bindings/media/rockchip-vpu.example.dt.yaml' failed
> make[1]: *** [Documentation/devicetree/bindings/media/rockchip-vpu.example.dt.yaml] Error 1
> make[1]: *** Waiting for unfinished jobs....
> Makefile:1262: recipe for target 'dt_binding_check' failed
> make: *** [dt_binding_check] Error 2
>
> See https://patchwork.ozlabs.org/patch/1261669
>
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure dt-schema is up to date:
>
> pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade
>
> Please check and re-submit.
>
Sure, I will.
Sorry about that!
Ezequiel
Hey Rob,
On Thu, 2020-03-26 at 10:59 -0600, Rob Herring wrote:
> On Wed, Mar 25, 2020 at 3:35 PM Ezequiel Garcia <[email protected]> wrote:
> > Convert Rockchip VPU (Hantro IP block) codec driver documentation to
> > json-schema.
> >
> > Cc: Mark Rutland <[email protected]>
> > Cc: Rob Herring <[email protected]>
> > Signed-off-by: Ezequiel Garcia <[email protected]>
> > ---
> > .../bindings/media/rockchip-vpu.txt | 43 ----------
> > .../bindings/media/rockchip-vpu.yaml | 82 +++++++++++++++++++
> > MAINTAINERS | 2 +-
> > 3 files changed, 83 insertions(+), 44 deletions(-)
> > delete mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.txt
> > create mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.txt b/Documentation/devicetree/bindings/media/rockchip-vpu.txt
> > deleted file mode 100644
> > index 339252d9c515..000000000000
> > --- a/Documentation/devicetree/bindings/media/rockchip-vpu.txt
> > +++ /dev/null
> > @@ -1,43 +0,0 @@
> > -device-tree bindings for rockchip VPU codec
> > -
> > -Rockchip (Video Processing Unit) present in various Rockchip platforms,
> > -such as RK3288, RK3328 and RK3399.
> > -
> > -Required properties:
> > -- compatible: value should be one of the following
> > - "rockchip,rk3288-vpu";
> > - "rockchip,rk3328-vpu";
> > - "rockchip,rk3399-vpu";
> > -- interrupts: encoding and decoding interrupt specifiers
> > -- interrupt-names: should be
> > - "vepu", "vdpu" on RK3288 and RK3399,
> > - "vdpu" on RK3328.
> > -- clocks: phandle to VPU aclk, hclk clocks
> > -- clock-names: should be "aclk" and "hclk"
> > -- power-domains: phandle to power domain node
> > -- iommus: phandle to a iommu node
> > -
> > -Example:
> > -SoC-specific DT entry:
> > - vpu: video-codec@ff9a0000 {
> > - compatible = "rockchip,rk3288-vpu";
> > - reg = <0x0 0xff9a0000 0x0 0x800>;
> > - interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
> > - <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
> > - interrupt-names = "vepu", "vdpu";
> > - clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
> > - clock-names = "aclk", "hclk";
> > - power-domains = <&power RK3288_PD_VIDEO>;
> > - iommus = <&vpu_mmu>;
> > - };
> > -
> > - vpu: video-codec@ff350000 {
> > - compatible = "rockchip,rk3328-vpu";
> > - reg = <0x0 0xff350000 0x0 0x800>;
> > - interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
> > - interrupt-names = "vdpu";
> > - clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
> > - clock-names = "aclk", "hclk";
> > - power-domains = <&power RK3328_PD_VPU>;
> > - iommus = <&vpu_mmu>;
> > - };
> > diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> > new file mode 100644
> > index 000000000000..a0c45e05cf03
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> > @@ -0,0 +1,82 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +
> > +%YAML 1.2
> > +---
> > +$id: "http://devicetree.org/schemas/media/rockchip-vpu.yaml#"
> > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> > +
> > +title: Hantro G1 VPU codecs implemented on Rockchip SoCs
> > +
> > +maintainers:
> > + - Ezequiel Garcia <[email protected]>
> > +
> > +description:
> > + Hantro G1 video encode and decode accelerators present on Rockchip SoCs.
> > +
> > +properties:
> > + compatible:
> > + enum:
> > + - rockchip,rk3288-vpu
> > + - rockchip,rk3328-vpu
> > + - rockchip,rk3399-vpu
> > +
> > + reg:
> > + maxItems: 1
> > +
> > + interrupts:
> > + maxItems: 2
> > +
> > + interrupt-names:
> > + items:
> > + - const: vepu
> > + - const: vdpu
> > +
> > + clocks:
> > + maxItems: 2
> > +
> > + clock-names:
> > + items:
> > + - const: aclk
> > + - const: hclk
> > +
> > + power-domains:
> > + maxItems: 1
> > +
> > + iommus:
> > + maxItems: 1
> > +
> > +required:
> > + - compatible
> > + - reg
> > + - interrupts
> > + - interrupt-names
> > + - clocks
> > + - clock-names
>
> Add:
>
> additionalProperties: false
>
OK.
> > +
> > +examples:
> > + - |
> > + #include <dt-bindings/clock/rk3288-cru.h>
> > + #include <dt-bindings/interrupt-controller/arm-gic.h>
> > +
> > + vpu: video-codec@ff9a0000 {
> > + compatible = "rockchip,rk3288-vpu";
> > + reg = <0x0 0xff9a0000 0x0 0x800>;
> > + interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
> > + <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
> > + interrupt-names = "vepu", "vdpu";
> > + clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
> > + clock-names = "aclk", "hclk";
> > + power-domains = <&power RK3288_PD_VIDEO>;
>
> Header for this define?
>
Indeed, now the check passes. I'll get a v4 just for this patch.
Thanks,
Ezequiel
> > + iommus = <&vpu_mmu>;
> > + };
> > +
> > + vpu: video-codec@ff350000 {
> > + compatible = "rockchip,rk3328-vpu";
> > + reg = <0x0 0xff350000 0x0 0x800>;
> > + interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
> > + interrupt-names = "vdpu";
> > + clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
> > + clock-names = "aclk", "hclk";
> > + power-domains = <&power RK3328_PD_VPU>;
> > + iommus = <&vpu_mmu>;
> > + };
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index d66ac41ef587..2b8b3e7f3df3 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -14320,7 +14320,7 @@ L: [email protected]
> > S: Maintained
> > F: drivers/staging/media/hantro/
> > F: Documentation/devicetree/bindings/media/nxp,imx8mq-vpu.yaml
> > -F: Documentation/devicetree/bindings/media/rockchip-vpu.txt
> > +F: Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> >
> > ROCKER DRIVER
> > M: Jiri Pirko <[email protected]>
> > --
> > 2.26.0.rc2
> >
Convert Rockchip VPU (Hantro IP block) codec driver documentation to
json-schema.
Cc: Mark Rutland <[email protected]>
Cc: Rob Herring <[email protected]>
Signed-off-by: Ezequiel Garcia <[email protected]>
---
v4:
* Fix issues pointed out by Rob,
and make sure now dt_binding_check passes.
.../bindings/media/rockchip-vpu.txt | 43 -----------
.../bindings/media/rockchip-vpu.yaml | 74 +++++++++++++++++++
MAINTAINERS | 2 +-
3 files changed, 75 insertions(+), 44 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.txt
create mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.yaml
diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.txt b/Documentation/devicetree/bindings/media/rockchip-vpu.txt
deleted file mode 100644
index 339252d9c515..000000000000
--- a/Documentation/devicetree/bindings/media/rockchip-vpu.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-device-tree bindings for rockchip VPU codec
-
-Rockchip (Video Processing Unit) present in various Rockchip platforms,
-such as RK3288, RK3328 and RK3399.
-
-Required properties:
-- compatible: value should be one of the following
- "rockchip,rk3288-vpu";
- "rockchip,rk3328-vpu";
- "rockchip,rk3399-vpu";
-- interrupts: encoding and decoding interrupt specifiers
-- interrupt-names: should be
- "vepu", "vdpu" on RK3288 and RK3399,
- "vdpu" on RK3328.
-- clocks: phandle to VPU aclk, hclk clocks
-- clock-names: should be "aclk" and "hclk"
-- power-domains: phandle to power domain node
-- iommus: phandle to a iommu node
-
-Example:
-SoC-specific DT entry:
- vpu: video-codec@ff9a0000 {
- compatible = "rockchip,rk3288-vpu";
- reg = <0x0 0xff9a0000 0x0 0x800>;
- interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "vepu", "vdpu";
- clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
- clock-names = "aclk", "hclk";
- power-domains = <&power RK3288_PD_VIDEO>;
- iommus = <&vpu_mmu>;
- };
-
- vpu: video-codec@ff350000 {
- compatible = "rockchip,rk3328-vpu";
- reg = <0x0 0xff350000 0x0 0x800>;
- interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "vdpu";
- clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
- clock-names = "aclk", "hclk";
- power-domains = <&power RK3328_PD_VPU>;
- iommus = <&vpu_mmu>;
- };
diff --git a/Documentation/devicetree/bindings/media/rockchip-vpu.yaml b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
new file mode 100644
index 000000000000..d7a42e6f9bcf
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/rockchip-vpu.yaml
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/media/rockchip-vpu.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Hantro G1 VPU codecs implemented on Rockchip SoCs
+
+maintainers:
+ - Ezequiel Garcia <[email protected]>
+
+description:
+ Hantro G1 video encode and decode accelerators present on Rockchip SoCs.
+
+properties:
+ compatible:
+ enum:
+ - rockchip,rk3288-vpu
+ - rockchip,rk3328-vpu
+ - rockchip,rk3399-vpu
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 2
+
+ interrupt-names:
+ items:
+ - const: vepu
+ - const: vdpu
+
+ clocks:
+ maxItems: 2
+
+ clock-names:
+ items:
+ - const: aclk
+ - const: hclk
+
+ power-domains:
+ maxItems: 1
+
+ iommus:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - interrupt-names
+ - clocks
+ - clock-names
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/rk3288-cru.h>
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/power/rk3288-power.h>
+
+ vpu: video-codec@ff9a0000 {
+ compatible = "rockchip,rk3288-vpu";
+ reg = <0x0 0xff9a0000 0x0 0x800>;
+ interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "vepu", "vdpu";
+ clocks = <&cru ACLK_VCODEC>, <&cru HCLK_VCODEC>;
+ clock-names = "aclk", "hclk";
+ power-domains = <&power RK3288_PD_VIDEO>;
+ iommus = <&vpu_mmu>;
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index d66ac41ef587..2b8b3e7f3df3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14320,7 +14320,7 @@ L: [email protected]
S: Maintained
F: drivers/staging/media/hantro/
F: Documentation/devicetree/bindings/media/nxp,imx8mq-vpu.yaml
-F: Documentation/devicetree/bindings/media/rockchip-vpu.txt
+F: Documentation/devicetree/bindings/media/rockchip-vpu.yaml
ROCKER DRIVER
M: Jiri Pirko <[email protected]>
--
2.26.0.rc2
On Thu, Mar 26, 2020 at 1:14 PM Ezequiel Garcia <[email protected]> wrote:
>
> Convert Rockchip VPU (Hantro IP block) codec driver documentation to
> json-schema.
>
> Cc: Mark Rutland <[email protected]>
> Cc: Rob Herring <[email protected]>
> Signed-off-by: Ezequiel Garcia <[email protected]>
> ---
> v4:
> * Fix issues pointed out by Rob,
> and make sure now dt_binding_check passes.
>
> .../bindings/media/rockchip-vpu.txt | 43 -----------
> .../bindings/media/rockchip-vpu.yaml | 74 +++++++++++++++++++
> MAINTAINERS | 2 +-
> 3 files changed, 75 insertions(+), 44 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.txt
> create mode 100644 Documentation/devicetree/bindings/media/rockchip-vpu.yaml
Reviewed-by: Rob Herring <[email protected]>
Hi Heiko,
This patch was applied by the media people Hans and Ezequil without note
and test I think.
make ARCH=arm64 dtbs_check
DT_SCHEMA_FILES=Documentation/devicetree/bindings/media/rockchip-vpu.yaml
Errors for example:
DTC arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml
CHECK arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml
arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml: video-codec@ff350000:
interrupts: [[0, 9, 4]] is too short
arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml: video-codec@ff350000:
interrupt-names: ['vdpu'] is too short
arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml: video-codec@ff350000:
interrupt-names:0: 'vepu' was expected
See:
https://lore.kernel.org/lkml/[email protected]/
+ interrupts:
+ minItems: 1
+ maxItems: 2
+
+ interrupt-names:
+ oneOf:
+ - const: vdpu
+ - items:
+ - const: vepu
+ - const: vdpu
Vs.:
+ interrupts:
+ maxItems: 2
+
+ interrupt-names:
+ items:
+ - const: vepu
+ - const: vdpu
Hey Johan,
On Mon, 2020-04-20 at 15:33 +0200, Johan Jonker wrote:
> Hi Heiko,
>
> This patch was applied by the media people Hans and Ezequil without note
> and test I think.
>
I did test it, but I guess something felt thru the cracks.
If you'd be kind enough to submit a patch, that would be lovely.
Thanks!
Ezequiel
> make ARCH=arm64 dtbs_check
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>
> Errors for example:
>
> DTC arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml
> CHECK arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml
> arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml: video-codec@ff350000:
> interrupts: [[0, 9, 4]] is too short
> arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml: video-codec@ff350000:
> interrupt-names: ['vdpu'] is too short
> arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml: video-codec@ff350000:
> interrupt-names:0: 'vepu' was expected
>
> See:
> https://lore.kernel.org/lkml/[email protected]/
>
> + interrupts:
> + minItems: 1
> + maxItems: 2
> +
> + interrupt-names:
> + oneOf:
> + - const: vdpu
> + - items:
> + - const: vepu
> + - const: vdpu
>
> Vs.:
>
>
> + interrupts:
> + maxItems: 2
> +
> + interrupt-names:
> + items:
> + - const: vepu
> + - const: vdpu
Hi,
Question for the media maintainers Hans & Co. :
What's nxp,imx8mq-vpu.yaml doing under rga?
Why is rockchip-vpu.yaml inserted under rga instead of vpu?
Johan
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f0e7b4d17fcc..0cfd86594b0b 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -14471,7 +14471,8 @@ M: Jacob Chen <[email protected]>
> M: Ezequiel Garcia <[email protected]>
> L: [email protected]
> S: Maintained
> -F: Documentation/devicetree/bindings/media/rockchip-rga.txt
> +F: Documentation/devicetree/bindings/media/nxp,imx8mq-vpu.yaml
> +F: Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> F: drivers/media/platform/rockchip/rga/
HANTRO VPU CODEC DRIVER
M: Ezequiel Garcia <[email protected]>
M: Philipp Zabel <[email protected]>
L: [email protected]
L: [email protected]
S: Maintained
F: Documentation/devicetree/bindings/media/nxp,imx8mq-vpu.yaml
F: Documentation/devicetree/bindings/media/rockchip-vpu.txt
F: drivers/staging/media/hantro/
ROCKCHIP RASTER 2D GRAPHIC ACCELERATION UNIT DRIVER
M: Jacob Chen <[email protected]>
M: Ezequiel Garcia <[email protected]>
L: [email protected]
S: Maintained
F: Documentation/devicetree/bindings/media/nxp,imx8mq-vpu.yaml
F: Documentation/devicetree/bindings/media/rockchip-vpu.yaml
F: drivers/media/platform/rockchip/rga/
Hi,
Also add
L: [email protected]
to all Rockchip related MAINTAINERS items.
On 4/21/20 3:19 PM, Johan Jonker wrote:
> Hi,
>
> Question for the media maintainers Hans & Co. :
>
> What's nxp,imx8mq-vpu.yaml doing under rga?
> Why is rockchip-vpu.yaml inserted under rga instead of vpu?
>
> Johan
>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index f0e7b4d17fcc..0cfd86594b0b 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -14471,7 +14471,8 @@ M: Jacob Chen <[email protected]>
>> M: Ezequiel Garcia <[email protected]>
>> L: [email protected]
>> S: Maintained
>> -F: Documentation/devicetree/bindings/media/rockchip-rga.txt
>> +F: Documentation/devicetree/bindings/media/nxp,imx8mq-vpu.yaml
>> +F: Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>> F: drivers/media/platform/rockchip/rga/
>
> HANTRO VPU CODEC DRIVER
> M: Ezequiel Garcia <[email protected]>
> M: Philipp Zabel <[email protected]>
> L: [email protected]
> L: [email protected]
> S: Maintained
> F: Documentation/devicetree/bindings/media/nxp,imx8mq-vpu.yaml
> F: Documentation/devicetree/bindings/media/rockchip-vpu.txt
> F: drivers/staging/media/hantro/
>
> ROCKCHIP RASTER 2D GRAPHIC ACCELERATION UNIT DRIVER
> M: Jacob Chen <[email protected]>
> M: Ezequiel Garcia <[email protected]>
> L: [email protected]
Add list
> S: Maintained
> F: Documentation/devicetree/bindings/media/nxp,imx8mq-vpu.yaml
> F: Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> F: drivers/media/platform/rockchip/rga/
>
ROCKCHIP VIDEO DECODER DRIVER
M: Ezequiel Garcia <[email protected]>
L: [email protected]
Add list
S: Maintained
F: drivers/staging/media/rkvdec/
F: Documentation/devicetree/bindings/media/rockchip,vdec.yaml
ROCKCHIP ISP V1 DRIVER
M: Helen Koike <[email protected]>
L: [email protected]
Add list
S: Maintained
F: drivers/staging/media/rkisp1/
On 21/04/2020 15:19, Johan Jonker wrote:
> Hi,
>
> Question for the media maintainers Hans & Co. :
>
> What's nxp,imx8mq-vpu.yaml doing under rga?
> Why is rockchip-vpu.yaml inserted under rga instead of vpu?
That's clearly wrong. Probably my fault when trying to resolve
a conflict.
Ezequiel, can you make a patch fixing this? It's probably a good
idea if you double-check these entries to make sure I didn't inadvertently
introduce more mistakes.
Regards,
Hans
>
> Johan
>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index f0e7b4d17fcc..0cfd86594b0b 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -14471,7 +14471,8 @@ M: Jacob Chen <[email protected]>
>> M: Ezequiel Garcia <[email protected]>
>> L: [email protected]
>> S: Maintained
>> -F: Documentation/devicetree/bindings/media/rockchip-rga.txt
>> +F: Documentation/devicetree/bindings/media/nxp,imx8mq-vpu.yaml
>> +F: Documentation/devicetree/bindings/media/rockchip-vpu.yaml
>> F: drivers/media/platform/rockchip/rga/
>
> HANTRO VPU CODEC DRIVER
> M: Ezequiel Garcia <[email protected]>
> M: Philipp Zabel <[email protected]>
> L: [email protected]
> L: [email protected]
> S: Maintained
> F: Documentation/devicetree/bindings/media/nxp,imx8mq-vpu.yaml
> F: Documentation/devicetree/bindings/media/rockchip-vpu.txt
> F: drivers/staging/media/hantro/
>
> ROCKCHIP RASTER 2D GRAPHIC ACCELERATION UNIT DRIVER
> M: Jacob Chen <[email protected]>
> M: Ezequiel Garcia <[email protected]>
> L: [email protected]
> S: Maintained
> F: Documentation/devicetree/bindings/media/nxp,imx8mq-vpu.yaml
> F: Documentation/devicetree/bindings/media/rockchip-vpu.yaml
> F: drivers/media/platform/rockchip/rga/
>
On Tue, 2020-04-21 at 15:44 +0200, Hans Verkuil wrote:
> On 21/04/2020 15:19, Johan Jonker wrote:
> > Hi,
> >
> > Question for the media maintainers Hans & Co. :
> >
> > What's nxp,imx8mq-vpu.yaml doing under rga?
> > Why is rockchip-vpu.yaml inserted under rga instead of vpu?
>
> That's clearly wrong. Probably my fault when trying to resolve
> a conflict.
>
> Ezequiel, can you make a patch fixing this? It's probably a good
> idea if you double-check these entries to make sure I didn't inadvertently
> introduce more mistakes.
>
Sure, no worries.
Ezequiel