All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
@ 2021-03-11 15:40 ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov

Hi all

This series adds support for the Microchip SAMA5D4 VPU, which it based
on the Hantro G1.

The hardware can support up-to 1280x720 for each of the MPEG2, VP8 and
H264 codecs. There is only a single decoder and no encoders on the SoC.

The Hantro G1 post-processing is also enabled on the platform.

To minimise duplication, the series starts with a few small cleanups.


As you may have noticed, this is my first patches series to linux-media,
so any tips how to make this as smoother process are appreciated.


Changes in v2:
 - Add testing results in the cover letter (thanks Eze)
 - s/Atmel/Microchip/ through the series (thanks Nicolas)
 - Split defconfig change into separate commit (thanks Eze, Nicolas)
 - Added Reviewed-by and Fixes tags (thanks Philipp)
 - Split DT into separate commit, wrote binding document, fixup minor DT
   warnings (thanks Eze)
 - Rebased on top of 5.12-rc2, as per Linus' email to avoid 5.12-rc1
   https://lwn.net/Articles/848265/



Testing
-------

 - v4l-compliance

Command used:
  v4l2-compliance -m0

Output summary:

v4l2-compliance 1.21.0-4740, 32 bits, 32-bit time_t
v4l2-compliance SHA: f253495fa6de 2021-03-06 15:32:09

Compliance test for hantro-vpu device /dev/media0:

Total for hantro-vpu device /dev/media0: 8, Succeeded: 8, Failed: 0,
Warnings: 0

Compliance test for hantro-vpu device /dev/video0:

Total for hantro-vpu device /dev/video0: 46, Succeeded: 46, Failed: 0,
Warnings: 0


 - Post-processor testing

Command used:
  gst-launch-1.0 -v filesrc location=test.mp4  ! decodebin3 !
video/x-raw,format=YUY2 ! ...

Confirmed the VPU is used by observing the interrupts triggering, strace
showed extra v4l2 ioctls - VIDIOC_S_FMT(... V4L2_PIX_FMT_YUYV  ...)


 - MPEG2 testing, custom ffmpeg from
   https://github.com/Kwiboo/FFmpeg/commits/v4l2-request-hwaccel-4.3

Command used:
  ffmpeg -hwaccel drm -i mpeg2.mpeg2 -f rawvideo -pix_fmt yuv420p out.raw

Confirmed the VPU is used by observing the interrupts triggering, strace
showed the v4l2 ioctls being used plus played back the resulting file.


 - VP8 testing, using fluster

Command used:
  fluster.py run -ts VP8-TEST-VECTORS -d GStreamer-VP8-V4L2SL-Gst1.0

Output summary:

Running test suite VP8-TEST-VECTORS with decoder GStreamer-VP8-V4L2SL-Gst1.0
Ran 61 tests in 103.273s

FAILED (failures=9, errors=2)


 - H264 testing, using fluster

Command used:
  fluster.py run -ts JVT-AVC_V1 -d GStreamer-H.264-V4L2SL-Gst1.0

Output summary:

Running test suite JVT-AVC_V1 with decoder GStreamer-H.264-V4L2SL-Gst1.0
Ran 135 tests in 420.444s

FAILED (failures=9, errors=55)


Looking forward to your feedback,
Emil


Emil Velikov (10):
  media: hantro: use G1_REG_INTERRUPT directly for the mpeg2
  media: hantro: imx: reuse MB_DIM define
  media: hantro: imx: remove duplicate dec_base init
  media: hantro: imx: remove unused include
  media: hantro: introduce hantro_g1.c for common API
  media: dt-bindings: Document SAMA5D4 VDEC bindings
  media: hantro: add initial SAMA5D4 support
  ARM: dts: sama5d4: enable Hantro G1 VDEC
  ARM: configs: at91: sama5: update with savedefconfig
  ARM: configs: at91: sama5: enable the Hantro G1 engine

 .../media/microchip,sama5d4-vdec.yaml         |  59 +++++++++
 arch/arm/boot/dts/sama5d4.dtsi                |   9 ++
 arch/arm/configs/sama5_defconfig              |  40 +++---
 drivers/staging/media/hantro/Kconfig          |  10 +-
 drivers/staging/media/hantro/Makefile         |   4 +
 drivers/staging/media/hantro/hantro_drv.c     |   3 +
 drivers/staging/media/hantro/hantro_g1.c      |  39 ++++++
 .../media/hantro/hantro_g1_mpeg2_dec.c        |   5 +-
 drivers/staging/media/hantro/hantro_hw.h      |   4 +
 drivers/staging/media/hantro/imx8m_vpu_hw.c   |  27 +---
 drivers/staging/media/hantro/rk3288_vpu_hw.c  |  36 +-----
 .../staging/media/hantro/sama5d4_vdec_hw.c    | 117 ++++++++++++++++++
 12 files changed, 274 insertions(+), 79 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
 create mode 100644 drivers/staging/media/hantro/hantro_g1.c
 create mode 100644 drivers/staging/media/hantro/sama5d4_vdec_hw.c

-- 
2.30.1


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
@ 2021-03-11 15:40 ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov

Hi all

This series adds support for the Microchip SAMA5D4 VPU, which it based
on the Hantro G1.

The hardware can support up-to 1280x720 for each of the MPEG2, VP8 and
H264 codecs. There is only a single decoder and no encoders on the SoC.

The Hantro G1 post-processing is also enabled on the platform.

To minimise duplication, the series starts with a few small cleanups.


As you may have noticed, this is my first patches series to linux-media,
so any tips how to make this as smoother process are appreciated.


Changes in v2:
 - Add testing results in the cover letter (thanks Eze)
 - s/Atmel/Microchip/ through the series (thanks Nicolas)
 - Split defconfig change into separate commit (thanks Eze, Nicolas)
 - Added Reviewed-by and Fixes tags (thanks Philipp)
 - Split DT into separate commit, wrote binding document, fixup minor DT
   warnings (thanks Eze)
 - Rebased on top of 5.12-rc2, as per Linus' email to avoid 5.12-rc1
   https://lwn.net/Articles/848265/



Testing
-------

 - v4l-compliance

Command used:
  v4l2-compliance -m0

Output summary:

v4l2-compliance 1.21.0-4740, 32 bits, 32-bit time_t
v4l2-compliance SHA: f253495fa6de 2021-03-06 15:32:09

Compliance test for hantro-vpu device /dev/media0:

Total for hantro-vpu device /dev/media0: 8, Succeeded: 8, Failed: 0,
Warnings: 0

Compliance test for hantro-vpu device /dev/video0:

Total for hantro-vpu device /dev/video0: 46, Succeeded: 46, Failed: 0,
Warnings: 0


 - Post-processor testing

Command used:
  gst-launch-1.0 -v filesrc location=test.mp4  ! decodebin3 !
video/x-raw,format=YUY2 ! ...

Confirmed the VPU is used by observing the interrupts triggering, strace
showed extra v4l2 ioctls - VIDIOC_S_FMT(... V4L2_PIX_FMT_YUYV  ...)


 - MPEG2 testing, custom ffmpeg from
   https://github.com/Kwiboo/FFmpeg/commits/v4l2-request-hwaccel-4.3

Command used:
  ffmpeg -hwaccel drm -i mpeg2.mpeg2 -f rawvideo -pix_fmt yuv420p out.raw

Confirmed the VPU is used by observing the interrupts triggering, strace
showed the v4l2 ioctls being used plus played back the resulting file.


 - VP8 testing, using fluster

Command used:
  fluster.py run -ts VP8-TEST-VECTORS -d GStreamer-VP8-V4L2SL-Gst1.0

Output summary:

Running test suite VP8-TEST-VECTORS with decoder GStreamer-VP8-V4L2SL-Gst1.0
Ran 61 tests in 103.273s

FAILED (failures=9, errors=2)


 - H264 testing, using fluster

Command used:
  fluster.py run -ts JVT-AVC_V1 -d GStreamer-H.264-V4L2SL-Gst1.0

Output summary:

Running test suite JVT-AVC_V1 with decoder GStreamer-H.264-V4L2SL-Gst1.0
Ran 135 tests in 420.444s

FAILED (failures=9, errors=55)


Looking forward to your feedback,
Emil


Emil Velikov (10):
  media: hantro: use G1_REG_INTERRUPT directly for the mpeg2
  media: hantro: imx: reuse MB_DIM define
  media: hantro: imx: remove duplicate dec_base init
  media: hantro: imx: remove unused include
  media: hantro: introduce hantro_g1.c for common API
  media: dt-bindings: Document SAMA5D4 VDEC bindings
  media: hantro: add initial SAMA5D4 support
  ARM: dts: sama5d4: enable Hantro G1 VDEC
  ARM: configs: at91: sama5: update with savedefconfig
  ARM: configs: at91: sama5: enable the Hantro G1 engine

 .../media/microchip,sama5d4-vdec.yaml         |  59 +++++++++
 arch/arm/boot/dts/sama5d4.dtsi                |   9 ++
 arch/arm/configs/sama5_defconfig              |  40 +++---
 drivers/staging/media/hantro/Kconfig          |  10 +-
 drivers/staging/media/hantro/Makefile         |   4 +
 drivers/staging/media/hantro/hantro_drv.c     |   3 +
 drivers/staging/media/hantro/hantro_g1.c      |  39 ++++++
 .../media/hantro/hantro_g1_mpeg2_dec.c        |   5 +-
 drivers/staging/media/hantro/hantro_hw.h      |   4 +
 drivers/staging/media/hantro/imx8m_vpu_hw.c   |  27 +---
 drivers/staging/media/hantro/rk3288_vpu_hw.c  |  36 +-----
 .../staging/media/hantro/sama5d4_vdec_hw.c    | 117 ++++++++++++++++++
 12 files changed, 274 insertions(+), 79 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
 create mode 100644 drivers/staging/media/hantro/hantro_g1.c
 create mode 100644 drivers/staging/media/hantro/sama5d4_vdec_hw.c

-- 
2.30.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2 01/10] media: hantro: use G1_REG_INTERRUPT directly for the mpeg2
  2021-03-11 15:40 ` Emil Velikov
@ 2021-03-11 15:40   ` Emil Velikov
  -1 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov

From: Emil Velikov <emil.velikov@collabora.com>

Use the register directly over the existing SWREG().

Ideally we'll port the driver away from the local registers, but for
now this is enough. For context - I was reading through the IRQ register
handling across the variants.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c b/drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c
index 6386a3989bfe..0fd306806f16 100644
--- a/drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c
+++ b/drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c
@@ -10,6 +10,7 @@
 #include <media/v4l2-mem2mem.h>
 #include "hantro.h"
 #include "hantro_hw.h"
+#include "hantro_g1_regs.h"
 
 #define G1_SWREG(nr)			((nr) * 4)
 
@@ -20,7 +21,6 @@
 #define G1_REG_REFER2_BASE		G1_SWREG(16)
 #define G1_REG_REFER3_BASE		G1_SWREG(17)
 #define G1_REG_QTABLE_BASE		G1_SWREG(40)
-#define G1_REG_DEC_E(v)			((v) ? BIT(0) : 0)
 
 #define G1_REG_DEC_AXI_RD_ID(v)		(((v) << 24) & GENMASK(31, 24))
 #define G1_REG_DEC_TIMEOUT_E(v)		((v) ? BIT(23) : 0)
@@ -246,6 +246,5 @@ void hantro_g1_mpeg2_dec_run(struct hantro_ctx *ctx)
 
 	hantro_end_prepare_run(ctx);
 
-	reg = G1_REG_DEC_E(1);
-	vdpu_write(vpu, reg, G1_SWREG(1));
+	vdpu_write(vpu, G1_REG_INTERRUPT_DEC_E, G1_REG_INTERRUPT);
 }
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 01/10] media: hantro: use G1_REG_INTERRUPT directly for the mpeg2
@ 2021-03-11 15:40   ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov

From: Emil Velikov <emil.velikov@collabora.com>

Use the register directly over the existing SWREG().

Ideally we'll port the driver away from the local registers, but for
now this is enough. For context - I was reading through the IRQ register
handling across the variants.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c b/drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c
index 6386a3989bfe..0fd306806f16 100644
--- a/drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c
+++ b/drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c
@@ -10,6 +10,7 @@
 #include <media/v4l2-mem2mem.h>
 #include "hantro.h"
 #include "hantro_hw.h"
+#include "hantro_g1_regs.h"
 
 #define G1_SWREG(nr)			((nr) * 4)
 
@@ -20,7 +21,6 @@
 #define G1_REG_REFER2_BASE		G1_SWREG(16)
 #define G1_REG_REFER3_BASE		G1_SWREG(17)
 #define G1_REG_QTABLE_BASE		G1_SWREG(40)
-#define G1_REG_DEC_E(v)			((v) ? BIT(0) : 0)
 
 #define G1_REG_DEC_AXI_RD_ID(v)		(((v) << 24) & GENMASK(31, 24))
 #define G1_REG_DEC_TIMEOUT_E(v)		((v) ? BIT(23) : 0)
@@ -246,6 +246,5 @@ void hantro_g1_mpeg2_dec_run(struct hantro_ctx *ctx)
 
 	hantro_end_prepare_run(ctx);
 
-	reg = G1_REG_DEC_E(1);
-	vdpu_write(vpu, reg, G1_SWREG(1));
+	vdpu_write(vpu, G1_REG_INTERRUPT_DEC_E, G1_REG_INTERRUPT);
 }
-- 
2.30.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 02/10] media: hantro: imx: reuse MB_DIM define
  2021-03-11 15:40 ` Emil Velikov
@ 2021-03-11 15:40   ` Emil Velikov
  -1 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov

From: Emil Velikov <emil.velikov@collabora.com>

Swap the hardcoded 16 with MB_DIM define.

Fixes: 8e4aaa687863 ("media: hantro: add initial i.MX8MQ support")
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 drivers/staging/media/hantro/imx8m_vpu_hw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c
index c222de075ef4..1f48c1956cd2 100644
--- a/drivers/staging/media/hantro/imx8m_vpu_hw.c
+++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c
@@ -109,10 +109,10 @@ static const struct hantro_fmt imx8m_vpu_dec_fmts[] = {
 		.frmsize = {
 			.min_width = 48,
 			.max_width = 3840,
-			.step_width = 16,
+			.step_width = MB_DIM,
 			.min_height = 48,
 			.max_height = 2160,
-			.step_height = 16,
+			.step_height = MB_DIM,
 		},
 	},
 	{
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 02/10] media: hantro: imx: reuse MB_DIM define
@ 2021-03-11 15:40   ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov

From: Emil Velikov <emil.velikov@collabora.com>

Swap the hardcoded 16 with MB_DIM define.

Fixes: 8e4aaa687863 ("media: hantro: add initial i.MX8MQ support")
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 drivers/staging/media/hantro/imx8m_vpu_hw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c
index c222de075ef4..1f48c1956cd2 100644
--- a/drivers/staging/media/hantro/imx8m_vpu_hw.c
+++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c
@@ -109,10 +109,10 @@ static const struct hantro_fmt imx8m_vpu_dec_fmts[] = {
 		.frmsize = {
 			.min_width = 48,
 			.max_width = 3840,
-			.step_width = 16,
+			.step_width = MB_DIM,
 			.min_height = 48,
 			.max_height = 2160,
-			.step_height = 16,
+			.step_height = MB_DIM,
 		},
 	},
 	{
-- 
2.30.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 03/10] media: hantro: imx: remove duplicate dec_base init
  2021-03-11 15:40 ` Emil Velikov
@ 2021-03-11 15:40   ` Emil Velikov
  -1 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov

From: Emil Velikov <emil.velikov@collabora.com>

The vpu->dec_base is already set by the hantro driver itself.

Fixes: 8e4aaa687863 ("media: hantro: add initial i.MX8MQ support")
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 drivers/staging/media/hantro/imx8m_vpu_hw.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c
index 1f48c1956cd2..cb1ac02c03d2 100644
--- a/drivers/staging/media/hantro/imx8m_vpu_hw.c
+++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c
@@ -150,7 +150,6 @@ static irqreturn_t imx8m_vpu_g1_irq(int irq, void *dev_id)
 
 static int imx8mq_vpu_hw_init(struct hantro_dev *vpu)
 {
-	vpu->dec_base = vpu->reg_bases[0];
 	vpu->ctrl_base = vpu->reg_bases[vpu->variant->num_regs - 1];
 
 	return 0;
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 03/10] media: hantro: imx: remove duplicate dec_base init
@ 2021-03-11 15:40   ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov

From: Emil Velikov <emil.velikov@collabora.com>

The vpu->dec_base is already set by the hantro driver itself.

Fixes: 8e4aaa687863 ("media: hantro: add initial i.MX8MQ support")
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 drivers/staging/media/hantro/imx8m_vpu_hw.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c
index 1f48c1956cd2..cb1ac02c03d2 100644
--- a/drivers/staging/media/hantro/imx8m_vpu_hw.c
+++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c
@@ -150,7 +150,6 @@ static irqreturn_t imx8m_vpu_g1_irq(int irq, void *dev_id)
 
 static int imx8mq_vpu_hw_init(struct hantro_dev *vpu)
 {
-	vpu->dec_base = vpu->reg_bases[0];
 	vpu->ctrl_base = vpu->reg_bases[vpu->variant->num_regs - 1];
 
 	return 0;
-- 
2.30.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 04/10] media: hantro: imx: remove unused include
  2021-03-11 15:40 ` Emil Velikov
@ 2021-03-11 15:40   ` Emil Velikov
  -1 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov

From: Emil Velikov <emil.velikov@collabora.com>

The current imx8 code does not use the jpeg encoder. Remove the
unnecessary include.

Fixes: 8e4aaa687863 ("media: hantro: add initial i.MX8MQ support")
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 drivers/staging/media/hantro/imx8m_vpu_hw.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c
index cb1ac02c03d2..f36c1bd681ba 100644
--- a/drivers/staging/media/hantro/imx8m_vpu_hw.c
+++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c
@@ -9,7 +9,6 @@
 #include <linux/delay.h>
 
 #include "hantro.h"
-#include "hantro_jpeg.h"
 #include "hantro_g1_regs.h"
 
 #define CTRL_SOFT_RESET		0x00
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 04/10] media: hantro: imx: remove unused include
@ 2021-03-11 15:40   ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov

From: Emil Velikov <emil.velikov@collabora.com>

The current imx8 code does not use the jpeg encoder. Remove the
unnecessary include.

Fixes: 8e4aaa687863 ("media: hantro: add initial i.MX8MQ support")
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 drivers/staging/media/hantro/imx8m_vpu_hw.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c
index cb1ac02c03d2..f36c1bd681ba 100644
--- a/drivers/staging/media/hantro/imx8m_vpu_hw.c
+++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c
@@ -9,7 +9,6 @@
 #include <linux/delay.h>
 
 #include "hantro.h"
-#include "hantro_jpeg.h"
 #include "hantro_g1_regs.h"
 
 #define CTRL_SOFT_RESET		0x00
-- 
2.30.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 05/10] media: hantro: introduce hantro_g1.c for common API
  2021-03-11 15:40 ` Emil Velikov
@ 2021-03-11 15:40   ` Emil Velikov
  -1 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov

From: Emil Velikov <emil.velikov@collabora.com>

The Hantro G1 IRQ and reset handling it pretty standard. I was this
close to duplicating it, yet again, before reconsidering and refactoring
it to a separate file.

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 drivers/staging/media/hantro/Makefile        |  1 +
 drivers/staging/media/hantro/hantro_g1.c     | 39 ++++++++++++++++++++
 drivers/staging/media/hantro/hantro_hw.h     |  3 ++
 drivers/staging/media/hantro/imx8m_vpu_hw.c  | 21 +----------
 drivers/staging/media/hantro/rk3288_vpu_hw.c | 36 ++----------------
 5 files changed, 48 insertions(+), 52 deletions(-)
 create mode 100644 drivers/staging/media/hantro/hantro_g1.c

diff --git a/drivers/staging/media/hantro/Makefile b/drivers/staging/media/hantro/Makefile
index 743ce08eb184..3747a32799b2 100644
--- a/drivers/staging/media/hantro/Makefile
+++ b/drivers/staging/media/hantro/Makefile
@@ -7,6 +7,7 @@ hantro-vpu-y += \
 		hantro_v4l2.o \
 		hantro_postproc.o \
 		hantro_h1_jpeg_enc.o \
+		hantro_g1.o \
 		hantro_g1_h264_dec.o \
 		hantro_g1_mpeg2_dec.o \
 		hantro_g1_vp8_dec.o \
diff --git a/drivers/staging/media/hantro/hantro_g1.c b/drivers/staging/media/hantro/hantro_g1.c
new file mode 100644
index 000000000000..0ab1cee62218
--- /dev/null
+++ b/drivers/staging/media/hantro/hantro_g1.c
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Hantro VPU codec driver
+ *
+ * Copyright (C) 2018 Rockchip Electronics Co., Ltd.
+ *	Jeffy Chen <jeffy.chen@rock-chips.com>
+ * Copyright (C) 2019 Pengutronix, Philipp Zabel <kernel@pengutronix.de>
+ * Copyright (C) 2021 Collabora Ltd, Emil Velikov <emil.velikov@collabora.com>
+ */
+
+#include "hantro.h"
+#include "hantro_g1_regs.h"
+
+irqreturn_t hantro_g1_irq(int irq, void *dev_id)
+{
+	struct hantro_dev *vpu = dev_id;
+	enum vb2_buffer_state state;
+	u32 status;
+
+	status = vdpu_read(vpu, G1_REG_INTERRUPT);
+	state = (status & G1_REG_INTERRUPT_DEC_RDY_INT) ?
+		 VB2_BUF_STATE_DONE : VB2_BUF_STATE_ERROR;
+
+	vdpu_write(vpu, 0, G1_REG_INTERRUPT);
+	vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG);
+
+	hantro_irq_done(vpu, state);
+
+	return IRQ_HANDLED;
+}
+
+void hantro_g1_reset(struct hantro_ctx *ctx)
+{
+	struct hantro_dev *vpu = ctx->dev;
+
+	vdpu_write(vpu, G1_REG_INTERRUPT_DEC_IRQ_DIS, G1_REG_INTERRUPT);
+	vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG);
+	vdpu_write(vpu, 1, G1_REG_SOFT_RESET);
+}
diff --git a/drivers/staging/media/hantro/hantro_hw.h b/drivers/staging/media/hantro/hantro_hw.h
index 34c9e4649a25..73c71bb2320c 100644
--- a/drivers/staging/media/hantro/hantro_hw.h
+++ b/drivers/staging/media/hantro/hantro_hw.h
@@ -164,6 +164,9 @@ void hantro_irq_done(struct hantro_dev *vpu,
 void hantro_start_prepare_run(struct hantro_ctx *ctx);
 void hantro_end_prepare_run(struct hantro_ctx *ctx);
 
+irqreturn_t hantro_g1_irq(int irq, void *dev_id);
+void hantro_g1_reset(struct hantro_ctx *ctx);
+
 void hantro_h1_jpeg_enc_run(struct hantro_ctx *ctx);
 void rk3399_vpu_jpeg_enc_run(struct hantro_ctx *ctx);
 int hantro_jpeg_enc_init(struct hantro_ctx *ctx);
diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c
index f36c1bd681ba..9eb556460e52 100644
--- a/drivers/staging/media/hantro/imx8m_vpu_hw.c
+++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c
@@ -9,7 +9,6 @@
 #include <linux/delay.h>
 
 #include "hantro.h"
-#include "hantro_g1_regs.h"
 
 #define CTRL_SOFT_RESET		0x00
 #define RESET_G1		BIT(1)
@@ -129,24 +128,6 @@ static const struct hantro_fmt imx8m_vpu_dec_fmts[] = {
 	},
 };
 
-static irqreturn_t imx8m_vpu_g1_irq(int irq, void *dev_id)
-{
-	struct hantro_dev *vpu = dev_id;
-	enum vb2_buffer_state state;
-	u32 status;
-
-	status = vdpu_read(vpu, G1_REG_INTERRUPT);
-	state = (status & G1_REG_INTERRUPT_DEC_RDY_INT) ?
-		 VB2_BUF_STATE_DONE : VB2_BUF_STATE_ERROR;
-
-	vdpu_write(vpu, 0, G1_REG_INTERRUPT);
-	vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG);
-
-	hantro_irq_done(vpu, state);
-
-	return IRQ_HANDLED;
-}
-
 static int imx8mq_vpu_hw_init(struct hantro_dev *vpu)
 {
 	vpu->ctrl_base = vpu->reg_bases[vpu->variant->num_regs - 1];
@@ -191,7 +172,7 @@ static const struct hantro_codec_ops imx8mq_vpu_codec_ops[] = {
  */
 
 static const struct hantro_irq imx8mq_irqs[] = {
-	{ "g1", imx8m_vpu_g1_irq },
+	{ "g1", hantro_g1_irq },
 	{ "g2", NULL /* TODO: imx8m_vpu_g2_irq */ },
 };
 
diff --git a/drivers/staging/media/hantro/rk3288_vpu_hw.c b/drivers/staging/media/hantro/rk3288_vpu_hw.c
index 7b299ee3e93d..fefd45269e52 100644
--- a/drivers/staging/media/hantro/rk3288_vpu_hw.c
+++ b/drivers/staging/media/hantro/rk3288_vpu_hw.c
@@ -10,7 +10,6 @@
 
 #include "hantro.h"
 #include "hantro_jpeg.h"
-#include "hantro_g1_regs.h"
 #include "hantro_h1_regs.h"
 
 #define RK3288_ACLK_MAX_FREQ (400 * 1000 * 1000)
@@ -127,24 +126,6 @@ static irqreturn_t rk3288_vepu_irq(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static irqreturn_t rk3288_vdpu_irq(int irq, void *dev_id)
-{
-	struct hantro_dev *vpu = dev_id;
-	enum vb2_buffer_state state;
-	u32 status;
-
-	status = vdpu_read(vpu, G1_REG_INTERRUPT);
-	state = (status & G1_REG_INTERRUPT_DEC_RDY_INT) ?
-		VB2_BUF_STATE_DONE : VB2_BUF_STATE_ERROR;
-
-	vdpu_write(vpu, 0, G1_REG_INTERRUPT);
-	vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG);
-
-	hantro_irq_done(vpu, state);
-
-	return IRQ_HANDLED;
-}
-
 static int rk3288_vpu_hw_init(struct hantro_dev *vpu)
 {
 	/* Bump ACLK to max. possible freq. to improve performance. */
@@ -161,15 +142,6 @@ static void rk3288_vpu_enc_reset(struct hantro_ctx *ctx)
 	vepu_write(vpu, 0, H1_REG_AXI_CTRL);
 }
 
-static void rk3288_vpu_dec_reset(struct hantro_ctx *ctx)
-{
-	struct hantro_dev *vpu = ctx->dev;
-
-	vdpu_write(vpu, G1_REG_INTERRUPT_DEC_IRQ_DIS, G1_REG_INTERRUPT);
-	vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG);
-	vdpu_write(vpu, 1, G1_REG_SOFT_RESET);
-}
-
 /*
  * Supported codec ops.
  */
@@ -184,19 +156,19 @@ static const struct hantro_codec_ops rk3288_vpu_codec_ops[] = {
 	},
 	[HANTRO_MODE_H264_DEC] = {
 		.run = hantro_g1_h264_dec_run,
-		.reset = rk3288_vpu_dec_reset,
+		.reset = hantro_g1_reset,
 		.init = hantro_h264_dec_init,
 		.exit = hantro_h264_dec_exit,
 	},
 	[HANTRO_MODE_MPEG2_DEC] = {
 		.run = hantro_g1_mpeg2_dec_run,
-		.reset = rk3288_vpu_dec_reset,
+		.reset = hantro_g1_reset,
 		.init = hantro_mpeg2_dec_init,
 		.exit = hantro_mpeg2_dec_exit,
 	},
 	[HANTRO_MODE_VP8_DEC] = {
 		.run = hantro_g1_vp8_dec_run,
-		.reset = rk3288_vpu_dec_reset,
+		.reset = hantro_g1_reset,
 		.init = hantro_vp8_dec_init,
 		.exit = hantro_vp8_dec_exit,
 	},
@@ -208,7 +180,7 @@ static const struct hantro_codec_ops rk3288_vpu_codec_ops[] = {
 
 static const struct hantro_irq rk3288_irqs[] = {
 	{ "vepu", rk3288_vepu_irq },
-	{ "vdpu", rk3288_vdpu_irq },
+	{ "vdpu", hantro_g1_irq },
 };
 
 static const char * const rk3288_clk_names[] = {
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 05/10] media: hantro: introduce hantro_g1.c for common API
@ 2021-03-11 15:40   ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov

From: Emil Velikov <emil.velikov@collabora.com>

The Hantro G1 IRQ and reset handling it pretty standard. I was this
close to duplicating it, yet again, before reconsidering and refactoring
it to a separate file.

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 drivers/staging/media/hantro/Makefile        |  1 +
 drivers/staging/media/hantro/hantro_g1.c     | 39 ++++++++++++++++++++
 drivers/staging/media/hantro/hantro_hw.h     |  3 ++
 drivers/staging/media/hantro/imx8m_vpu_hw.c  | 21 +----------
 drivers/staging/media/hantro/rk3288_vpu_hw.c | 36 ++----------------
 5 files changed, 48 insertions(+), 52 deletions(-)
 create mode 100644 drivers/staging/media/hantro/hantro_g1.c

diff --git a/drivers/staging/media/hantro/Makefile b/drivers/staging/media/hantro/Makefile
index 743ce08eb184..3747a32799b2 100644
--- a/drivers/staging/media/hantro/Makefile
+++ b/drivers/staging/media/hantro/Makefile
@@ -7,6 +7,7 @@ hantro-vpu-y += \
 		hantro_v4l2.o \
 		hantro_postproc.o \
 		hantro_h1_jpeg_enc.o \
+		hantro_g1.o \
 		hantro_g1_h264_dec.o \
 		hantro_g1_mpeg2_dec.o \
 		hantro_g1_vp8_dec.o \
diff --git a/drivers/staging/media/hantro/hantro_g1.c b/drivers/staging/media/hantro/hantro_g1.c
new file mode 100644
index 000000000000..0ab1cee62218
--- /dev/null
+++ b/drivers/staging/media/hantro/hantro_g1.c
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Hantro VPU codec driver
+ *
+ * Copyright (C) 2018 Rockchip Electronics Co., Ltd.
+ *	Jeffy Chen <jeffy.chen@rock-chips.com>
+ * Copyright (C) 2019 Pengutronix, Philipp Zabel <kernel@pengutronix.de>
+ * Copyright (C) 2021 Collabora Ltd, Emil Velikov <emil.velikov@collabora.com>
+ */
+
+#include "hantro.h"
+#include "hantro_g1_regs.h"
+
+irqreturn_t hantro_g1_irq(int irq, void *dev_id)
+{
+	struct hantro_dev *vpu = dev_id;
+	enum vb2_buffer_state state;
+	u32 status;
+
+	status = vdpu_read(vpu, G1_REG_INTERRUPT);
+	state = (status & G1_REG_INTERRUPT_DEC_RDY_INT) ?
+		 VB2_BUF_STATE_DONE : VB2_BUF_STATE_ERROR;
+
+	vdpu_write(vpu, 0, G1_REG_INTERRUPT);
+	vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG);
+
+	hantro_irq_done(vpu, state);
+
+	return IRQ_HANDLED;
+}
+
+void hantro_g1_reset(struct hantro_ctx *ctx)
+{
+	struct hantro_dev *vpu = ctx->dev;
+
+	vdpu_write(vpu, G1_REG_INTERRUPT_DEC_IRQ_DIS, G1_REG_INTERRUPT);
+	vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG);
+	vdpu_write(vpu, 1, G1_REG_SOFT_RESET);
+}
diff --git a/drivers/staging/media/hantro/hantro_hw.h b/drivers/staging/media/hantro/hantro_hw.h
index 34c9e4649a25..73c71bb2320c 100644
--- a/drivers/staging/media/hantro/hantro_hw.h
+++ b/drivers/staging/media/hantro/hantro_hw.h
@@ -164,6 +164,9 @@ void hantro_irq_done(struct hantro_dev *vpu,
 void hantro_start_prepare_run(struct hantro_ctx *ctx);
 void hantro_end_prepare_run(struct hantro_ctx *ctx);
 
+irqreturn_t hantro_g1_irq(int irq, void *dev_id);
+void hantro_g1_reset(struct hantro_ctx *ctx);
+
 void hantro_h1_jpeg_enc_run(struct hantro_ctx *ctx);
 void rk3399_vpu_jpeg_enc_run(struct hantro_ctx *ctx);
 int hantro_jpeg_enc_init(struct hantro_ctx *ctx);
diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c
index f36c1bd681ba..9eb556460e52 100644
--- a/drivers/staging/media/hantro/imx8m_vpu_hw.c
+++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c
@@ -9,7 +9,6 @@
 #include <linux/delay.h>
 
 #include "hantro.h"
-#include "hantro_g1_regs.h"
 
 #define CTRL_SOFT_RESET		0x00
 #define RESET_G1		BIT(1)
@@ -129,24 +128,6 @@ static const struct hantro_fmt imx8m_vpu_dec_fmts[] = {
 	},
 };
 
-static irqreturn_t imx8m_vpu_g1_irq(int irq, void *dev_id)
-{
-	struct hantro_dev *vpu = dev_id;
-	enum vb2_buffer_state state;
-	u32 status;
-
-	status = vdpu_read(vpu, G1_REG_INTERRUPT);
-	state = (status & G1_REG_INTERRUPT_DEC_RDY_INT) ?
-		 VB2_BUF_STATE_DONE : VB2_BUF_STATE_ERROR;
-
-	vdpu_write(vpu, 0, G1_REG_INTERRUPT);
-	vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG);
-
-	hantro_irq_done(vpu, state);
-
-	return IRQ_HANDLED;
-}
-
 static int imx8mq_vpu_hw_init(struct hantro_dev *vpu)
 {
 	vpu->ctrl_base = vpu->reg_bases[vpu->variant->num_regs - 1];
@@ -191,7 +172,7 @@ static const struct hantro_codec_ops imx8mq_vpu_codec_ops[] = {
  */
 
 static const struct hantro_irq imx8mq_irqs[] = {
-	{ "g1", imx8m_vpu_g1_irq },
+	{ "g1", hantro_g1_irq },
 	{ "g2", NULL /* TODO: imx8m_vpu_g2_irq */ },
 };
 
diff --git a/drivers/staging/media/hantro/rk3288_vpu_hw.c b/drivers/staging/media/hantro/rk3288_vpu_hw.c
index 7b299ee3e93d..fefd45269e52 100644
--- a/drivers/staging/media/hantro/rk3288_vpu_hw.c
+++ b/drivers/staging/media/hantro/rk3288_vpu_hw.c
@@ -10,7 +10,6 @@
 
 #include "hantro.h"
 #include "hantro_jpeg.h"
-#include "hantro_g1_regs.h"
 #include "hantro_h1_regs.h"
 
 #define RK3288_ACLK_MAX_FREQ (400 * 1000 * 1000)
@@ -127,24 +126,6 @@ static irqreturn_t rk3288_vepu_irq(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static irqreturn_t rk3288_vdpu_irq(int irq, void *dev_id)
-{
-	struct hantro_dev *vpu = dev_id;
-	enum vb2_buffer_state state;
-	u32 status;
-
-	status = vdpu_read(vpu, G1_REG_INTERRUPT);
-	state = (status & G1_REG_INTERRUPT_DEC_RDY_INT) ?
-		VB2_BUF_STATE_DONE : VB2_BUF_STATE_ERROR;
-
-	vdpu_write(vpu, 0, G1_REG_INTERRUPT);
-	vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG);
-
-	hantro_irq_done(vpu, state);
-
-	return IRQ_HANDLED;
-}
-
 static int rk3288_vpu_hw_init(struct hantro_dev *vpu)
 {
 	/* Bump ACLK to max. possible freq. to improve performance. */
@@ -161,15 +142,6 @@ static void rk3288_vpu_enc_reset(struct hantro_ctx *ctx)
 	vepu_write(vpu, 0, H1_REG_AXI_CTRL);
 }
 
-static void rk3288_vpu_dec_reset(struct hantro_ctx *ctx)
-{
-	struct hantro_dev *vpu = ctx->dev;
-
-	vdpu_write(vpu, G1_REG_INTERRUPT_DEC_IRQ_DIS, G1_REG_INTERRUPT);
-	vdpu_write(vpu, G1_REG_CONFIG_DEC_CLK_GATE_E, G1_REG_CONFIG);
-	vdpu_write(vpu, 1, G1_REG_SOFT_RESET);
-}
-
 /*
  * Supported codec ops.
  */
@@ -184,19 +156,19 @@ static const struct hantro_codec_ops rk3288_vpu_codec_ops[] = {
 	},
 	[HANTRO_MODE_H264_DEC] = {
 		.run = hantro_g1_h264_dec_run,
-		.reset = rk3288_vpu_dec_reset,
+		.reset = hantro_g1_reset,
 		.init = hantro_h264_dec_init,
 		.exit = hantro_h264_dec_exit,
 	},
 	[HANTRO_MODE_MPEG2_DEC] = {
 		.run = hantro_g1_mpeg2_dec_run,
-		.reset = rk3288_vpu_dec_reset,
+		.reset = hantro_g1_reset,
 		.init = hantro_mpeg2_dec_init,
 		.exit = hantro_mpeg2_dec_exit,
 	},
 	[HANTRO_MODE_VP8_DEC] = {
 		.run = hantro_g1_vp8_dec_run,
-		.reset = rk3288_vpu_dec_reset,
+		.reset = hantro_g1_reset,
 		.init = hantro_vp8_dec_init,
 		.exit = hantro_vp8_dec_exit,
 	},
@@ -208,7 +180,7 @@ static const struct hantro_codec_ops rk3288_vpu_codec_ops[] = {
 
 static const struct hantro_irq rk3288_irqs[] = {
 	{ "vepu", rk3288_vepu_irq },
-	{ "vdpu", rk3288_vdpu_irq },
+	{ "vdpu", hantro_g1_irq },
 };
 
 static const char * const rk3288_clk_names[] = {
-- 
2.30.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 06/10] media: dt-bindings: Document SAMA5D4 VDEC bindings
  2021-03-11 15:40 ` Emil Velikov
@ 2021-03-11 15:40   ` Emil Velikov
  -1 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov, Rob Herring, Frank Rowand, devicetree

From: Emil Velikov <emil.velikov@collabora.com>

Add devicetree binding documentation for the Hantro G1/G2 VDEC on
the Microchip SAMAS5D4 SoC.

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
v2
 - Newly introduced
 - s/Atmel/Microchip/ (Nicolas)
 - Drop leading 0 in node name/address
---
 .../media/microchip,sama5d4-vdec.yaml         | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml

diff --git a/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
new file mode 100644
index 000000000000..9cb2c0295d54
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/media/microchip,sama5d4-vdec.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Hantro G1 VPU codec implemented on Microchip SAMA5D4 SoCs
+
+maintainers:
+  - Emil Velikov <emil.velikov@collabora.com>
+
+description:
+  Hantro G1 video decode accelerator present on Microchip SAMA5D4 SoCs.
+
+properties:
+  compatible:
+    const: microchip,sama5d4-vdec
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-names:
+    items:
+      - const: vdec
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    items:
+      - const: vdec_clk
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - interrupt-names
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+        #include <dt-bindings/clock/at91.h>
+        #include <dt-bindings/interrupt-controller/irq.h>
+
+        vdec0: vdec@300000 {
+                compatible = "microchip,sama5d4-vdec";
+                reg = <0x00300000 0x100000>;
+                interrupts = <19 IRQ_TYPE_LEVEL_HIGH 4>;
+                interrupt-names = "vdec";
+                clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
+                clock-names = "vdec_clk";
+        };
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 06/10] media: dt-bindings: Document SAMA5D4 VDEC bindings
@ 2021-03-11 15:40   ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov, Rob Herring, Frank Rowand, devicetree

From: Emil Velikov <emil.velikov@collabora.com>

Add devicetree binding documentation for the Hantro G1/G2 VDEC on
the Microchip SAMAS5D4 SoC.

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
v2
 - Newly introduced
 - s/Atmel/Microchip/ (Nicolas)
 - Drop leading 0 in node name/address
---
 .../media/microchip,sama5d4-vdec.yaml         | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml

diff --git a/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
new file mode 100644
index 000000000000..9cb2c0295d54
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/media/microchip,sama5d4-vdec.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Hantro G1 VPU codec implemented on Microchip SAMA5D4 SoCs
+
+maintainers:
+  - Emil Velikov <emil.velikov@collabora.com>
+
+description:
+  Hantro G1 video decode accelerator present on Microchip SAMA5D4 SoCs.
+
+properties:
+  compatible:
+    const: microchip,sama5d4-vdec
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-names:
+    items:
+      - const: vdec
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    items:
+      - const: vdec_clk
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - interrupt-names
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+        #include <dt-bindings/clock/at91.h>
+        #include <dt-bindings/interrupt-controller/irq.h>
+
+        vdec0: vdec@300000 {
+                compatible = "microchip,sama5d4-vdec";
+                reg = <0x00300000 0x100000>;
+                interrupts = <19 IRQ_TYPE_LEVEL_HIGH 4>;
+                interrupt-names = "vdec";
+                clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
+                clock-names = "vdec_clk";
+        };
-- 
2.30.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 07/10] media: hantro: add initial SAMA5D4 support
  2021-03-11 15:40 ` Emil Velikov
@ 2021-03-11 15:40   ` Emil Velikov
  -1 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov, Rob Herring, Frank Rowand, devicetree

From: Emil Velikov <emil.velikov@collabora.com>

The SoC features a Hantro G1 compatible video decoder, supporting the
MPEG-2, VP8 and H264 codecs with resolutions up-to 1280x720.

Post-processing core is also available on the SoC.

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
v2
 - Split DT and defconfig changes to separate patches (Eze)
 - s/Atmel/Microchip/ (Nicolas)
---
 drivers/staging/media/hantro/Kconfig          |  10 +-
 drivers/staging/media/hantro/Makefile         |   3 +
 drivers/staging/media/hantro/hantro_drv.c     |   3 +
 drivers/staging/media/hantro/hantro_hw.h      |   1 +
 .../staging/media/hantro/sama5d4_vdec_hw.c    | 117 ++++++++++++++++++
 5 files changed, 133 insertions(+), 1 deletion(-)
 create mode 100644 drivers/staging/media/hantro/sama5d4_vdec_hw.c

diff --git a/drivers/staging/media/hantro/Kconfig b/drivers/staging/media/hantro/Kconfig
index 5b6cf9f62b1a..20b1f6d7b69c 100644
--- a/drivers/staging/media/hantro/Kconfig
+++ b/drivers/staging/media/hantro/Kconfig
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 config VIDEO_HANTRO
 	tristate "Hantro VPU driver"
-	depends on ARCH_MXC || ARCH_ROCKCHIP || COMPILE_TEST
+	depends on ARCH_MXC || ARCH_ROCKCHIP || ARCH_AT91 || COMPILE_TEST
 	depends on VIDEO_DEV && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select MEDIA_CONTROLLER_REQUEST_API
@@ -24,6 +24,14 @@ config VIDEO_HANTRO_IMX8M
 	help
 	  Enable support for i.MX8M SoCs.
 
+config VIDEO_HANTRO_SAMA5D4
+	bool "Hantro VDEC SAMA5D4 support"
+	depends on VIDEO_HANTRO
+	depends on ARCH_AT91 || COMPILE_TEST
+	default y
+	help
+	  Enable support for Microchip SAMA5D4 SoCs.
+
 config VIDEO_HANTRO_ROCKCHIP
 	bool "Hantro VPU Rockchip support"
 	depends on VIDEO_HANTRO
diff --git a/drivers/staging/media/hantro/Makefile b/drivers/staging/media/hantro/Makefile
index 3747a32799b2..f4b99901eeee 100644
--- a/drivers/staging/media/hantro/Makefile
+++ b/drivers/staging/media/hantro/Makefile
@@ -22,6 +22,9 @@ hantro-vpu-y += \
 hantro-vpu-$(CONFIG_VIDEO_HANTRO_IMX8M) += \
 		imx8m_vpu_hw.o
 
+hantro-vpu-$(CONFIG_VIDEO_HANTRO_SAMA5D4) += \
+		sama5d4_vdec_hw.o
+
 hantro-vpu-$(CONFIG_VIDEO_HANTRO_ROCKCHIP) += \
 		rk3288_vpu_hw.o \
 		rk3399_vpu_hw.o
diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
index e5f200e64993..a530c0eda595 100644
--- a/drivers/staging/media/hantro/hantro_drv.c
+++ b/drivers/staging/media/hantro/hantro_drv.c
@@ -478,6 +478,9 @@ static const struct of_device_id of_hantro_match[] = {
 #endif
 #ifdef CONFIG_VIDEO_HANTRO_IMX8M
 	{ .compatible = "nxp,imx8mq-vpu", .data = &imx8mq_vpu_variant, },
+#endif
+#ifdef CONFIG_VIDEO_HANTRO_SAMA5D4
+	{ .compatible = "microchip,sama5d4-vdec", .data = &sama5d4_vdec_variant, },
 #endif
 	{ /* sentinel */ }
 };
diff --git a/drivers/staging/media/hantro/hantro_hw.h b/drivers/staging/media/hantro/hantro_hw.h
index 73c71bb2320c..4d39da1d1581 100644
--- a/drivers/staging/media/hantro/hantro_hw.h
+++ b/drivers/staging/media/hantro/hantro_hw.h
@@ -152,6 +152,7 @@ extern const struct hantro_variant rk3399_vpu_variant;
 extern const struct hantro_variant rk3328_vpu_variant;
 extern const struct hantro_variant rk3288_vpu_variant;
 extern const struct hantro_variant imx8mq_vpu_variant;
+extern const struct hantro_variant sama5d4_vdec_variant;
 
 extern const struct hantro_postproc_regs hantro_g1_postproc_regs;
 
diff --git a/drivers/staging/media/hantro/sama5d4_vdec_hw.c b/drivers/staging/media/hantro/sama5d4_vdec_hw.c
new file mode 100644
index 000000000000..58ae72c2b723
--- /dev/null
+++ b/drivers/staging/media/hantro/sama5d4_vdec_hw.c
@@ -0,0 +1,117 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Hantro VDEC driver
+ *
+ * Copyright (C) 2021 Collabora Ltd, Emil Velikov <emil.velikov@collabora.com>
+ */
+
+#include "hantro.h"
+
+/*
+ * Supported formats.
+ */
+
+static const struct hantro_fmt sama5d4_vdec_postproc_fmts[] = {
+	{
+		.fourcc = V4L2_PIX_FMT_YUYV,
+		.codec_mode = HANTRO_MODE_NONE,
+	},
+};
+
+static const struct hantro_fmt sama5d4_vdec_fmts[] = {
+	{
+		.fourcc = V4L2_PIX_FMT_NV12,
+		.codec_mode = HANTRO_MODE_NONE,
+	},
+	{
+		.fourcc = V4L2_PIX_FMT_MPEG2_SLICE,
+		.codec_mode = HANTRO_MODE_MPEG2_DEC,
+		.max_depth = 2,
+		.frmsize = {
+			.min_width = 48,
+			.max_width = 1280,
+			.step_width = MB_DIM,
+			.min_height = 48,
+			.max_height = 720,
+			.step_height = MB_DIM,
+		},
+	},
+	{
+		.fourcc = V4L2_PIX_FMT_VP8_FRAME,
+		.codec_mode = HANTRO_MODE_VP8_DEC,
+		.max_depth = 2,
+		.frmsize = {
+			.min_width = 48,
+			.max_width = 1280,
+			.step_width = MB_DIM,
+			.min_height = 48,
+			.max_height = 720,
+			.step_height = MB_DIM,
+		},
+	},
+	{
+		.fourcc = V4L2_PIX_FMT_H264_SLICE,
+		.codec_mode = HANTRO_MODE_H264_DEC,
+		.max_depth = 2,
+		.frmsize = {
+			.min_width = 48,
+			.max_width = 1280,
+			.step_width = MB_DIM,
+			.min_height = 48,
+			.max_height = 720,
+			.step_height = MB_DIM,
+		},
+	},
+};
+
+static int sama5d4_hw_init(struct hantro_dev *vpu)
+{
+	return 0;
+}
+
+/*
+ * Supported codec ops.
+ */
+
+static const struct hantro_codec_ops sama5d4_vdec_codec_ops[] = {
+	[HANTRO_MODE_MPEG2_DEC] = {
+		.run = hantro_g1_mpeg2_dec_run,
+		.reset = hantro_g1_reset,
+		.init = hantro_mpeg2_dec_init,
+		.exit = hantro_mpeg2_dec_exit,
+	},
+	[HANTRO_MODE_VP8_DEC] = {
+		.run = hantro_g1_vp8_dec_run,
+		.reset = hantro_g1_reset,
+		.init = hantro_vp8_dec_init,
+		.exit = hantro_vp8_dec_exit,
+	},
+	[HANTRO_MODE_H264_DEC] = {
+		.run = hantro_g1_h264_dec_run,
+		.reset = hantro_g1_reset,
+		.init = hantro_h264_dec_init,
+		.exit = hantro_h264_dec_exit,
+	},
+};
+
+static const struct hantro_irq sama5d4_irqs[] = {
+	{ "vdec", hantro_g1_irq },
+};
+
+static const char * const sama5d4_clk_names[] = { "vdec_clk" };
+
+const struct hantro_variant sama5d4_vdec_variant = {
+	.dec_fmts = sama5d4_vdec_fmts,
+	.num_dec_fmts = ARRAY_SIZE(sama5d4_vdec_fmts),
+	.postproc_fmts = sama5d4_vdec_postproc_fmts,
+	.num_postproc_fmts = ARRAY_SIZE(sama5d4_vdec_postproc_fmts),
+	.postproc_regs = &hantro_g1_postproc_regs,
+	.codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
+		 HANTRO_H264_DECODER,
+	.codec_ops = sama5d4_vdec_codec_ops,
+	.init = sama5d4_hw_init,
+	.irqs = sama5d4_irqs,
+	.num_irqs = ARRAY_SIZE(sama5d4_irqs),
+	.clk_names = sama5d4_clk_names,
+	.num_clocks = ARRAY_SIZE(sama5d4_clk_names),
+};
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 07/10] media: hantro: add initial SAMA5D4 support
@ 2021-03-11 15:40   ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov, Rob Herring, Frank Rowand, devicetree

From: Emil Velikov <emil.velikov@collabora.com>

The SoC features a Hantro G1 compatible video decoder, supporting the
MPEG-2, VP8 and H264 codecs with resolutions up-to 1280x720.

Post-processing core is also available on the SoC.

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
v2
 - Split DT and defconfig changes to separate patches (Eze)
 - s/Atmel/Microchip/ (Nicolas)
---
 drivers/staging/media/hantro/Kconfig          |  10 +-
 drivers/staging/media/hantro/Makefile         |   3 +
 drivers/staging/media/hantro/hantro_drv.c     |   3 +
 drivers/staging/media/hantro/hantro_hw.h      |   1 +
 .../staging/media/hantro/sama5d4_vdec_hw.c    | 117 ++++++++++++++++++
 5 files changed, 133 insertions(+), 1 deletion(-)
 create mode 100644 drivers/staging/media/hantro/sama5d4_vdec_hw.c

diff --git a/drivers/staging/media/hantro/Kconfig b/drivers/staging/media/hantro/Kconfig
index 5b6cf9f62b1a..20b1f6d7b69c 100644
--- a/drivers/staging/media/hantro/Kconfig
+++ b/drivers/staging/media/hantro/Kconfig
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 config VIDEO_HANTRO
 	tristate "Hantro VPU driver"
-	depends on ARCH_MXC || ARCH_ROCKCHIP || COMPILE_TEST
+	depends on ARCH_MXC || ARCH_ROCKCHIP || ARCH_AT91 || COMPILE_TEST
 	depends on VIDEO_DEV && VIDEO_V4L2
 	select MEDIA_CONTROLLER
 	select MEDIA_CONTROLLER_REQUEST_API
@@ -24,6 +24,14 @@ config VIDEO_HANTRO_IMX8M
 	help
 	  Enable support for i.MX8M SoCs.
 
+config VIDEO_HANTRO_SAMA5D4
+	bool "Hantro VDEC SAMA5D4 support"
+	depends on VIDEO_HANTRO
+	depends on ARCH_AT91 || COMPILE_TEST
+	default y
+	help
+	  Enable support for Microchip SAMA5D4 SoCs.
+
 config VIDEO_HANTRO_ROCKCHIP
 	bool "Hantro VPU Rockchip support"
 	depends on VIDEO_HANTRO
diff --git a/drivers/staging/media/hantro/Makefile b/drivers/staging/media/hantro/Makefile
index 3747a32799b2..f4b99901eeee 100644
--- a/drivers/staging/media/hantro/Makefile
+++ b/drivers/staging/media/hantro/Makefile
@@ -22,6 +22,9 @@ hantro-vpu-y += \
 hantro-vpu-$(CONFIG_VIDEO_HANTRO_IMX8M) += \
 		imx8m_vpu_hw.o
 
+hantro-vpu-$(CONFIG_VIDEO_HANTRO_SAMA5D4) += \
+		sama5d4_vdec_hw.o
+
 hantro-vpu-$(CONFIG_VIDEO_HANTRO_ROCKCHIP) += \
 		rk3288_vpu_hw.o \
 		rk3399_vpu_hw.o
diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
index e5f200e64993..a530c0eda595 100644
--- a/drivers/staging/media/hantro/hantro_drv.c
+++ b/drivers/staging/media/hantro/hantro_drv.c
@@ -478,6 +478,9 @@ static const struct of_device_id of_hantro_match[] = {
 #endif
 #ifdef CONFIG_VIDEO_HANTRO_IMX8M
 	{ .compatible = "nxp,imx8mq-vpu", .data = &imx8mq_vpu_variant, },
+#endif
+#ifdef CONFIG_VIDEO_HANTRO_SAMA5D4
+	{ .compatible = "microchip,sama5d4-vdec", .data = &sama5d4_vdec_variant, },
 #endif
 	{ /* sentinel */ }
 };
diff --git a/drivers/staging/media/hantro/hantro_hw.h b/drivers/staging/media/hantro/hantro_hw.h
index 73c71bb2320c..4d39da1d1581 100644
--- a/drivers/staging/media/hantro/hantro_hw.h
+++ b/drivers/staging/media/hantro/hantro_hw.h
@@ -152,6 +152,7 @@ extern const struct hantro_variant rk3399_vpu_variant;
 extern const struct hantro_variant rk3328_vpu_variant;
 extern const struct hantro_variant rk3288_vpu_variant;
 extern const struct hantro_variant imx8mq_vpu_variant;
+extern const struct hantro_variant sama5d4_vdec_variant;
 
 extern const struct hantro_postproc_regs hantro_g1_postproc_regs;
 
diff --git a/drivers/staging/media/hantro/sama5d4_vdec_hw.c b/drivers/staging/media/hantro/sama5d4_vdec_hw.c
new file mode 100644
index 000000000000..58ae72c2b723
--- /dev/null
+++ b/drivers/staging/media/hantro/sama5d4_vdec_hw.c
@@ -0,0 +1,117 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Hantro VDEC driver
+ *
+ * Copyright (C) 2021 Collabora Ltd, Emil Velikov <emil.velikov@collabora.com>
+ */
+
+#include "hantro.h"
+
+/*
+ * Supported formats.
+ */
+
+static const struct hantro_fmt sama5d4_vdec_postproc_fmts[] = {
+	{
+		.fourcc = V4L2_PIX_FMT_YUYV,
+		.codec_mode = HANTRO_MODE_NONE,
+	},
+};
+
+static const struct hantro_fmt sama5d4_vdec_fmts[] = {
+	{
+		.fourcc = V4L2_PIX_FMT_NV12,
+		.codec_mode = HANTRO_MODE_NONE,
+	},
+	{
+		.fourcc = V4L2_PIX_FMT_MPEG2_SLICE,
+		.codec_mode = HANTRO_MODE_MPEG2_DEC,
+		.max_depth = 2,
+		.frmsize = {
+			.min_width = 48,
+			.max_width = 1280,
+			.step_width = MB_DIM,
+			.min_height = 48,
+			.max_height = 720,
+			.step_height = MB_DIM,
+		},
+	},
+	{
+		.fourcc = V4L2_PIX_FMT_VP8_FRAME,
+		.codec_mode = HANTRO_MODE_VP8_DEC,
+		.max_depth = 2,
+		.frmsize = {
+			.min_width = 48,
+			.max_width = 1280,
+			.step_width = MB_DIM,
+			.min_height = 48,
+			.max_height = 720,
+			.step_height = MB_DIM,
+		},
+	},
+	{
+		.fourcc = V4L2_PIX_FMT_H264_SLICE,
+		.codec_mode = HANTRO_MODE_H264_DEC,
+		.max_depth = 2,
+		.frmsize = {
+			.min_width = 48,
+			.max_width = 1280,
+			.step_width = MB_DIM,
+			.min_height = 48,
+			.max_height = 720,
+			.step_height = MB_DIM,
+		},
+	},
+};
+
+static int sama5d4_hw_init(struct hantro_dev *vpu)
+{
+	return 0;
+}
+
+/*
+ * Supported codec ops.
+ */
+
+static const struct hantro_codec_ops sama5d4_vdec_codec_ops[] = {
+	[HANTRO_MODE_MPEG2_DEC] = {
+		.run = hantro_g1_mpeg2_dec_run,
+		.reset = hantro_g1_reset,
+		.init = hantro_mpeg2_dec_init,
+		.exit = hantro_mpeg2_dec_exit,
+	},
+	[HANTRO_MODE_VP8_DEC] = {
+		.run = hantro_g1_vp8_dec_run,
+		.reset = hantro_g1_reset,
+		.init = hantro_vp8_dec_init,
+		.exit = hantro_vp8_dec_exit,
+	},
+	[HANTRO_MODE_H264_DEC] = {
+		.run = hantro_g1_h264_dec_run,
+		.reset = hantro_g1_reset,
+		.init = hantro_h264_dec_init,
+		.exit = hantro_h264_dec_exit,
+	},
+};
+
+static const struct hantro_irq sama5d4_irqs[] = {
+	{ "vdec", hantro_g1_irq },
+};
+
+static const char * const sama5d4_clk_names[] = { "vdec_clk" };
+
+const struct hantro_variant sama5d4_vdec_variant = {
+	.dec_fmts = sama5d4_vdec_fmts,
+	.num_dec_fmts = ARRAY_SIZE(sama5d4_vdec_fmts),
+	.postproc_fmts = sama5d4_vdec_postproc_fmts,
+	.num_postproc_fmts = ARRAY_SIZE(sama5d4_vdec_postproc_fmts),
+	.postproc_regs = &hantro_g1_postproc_regs,
+	.codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
+		 HANTRO_H264_DECODER,
+	.codec_ops = sama5d4_vdec_codec_ops,
+	.init = sama5d4_hw_init,
+	.irqs = sama5d4_irqs,
+	.num_irqs = ARRAY_SIZE(sama5d4_irqs),
+	.clk_names = sama5d4_clk_names,
+	.num_clocks = ARRAY_SIZE(sama5d4_clk_names),
+};
-- 
2.30.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 08/10] ARM: dts: sama5d4: enable Hantro G1 VDEC
  2021-03-11 15:40 ` Emil Velikov
@ 2021-03-11 15:40   ` Emil Velikov
  -1 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov, devicetree

From: Emil Velikov <emil.velikov@collabora.com>

Add the SAMA5D4 VDEC module which comprises Hantro G1 video decoder
core.

Cc: Rob Herring <robh+dt@kernel.org
Cc: Frank Rowand <frowand.list@gmail.com
Cc: devicetree@vger.kernel.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
v2
 - Split out of larger patch (Eze)
 - s/Atmel/Microchip/ (Nicolas)
 - Drop leading 0 in node name/address
---
 arch/arm/boot/dts/sama5d4.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/sama5d4.dtsi b/arch/arm/boot/dts/sama5d4.dtsi
index 05c55875835d..88284f60feb1 100644
--- a/arch/arm/boot/dts/sama5d4.dtsi
+++ b/arch/arm/boot/dts/sama5d4.dtsi
@@ -101,6 +101,15 @@ nfc_sram: sram@100000 {
 			ranges = <0 0x100000 0x2400>;
 		};
 
+		vdec0: vdec@300000 {
+			compatible = "microchip,sama5d4-vdec";
+			reg = <0x00300000 0x100000>;
+			interrupts = <19 IRQ_TYPE_LEVEL_HIGH 4>;
+			interrupt-names = "vdec";
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
+			clock-names = "vdec_clk";
+		};
+
 		usb0: gadget@400000 {
 			compatible = "atmel,sama5d3-udc";
 			reg = <0x00400000 0x100000
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 08/10] ARM: dts: sama5d4: enable Hantro G1 VDEC
@ 2021-03-11 15:40   ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov, devicetree

From: Emil Velikov <emil.velikov@collabora.com>

Add the SAMA5D4 VDEC module which comprises Hantro G1 video decoder
core.

Cc: Rob Herring <robh+dt@kernel.org
Cc: Frank Rowand <frowand.list@gmail.com
Cc: devicetree@vger.kernel.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
v2
 - Split out of larger patch (Eze)
 - s/Atmel/Microchip/ (Nicolas)
 - Drop leading 0 in node name/address
---
 arch/arm/boot/dts/sama5d4.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/sama5d4.dtsi b/arch/arm/boot/dts/sama5d4.dtsi
index 05c55875835d..88284f60feb1 100644
--- a/arch/arm/boot/dts/sama5d4.dtsi
+++ b/arch/arm/boot/dts/sama5d4.dtsi
@@ -101,6 +101,15 @@ nfc_sram: sram@100000 {
 			ranges = <0 0x100000 0x2400>;
 		};
 
+		vdec0: vdec@300000 {
+			compatible = "microchip,sama5d4-vdec";
+			reg = <0x00300000 0x100000>;
+			interrupts = <19 IRQ_TYPE_LEVEL_HIGH 4>;
+			interrupt-names = "vdec";
+			clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
+			clock-names = "vdec_clk";
+		};
+
 		usb0: gadget@400000 {
 			compatible = "atmel,sama5d3-udc";
 			reg = <0x00400000 0x100000
-- 
2.30.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 09/10] ARM: configs: at91: sama5: update with savedefconfig
  2021-03-11 15:40 ` Emil Velikov
  (?)
@ 2021-03-11 15:40   ` Emil Velikov
  -1 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov, Alexandre Belloni, Ludovic Desroches, linux-arm-kernel

From: Emil Velikov <emil.velikov@collabora.com>

While enabling an extra config, I've noticed that savedefconfig produced
a notable delta. Split out the no-op changes for clarity sake.

Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 arch/arm/configs/sama5_defconfig | 37 ++++++++++++++++----------------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig
index f4c3c0652432..a5f274e39753 100644
--- a/arch/arm/configs/sama5_defconfig
+++ b/arch/arm/configs/sama5_defconfig
@@ -8,11 +8,6 @@ CONFIG_CGROUPS=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EMBEDDED=y
 CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_FORCE_LOAD=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ARCH_AT91=y
 CONFIG_SOC_SAMA5D2=y
 CONFIG_SOC_SAMA5D3=y
@@ -25,9 +20,14 @@ CONFIG_KEXEC=y
 CONFIG_VFP=y
 CONFIG_NEON=y
 CONFIG_KERNEL_MODE_NEON=y
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_PM_DEBUG=y
 CONFIG_PM_ADVANCED_DEBUG=y
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -75,8 +75,8 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_NETDEVICES=y
 CONFIG_NET_DSA_MICROCHIP_KSZ9477=m
 CONFIG_NET_DSA_MICROCHIP_KSZ9477_SPI=m
-CONFIG_MACB=y
 # CONFIG_NET_VENDOR_BROADCOM is not set
+CONFIG_MACB=y
 # CONFIG_NET_VENDOR_CIRRUS is not set
 # CONFIG_NET_VENDOR_FARADAY is not set
 # CONFIG_NET_VENDOR_INTEL is not set
@@ -91,7 +91,9 @@ CONFIG_MACB=y
 CONFIG_MICREL_PHY=y
 CONFIG_LIBERTAS_THINFIRM=m
 CONFIG_LIBERTAS_THINFIRM_USB=m
-CONFIG_RTL8187=m
+CONFIG_MWIFIEX=m
+CONFIG_MWIFIEX_SDIO=m
+CONFIG_MWIFIEX_USB=m
 CONFIG_RT2X00=m
 CONFIG_RT2500USB=m
 CONFIG_RT73USB=m
@@ -99,10 +101,7 @@ CONFIG_RT2800USB=m
 CONFIG_RT2800USB_RT53XX=y
 CONFIG_RT2800USB_RT55XX=y
 CONFIG_RT2800USB_UNKNOWN=y
-CONFIG_MWIFIEX=m
-CONFIG_MWIFIEX_SDIO=m
-CONFIG_MWIFIEX_USB=m
-# CONFIG_INPUT_MOUSEDEV is not set
+CONFIG_RTL8187=m
 CONFIG_INPUT_EVDEV=y
 # CONFIG_KEYBOARD_ATKBD is not set
 CONFIG_KEYBOARD_QT1070=y
@@ -125,9 +124,9 @@ CONFIG_SPI_ATMEL_QUADSPI=y
 CONFIG_SPI_GPIO=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_SAMA5D2_PIOBU=m
+CONFIG_POWER_RESET=y
 CONFIG_POWER_SUPPLY=y
 CONFIG_BATTERY_ACT8945A=y
-CONFIG_POWER_RESET=y
 CONFIG_SENSORS_JC42=m
 CONFIG_WATCHDOG=y
 CONFIG_AT91SAM9X_WATCHDOG=y
@@ -166,11 +165,11 @@ CONFIG_SND=y
 CONFIG_SND_SOC=y
 CONFIG_SND_ATMEL_SOC=y
 CONFIG_SND_ATMEL_SOC_WM8904=y
-# CONFIG_HID_GENERIC is not set
 CONFIG_SND_ATMEL_SOC_CLASSD=y
 CONFIG_SND_ATMEL_SOC_PDMIC=y
 CONFIG_SND_ATMEL_SOC_TSE850_PCM5142=m
 CONFIG_SND_ATMEL_SOC_I2S=y
+# CONFIG_HID_GENERIC is not set
 CONFIG_USB=y
 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 CONFIG_USB_EHCI_HCD=y
@@ -224,14 +223,14 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
+CONFIG_CRYPTO_USER_API_HASH=m
+CONFIG_CRYPTO_USER_API_SKCIPHER=m
+CONFIG_CRYPTO_DEV_ATMEL_AES=y
+CONFIG_CRYPTO_DEV_ATMEL_TDES=y
+CONFIG_CRYPTO_DEV_ATMEL_SHA=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_MEMORY_INIT=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_FTRACE is not set
 CONFIG_DEBUG_USER=y
-CONFIG_CRYPTO_USER_API_HASH=m
-CONFIG_CRYPTO_USER_API_SKCIPHER=m
-CONFIG_CRYPTO_DEV_ATMEL_AES=y
-CONFIG_CRYPTO_DEV_ATMEL_TDES=y
-CONFIG_CRYPTO_DEV_ATMEL_SHA=y
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 09/10] ARM: configs: at91: sama5: update with savedefconfig
@ 2021-03-11 15:40   ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov, Alexandre Belloni, Ludovic Desroches, linux-arm-kernel

From: Emil Velikov <emil.velikov@collabora.com>

While enabling an extra config, I've noticed that savedefconfig produced
a notable delta. Split out the no-op changes for clarity sake.

Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 arch/arm/configs/sama5_defconfig | 37 ++++++++++++++++----------------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig
index f4c3c0652432..a5f274e39753 100644
--- a/arch/arm/configs/sama5_defconfig
+++ b/arch/arm/configs/sama5_defconfig
@@ -8,11 +8,6 @@ CONFIG_CGROUPS=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EMBEDDED=y
 CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_FORCE_LOAD=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ARCH_AT91=y
 CONFIG_SOC_SAMA5D2=y
 CONFIG_SOC_SAMA5D3=y
@@ -25,9 +20,14 @@ CONFIG_KEXEC=y
 CONFIG_VFP=y
 CONFIG_NEON=y
 CONFIG_KERNEL_MODE_NEON=y
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_PM_DEBUG=y
 CONFIG_PM_ADVANCED_DEBUG=y
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -75,8 +75,8 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_NETDEVICES=y
 CONFIG_NET_DSA_MICROCHIP_KSZ9477=m
 CONFIG_NET_DSA_MICROCHIP_KSZ9477_SPI=m
-CONFIG_MACB=y
 # CONFIG_NET_VENDOR_BROADCOM is not set
+CONFIG_MACB=y
 # CONFIG_NET_VENDOR_CIRRUS is not set
 # CONFIG_NET_VENDOR_FARADAY is not set
 # CONFIG_NET_VENDOR_INTEL is not set
@@ -91,7 +91,9 @@ CONFIG_MACB=y
 CONFIG_MICREL_PHY=y
 CONFIG_LIBERTAS_THINFIRM=m
 CONFIG_LIBERTAS_THINFIRM_USB=m
-CONFIG_RTL8187=m
+CONFIG_MWIFIEX=m
+CONFIG_MWIFIEX_SDIO=m
+CONFIG_MWIFIEX_USB=m
 CONFIG_RT2X00=m
 CONFIG_RT2500USB=m
 CONFIG_RT73USB=m
@@ -99,10 +101,7 @@ CONFIG_RT2800USB=m
 CONFIG_RT2800USB_RT53XX=y
 CONFIG_RT2800USB_RT55XX=y
 CONFIG_RT2800USB_UNKNOWN=y
-CONFIG_MWIFIEX=m
-CONFIG_MWIFIEX_SDIO=m
-CONFIG_MWIFIEX_USB=m
-# CONFIG_INPUT_MOUSEDEV is not set
+CONFIG_RTL8187=m
 CONFIG_INPUT_EVDEV=y
 # CONFIG_KEYBOARD_ATKBD is not set
 CONFIG_KEYBOARD_QT1070=y
@@ -125,9 +124,9 @@ CONFIG_SPI_ATMEL_QUADSPI=y
 CONFIG_SPI_GPIO=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_SAMA5D2_PIOBU=m
+CONFIG_POWER_RESET=y
 CONFIG_POWER_SUPPLY=y
 CONFIG_BATTERY_ACT8945A=y
-CONFIG_POWER_RESET=y
 CONFIG_SENSORS_JC42=m
 CONFIG_WATCHDOG=y
 CONFIG_AT91SAM9X_WATCHDOG=y
@@ -166,11 +165,11 @@ CONFIG_SND=y
 CONFIG_SND_SOC=y
 CONFIG_SND_ATMEL_SOC=y
 CONFIG_SND_ATMEL_SOC_WM8904=y
-# CONFIG_HID_GENERIC is not set
 CONFIG_SND_ATMEL_SOC_CLASSD=y
 CONFIG_SND_ATMEL_SOC_PDMIC=y
 CONFIG_SND_ATMEL_SOC_TSE850_PCM5142=m
 CONFIG_SND_ATMEL_SOC_I2S=y
+# CONFIG_HID_GENERIC is not set
 CONFIG_USB=y
 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 CONFIG_USB_EHCI_HCD=y
@@ -224,14 +223,14 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
+CONFIG_CRYPTO_USER_API_HASH=m
+CONFIG_CRYPTO_USER_API_SKCIPHER=m
+CONFIG_CRYPTO_DEV_ATMEL_AES=y
+CONFIG_CRYPTO_DEV_ATMEL_TDES=y
+CONFIG_CRYPTO_DEV_ATMEL_SHA=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_MEMORY_INIT=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_FTRACE is not set
 CONFIG_DEBUG_USER=y
-CONFIG_CRYPTO_USER_API_HASH=m
-CONFIG_CRYPTO_USER_API_SKCIPHER=m
-CONFIG_CRYPTO_DEV_ATMEL_AES=y
-CONFIG_CRYPTO_DEV_ATMEL_TDES=y
-CONFIG_CRYPTO_DEV_ATMEL_SHA=y
-- 
2.30.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 09/10] ARM: configs: at91: sama5: update with savedefconfig
@ 2021-03-11 15:40   ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov, Alexandre Belloni, Ludovic Desroches, linux-arm-kernel

From: Emil Velikov <emil.velikov@collabora.com>

While enabling an extra config, I've noticed that savedefconfig produced
a notable delta. Split out the no-op changes for clarity sake.

Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 arch/arm/configs/sama5_defconfig | 37 ++++++++++++++++----------------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig
index f4c3c0652432..a5f274e39753 100644
--- a/arch/arm/configs/sama5_defconfig
+++ b/arch/arm/configs/sama5_defconfig
@@ -8,11 +8,6 @@ CONFIG_CGROUPS=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EMBEDDED=y
 CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_FORCE_LOAD=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ARCH_AT91=y
 CONFIG_SOC_SAMA5D2=y
 CONFIG_SOC_SAMA5D3=y
@@ -25,9 +20,14 @@ CONFIG_KEXEC=y
 CONFIG_VFP=y
 CONFIG_NEON=y
 CONFIG_KERNEL_MODE_NEON=y
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_PM_DEBUG=y
 CONFIG_PM_ADVANCED_DEBUG=y
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -75,8 +75,8 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_NETDEVICES=y
 CONFIG_NET_DSA_MICROCHIP_KSZ9477=m
 CONFIG_NET_DSA_MICROCHIP_KSZ9477_SPI=m
-CONFIG_MACB=y
 # CONFIG_NET_VENDOR_BROADCOM is not set
+CONFIG_MACB=y
 # CONFIG_NET_VENDOR_CIRRUS is not set
 # CONFIG_NET_VENDOR_FARADAY is not set
 # CONFIG_NET_VENDOR_INTEL is not set
@@ -91,7 +91,9 @@ CONFIG_MACB=y
 CONFIG_MICREL_PHY=y
 CONFIG_LIBERTAS_THINFIRM=m
 CONFIG_LIBERTAS_THINFIRM_USB=m
-CONFIG_RTL8187=m
+CONFIG_MWIFIEX=m
+CONFIG_MWIFIEX_SDIO=m
+CONFIG_MWIFIEX_USB=m
 CONFIG_RT2X00=m
 CONFIG_RT2500USB=m
 CONFIG_RT73USB=m
@@ -99,10 +101,7 @@ CONFIG_RT2800USB=m
 CONFIG_RT2800USB_RT53XX=y
 CONFIG_RT2800USB_RT55XX=y
 CONFIG_RT2800USB_UNKNOWN=y
-CONFIG_MWIFIEX=m
-CONFIG_MWIFIEX_SDIO=m
-CONFIG_MWIFIEX_USB=m
-# CONFIG_INPUT_MOUSEDEV is not set
+CONFIG_RTL8187=m
 CONFIG_INPUT_EVDEV=y
 # CONFIG_KEYBOARD_ATKBD is not set
 CONFIG_KEYBOARD_QT1070=y
@@ -125,9 +124,9 @@ CONFIG_SPI_ATMEL_QUADSPI=y
 CONFIG_SPI_GPIO=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_SAMA5D2_PIOBU=m
+CONFIG_POWER_RESET=y
 CONFIG_POWER_SUPPLY=y
 CONFIG_BATTERY_ACT8945A=y
-CONFIG_POWER_RESET=y
 CONFIG_SENSORS_JC42=m
 CONFIG_WATCHDOG=y
 CONFIG_AT91SAM9X_WATCHDOG=y
@@ -166,11 +165,11 @@ CONFIG_SND=y
 CONFIG_SND_SOC=y
 CONFIG_SND_ATMEL_SOC=y
 CONFIG_SND_ATMEL_SOC_WM8904=y
-# CONFIG_HID_GENERIC is not set
 CONFIG_SND_ATMEL_SOC_CLASSD=y
 CONFIG_SND_ATMEL_SOC_PDMIC=y
 CONFIG_SND_ATMEL_SOC_TSE850_PCM5142=m
 CONFIG_SND_ATMEL_SOC_I2S=y
+# CONFIG_HID_GENERIC is not set
 CONFIG_USB=y
 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 CONFIG_USB_EHCI_HCD=y
@@ -224,14 +223,14 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
+CONFIG_CRYPTO_USER_API_HASH=m
+CONFIG_CRYPTO_USER_API_SKCIPHER=m
+CONFIG_CRYPTO_DEV_ATMEL_AES=y
+CONFIG_CRYPTO_DEV_ATMEL_TDES=y
+CONFIG_CRYPTO_DEV_ATMEL_SHA=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_MEMORY_INIT=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_FTRACE is not set
 CONFIG_DEBUG_USER=y
-CONFIG_CRYPTO_USER_API_HASH=m
-CONFIG_CRYPTO_USER_API_SKCIPHER=m
-CONFIG_CRYPTO_DEV_ATMEL_AES=y
-CONFIG_CRYPTO_DEV_ATMEL_TDES=y
-CONFIG_CRYPTO_DEV_ATMEL_SHA=y
-- 
2.30.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 10/10] ARM: configs: at91: sama5: enable the Hantro G1 engine
  2021-03-11 15:40 ` Emil Velikov
  (?)
@ 2021-03-11 15:40   ` Emil Velikov
  -1 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov, Alexandre Belloni, Ludovic Desroches, linux-arm-kernel

From: Emil Velikov <emil.velikov@collabora.com>

The SoC features a Hantro G1 compatible engine. Enable it by default, so
people can make use of it.

Keep it a module, as suggested by Nicolas

Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
v2
 - Split out of larger patch (Eze)
 - Build it as module (Nicolas)
---
 arch/arm/configs/sama5_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig
index a5f274e39753..5bcf16aecf2f 100644
--- a/arch/arm/configs/sama5_defconfig
+++ b/arch/arm/configs/sama5_defconfig
@@ -200,6 +200,9 @@ CONFIG_RTC_DRV_AT91RM9200=y
 CONFIG_DMADEVICES=y
 CONFIG_AT_HDMAC=y
 CONFIG_AT_XDMAC=y
+CONFIG_STAGING=y
+CONFIG_STAGING_MEDIA=y
+CONFIG_VIDEO_HANTRO=m
 # CONFIG_IOMMU_SUPPORT is not set
 CONFIG_IIO=y
 CONFIG_AT91_ADC=y
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 10/10] ARM: configs: at91: sama5: enable the Hantro G1 engine
@ 2021-03-11 15:40   ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov, Alexandre Belloni, Ludovic Desroches, linux-arm-kernel

From: Emil Velikov <emil.velikov@collabora.com>

The SoC features a Hantro G1 compatible engine. Enable it by default, so
people can make use of it.

Keep it a module, as suggested by Nicolas

Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
v2
 - Split out of larger patch (Eze)
 - Build it as module (Nicolas)
---
 arch/arm/configs/sama5_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig
index a5f274e39753..5bcf16aecf2f 100644
--- a/arch/arm/configs/sama5_defconfig
+++ b/arch/arm/configs/sama5_defconfig
@@ -200,6 +200,9 @@ CONFIG_RTC_DRV_AT91RM9200=y
 CONFIG_DMADEVICES=y
 CONFIG_AT_HDMAC=y
 CONFIG_AT_XDMAC=y
+CONFIG_STAGING=y
+CONFIG_STAGING_MEDIA=y
+CONFIG_VIDEO_HANTRO=m
 # CONFIG_IOMMU_SUPPORT is not set
 CONFIG_IIO=y
 CONFIG_AT91_ADC=y
-- 
2.30.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2 10/10] ARM: configs: at91: sama5: enable the Hantro G1 engine
@ 2021-03-11 15:40   ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-11 15:40 UTC (permalink / raw)
  To: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre
  Cc: emil.l.velikov, Alexandre Belloni, Ludovic Desroches, linux-arm-kernel

From: Emil Velikov <emil.velikov@collabora.com>

The SoC features a Hantro G1 compatible engine. Enable it by default, so
people can make use of it.

Keep it a module, as suggested by Nicolas

Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
v2
 - Split out of larger patch (Eze)
 - Build it as module (Nicolas)
---
 arch/arm/configs/sama5_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/configs/sama5_defconfig b/arch/arm/configs/sama5_defconfig
index a5f274e39753..5bcf16aecf2f 100644
--- a/arch/arm/configs/sama5_defconfig
+++ b/arch/arm/configs/sama5_defconfig
@@ -200,6 +200,9 @@ CONFIG_RTC_DRV_AT91RM9200=y
 CONFIG_DMADEVICES=y
 CONFIG_AT_HDMAC=y
 CONFIG_AT_XDMAC=y
+CONFIG_STAGING=y
+CONFIG_STAGING_MEDIA=y
+CONFIG_VIDEO_HANTRO=m
 # CONFIG_IOMMU_SUPPORT is not set
 CONFIG_IIO=y
 CONFIG_AT91_ADC=y
-- 
2.30.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
  2021-03-11 15:40 ` Emil Velikov
@ 2021-03-16 17:23   ` Ezequiel Garcia
  -1 siblings, 0 replies; 52+ messages in thread
From: Ezequiel Garcia @ 2021-03-16 17:23 UTC (permalink / raw)
  To: Emil Velikov, Philipp Zabel, linux-media, linux-rockchip, Nicolas Ferre
  Cc: Rob Herring, devicetree, Alexandre Belloni, ludovic.desroches

On Thu, 2021-03-11 at 15:40 +0000, Emil Velikov wrote:
> Hi all
> 
> This series adds support for the Microchip SAMA5D4 VPU, which it based
> on the Hantro G1.
> 
> The hardware can support up-to 1280x720 for each of the MPEG2, VP8 and
> H264 codecs. There is only a single decoder and no encoders on the SoC.
> 
> The Hantro G1 post-processing is also enabled on the platform.
> 
> To minimise duplication, the series starts with a few small cleanups.
> 
> 
> As you may have noticed, this is my first patches series to linux-media,
> so any tips how to make this as smoother process are appreciated.
> 
> 
> Changes in v2:
>  - Add testing results in the cover letter (thanks Eze)
>  - s/Atmel/Microchip/ through the series (thanks Nicolas)
>  - Split defconfig change into separate commit (thanks Eze, Nicolas)
>  - Added Reviewed-by and Fixes tags (thanks Philipp)
>  - Split DT into separate commit, wrote binding document, fixup minor DT
>    warnings (thanks Eze)
>  - Rebased on top of 5.12-rc2, as per Linus' email to avoid 5.12-rc1
>    https://lwn.net/Articles/848265/
> 
> 
> 
> Testing
> -------
> 
>  - v4l-compliance
> 
> Command used:
>   v4l2-compliance -m0
> 
> Output summary:
> 
> v4l2-compliance 1.21.0-4740, 32 bits, 32-bit time_t
> v4l2-compliance SHA: f253495fa6de 2021-03-06 15:32:09
> 
> Compliance test for hantro-vpu device /dev/media0:
> 
> Total for hantro-vpu device /dev/media0: 8, Succeeded: 8, Failed: 0,
> Warnings: 0
> 
> Compliance test for hantro-vpu device /dev/video0:
> 
> Total for hantro-vpu device /dev/video0: 46, Succeeded: 46, Failed: 0,
> Warnings: 0
> 
> 
>  - Post-processor testing
> 
> Command used:
>   gst-launch-1.0 -v filesrc location=test.mp4  ! decodebin3 !
> video/x-raw,format=YUY2 ! ...
> 
> Confirmed the VPU is used by observing the interrupts triggering, strace
> showed extra v4l2 ioctls - VIDIOC_S_FMT(... V4L2_PIX_FMT_YUYV  ...)
> 
> 
>  - MPEG2 testing, custom ffmpeg from
>    https://github.com/Kwiboo/FFmpeg/commits/v4l2-request-hwaccel-4.3
> 
> Command used:
>   ffmpeg -hwaccel drm -i mpeg2.mpeg2 -f rawvideo -pix_fmt yuv420p out.raw
> 
> Confirmed the VPU is used by observing the interrupts triggering, strace
> showed the v4l2 ioctls being used plus played back the resulting file.
> 
> 
>  - VP8 testing, using fluster
> 
> Command used:
>   fluster.py run -ts VP8-TEST-VECTORS -d GStreamer-VP8-V4L2SL-Gst1.0
> 
> Output summary:
> 
> Running test suite VP8-TEST-VECTORS with decoder GStreamer-VP8-V4L2SL-Gst1.0
> Ran 61 tests in 103.273s
> 
> FAILED (failures=9, errors=2)
> 
> 
>  - H264 testing, using fluster
> 
> Command used:
>   fluster.py run -ts JVT-AVC_V1 -d GStreamer-H.264-V4L2SL-Gst1.0
> 
> Output summary:
> 
> Running test suite JVT-AVC_V1 with decoder GStreamer-H.264-V4L2SL-Gst1.0
> Ran 135 tests in 420.444s
> 
> FAILED (failures=9, errors=55)
> 
> 
> Looking forward to your feedback,
> Emil
> 
> 
> Emil Velikov (10):
>   media: hantro: use G1_REG_INTERRUPT directly for the mpeg2
>   media: hantro: imx: reuse MB_DIM define
>   media: hantro: imx: remove duplicate dec_base init
>   media: hantro: imx: remove unused include
>   media: hantro: introduce hantro_g1.c for common API

For patches 1-5:

Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>

>   media: dt-bindings: Document SAMA5D4 VDEC bindings

This one need to be reviewed by DT maintainers, I think.

>   media: hantro: add initial SAMA5D4 support

For patch 7:

Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>

>   ARM: dts: sama5d4: enable Hantro G1 VDEC
>   ARM: configs: at91: sama5: update with savedefconfig
>   ARM: configs: at91: sama5: enable the Hantro G1 engine
> 

These need review from Microchip maintainers.

Thanks!
Ezequiel

>  .../media/microchip,sama5d4-vdec.yaml         |  59 +++++++++
>  arch/arm/boot/dts/sama5d4.dtsi                |   9 ++
>  arch/arm/configs/sama5_defconfig              |  40 +++---
>  drivers/staging/media/hantro/Kconfig          |  10 +-
>  drivers/staging/media/hantro/Makefile         |   4 +
>  drivers/staging/media/hantro/hantro_drv.c     |   3 +
>  drivers/staging/media/hantro/hantro_g1.c      |  39 ++++++
>  .../media/hantro/hantro_g1_mpeg2_dec.c        |   5 +-
>  drivers/staging/media/hantro/hantro_hw.h      |   4 +
>  drivers/staging/media/hantro/imx8m_vpu_hw.c   |  27 +---
>  drivers/staging/media/hantro/rk3288_vpu_hw.c  |  36 +-----
>  .../staging/media/hantro/sama5d4_vdec_hw.c    | 117 ++++++++++++++++++
>  12 files changed, 274 insertions(+), 79 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
>  create mode 100644 drivers/staging/media/hantro/hantro_g1.c
>  create mode 100644 drivers/staging/media/hantro/sama5d4_vdec_hw.c
> 



^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
@ 2021-03-16 17:23   ` Ezequiel Garcia
  0 siblings, 0 replies; 52+ messages in thread
From: Ezequiel Garcia @ 2021-03-16 17:23 UTC (permalink / raw)
  To: Emil Velikov, Philipp Zabel, linux-media, linux-rockchip, Nicolas Ferre
  Cc: Rob Herring, devicetree, Alexandre Belloni, ludovic.desroches

On Thu, 2021-03-11 at 15:40 +0000, Emil Velikov wrote:
> Hi all
> 
> This series adds support for the Microchip SAMA5D4 VPU, which it based
> on the Hantro G1.
> 
> The hardware can support up-to 1280x720 for each of the MPEG2, VP8 and
> H264 codecs. There is only a single decoder and no encoders on the SoC.
> 
> The Hantro G1 post-processing is also enabled on the platform.
> 
> To minimise duplication, the series starts with a few small cleanups.
> 
> 
> As you may have noticed, this is my first patches series to linux-media,
> so any tips how to make this as smoother process are appreciated.
> 
> 
> Changes in v2:
>  - Add testing results in the cover letter (thanks Eze)
>  - s/Atmel/Microchip/ through the series (thanks Nicolas)
>  - Split defconfig change into separate commit (thanks Eze, Nicolas)
>  - Added Reviewed-by and Fixes tags (thanks Philipp)
>  - Split DT into separate commit, wrote binding document, fixup minor DT
>    warnings (thanks Eze)
>  - Rebased on top of 5.12-rc2, as per Linus' email to avoid 5.12-rc1
>    https://lwn.net/Articles/848265/
> 
> 
> 
> Testing
> -------
> 
>  - v4l-compliance
> 
> Command used:
>   v4l2-compliance -m0
> 
> Output summary:
> 
> v4l2-compliance 1.21.0-4740, 32 bits, 32-bit time_t
> v4l2-compliance SHA: f253495fa6de 2021-03-06 15:32:09
> 
> Compliance test for hantro-vpu device /dev/media0:
> 
> Total for hantro-vpu device /dev/media0: 8, Succeeded: 8, Failed: 0,
> Warnings: 0
> 
> Compliance test for hantro-vpu device /dev/video0:
> 
> Total for hantro-vpu device /dev/video0: 46, Succeeded: 46, Failed: 0,
> Warnings: 0
> 
> 
>  - Post-processor testing
> 
> Command used:
>   gst-launch-1.0 -v filesrc location=test.mp4  ! decodebin3 !
> video/x-raw,format=YUY2 ! ...
> 
> Confirmed the VPU is used by observing the interrupts triggering, strace
> showed extra v4l2 ioctls - VIDIOC_S_FMT(... V4L2_PIX_FMT_YUYV  ...)
> 
> 
>  - MPEG2 testing, custom ffmpeg from
>    https://github.com/Kwiboo/FFmpeg/commits/v4l2-request-hwaccel-4.3
> 
> Command used:
>   ffmpeg -hwaccel drm -i mpeg2.mpeg2 -f rawvideo -pix_fmt yuv420p out.raw
> 
> Confirmed the VPU is used by observing the interrupts triggering, strace
> showed the v4l2 ioctls being used plus played back the resulting file.
> 
> 
>  - VP8 testing, using fluster
> 
> Command used:
>   fluster.py run -ts VP8-TEST-VECTORS -d GStreamer-VP8-V4L2SL-Gst1.0
> 
> Output summary:
> 
> Running test suite VP8-TEST-VECTORS with decoder GStreamer-VP8-V4L2SL-Gst1.0
> Ran 61 tests in 103.273s
> 
> FAILED (failures=9, errors=2)
> 
> 
>  - H264 testing, using fluster
> 
> Command used:
>   fluster.py run -ts JVT-AVC_V1 -d GStreamer-H.264-V4L2SL-Gst1.0
> 
> Output summary:
> 
> Running test suite JVT-AVC_V1 with decoder GStreamer-H.264-V4L2SL-Gst1.0
> Ran 135 tests in 420.444s
> 
> FAILED (failures=9, errors=55)
> 
> 
> Looking forward to your feedback,
> Emil
> 
> 
> Emil Velikov (10):
>   media: hantro: use G1_REG_INTERRUPT directly for the mpeg2
>   media: hantro: imx: reuse MB_DIM define
>   media: hantro: imx: remove duplicate dec_base init
>   media: hantro: imx: remove unused include
>   media: hantro: introduce hantro_g1.c for common API

For patches 1-5:

Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>

>   media: dt-bindings: Document SAMA5D4 VDEC bindings

This one need to be reviewed by DT maintainers, I think.

>   media: hantro: add initial SAMA5D4 support

For patch 7:

Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>

>   ARM: dts: sama5d4: enable Hantro G1 VDEC
>   ARM: configs: at91: sama5: update with savedefconfig
>   ARM: configs: at91: sama5: enable the Hantro G1 engine
> 

These need review from Microchip maintainers.

Thanks!
Ezequiel

>  .../media/microchip,sama5d4-vdec.yaml         |  59 +++++++++
>  arch/arm/boot/dts/sama5d4.dtsi                |   9 ++
>  arch/arm/configs/sama5_defconfig              |  40 +++---
>  drivers/staging/media/hantro/Kconfig          |  10 +-
>  drivers/staging/media/hantro/Makefile         |   4 +
>  drivers/staging/media/hantro/hantro_drv.c     |   3 +
>  drivers/staging/media/hantro/hantro_g1.c      |  39 ++++++
>  .../media/hantro/hantro_g1_mpeg2_dec.c        |   5 +-
>  drivers/staging/media/hantro/hantro_hw.h      |   4 +
>  drivers/staging/media/hantro/imx8m_vpu_hw.c   |  27 +---
>  drivers/staging/media/hantro/rk3288_vpu_hw.c  |  36 +-----
>  .../staging/media/hantro/sama5d4_vdec_hw.c    | 117 ++++++++++++++++++
>  12 files changed, 274 insertions(+), 79 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
>  create mode 100644 drivers/staging/media/hantro/hantro_g1.c
>  create mode 100644 drivers/staging/media/hantro/sama5d4_vdec_hw.c
> 



_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
  2021-03-16 17:23   ` Ezequiel Garcia
@ 2021-03-24 12:49     ` Emil Velikov
  -1 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-24 12:49 UTC (permalink / raw)
  To: Ezequiel Garcia, Nicolas Ferre, devicetree, Rob Herring,
	Ludovic Desroches, Alexandre Belloni
  Cc: Philipp Zabel, linux-media, linux-rockchip

On Tue, 16 Mar 2021 at 17:23, Ezequiel Garcia <ezequiel@collabora.com> wrote:

> On Thu, 2021-03-11 at 15:40 +0000, Emil Velikov wrote:
> > Emil Velikov (10):
> >   media: hantro: use G1_REG_INTERRUPT directly for the mpeg2
> >   media: hantro: imx: reuse MB_DIM define
> >   media: hantro: imx: remove duplicate dec_base init
> >   media: hantro: imx: remove unused include
> >   media: hantro: introduce hantro_g1.c for common API
>
> For patches 1-5:
>
> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
>
> >   media: dt-bindings: Document SAMA5D4 VDEC bindings
>
> This one need to be reviewed by DT maintainers, I think.
>
Rob can you help with this one?

> >   media: hantro: add initial SAMA5D4 support
>
> For patch 7:
>
> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
>
> >   ARM: dts: sama5d4: enable Hantro G1 VDEC
> >   ARM: configs: at91: sama5: update with savedefconfig
> >   ARM: configs: at91: sama5: enable the Hantro G1 engine
> >
>
> These need review from Microchip maintainers.
>
Alexandre, Ludovic, Nicolas
Do you have any input of the patches or series as a whole?
If you prefer we can drop the last two patches for the defconfig. I've
included those for posterity.

Thanks for the review Eze.
Would you recommend that I resend the series with your R-B or it's
better to wait for feedback from others?

-Emil

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
@ 2021-03-24 12:49     ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-24 12:49 UTC (permalink / raw)
  To: Ezequiel Garcia, Nicolas Ferre, devicetree, Rob Herring,
	Ludovic Desroches, Alexandre Belloni
  Cc: Philipp Zabel, linux-media, linux-rockchip

On Tue, 16 Mar 2021 at 17:23, Ezequiel Garcia <ezequiel@collabora.com> wrote:

> On Thu, 2021-03-11 at 15:40 +0000, Emil Velikov wrote:
> > Emil Velikov (10):
> >   media: hantro: use G1_REG_INTERRUPT directly for the mpeg2
> >   media: hantro: imx: reuse MB_DIM define
> >   media: hantro: imx: remove duplicate dec_base init
> >   media: hantro: imx: remove unused include
> >   media: hantro: introduce hantro_g1.c for common API
>
> For patches 1-5:
>
> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
>
> >   media: dt-bindings: Document SAMA5D4 VDEC bindings
>
> This one need to be reviewed by DT maintainers, I think.
>
Rob can you help with this one?

> >   media: hantro: add initial SAMA5D4 support
>
> For patch 7:
>
> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
>
> >   ARM: dts: sama5d4: enable Hantro G1 VDEC
> >   ARM: configs: at91: sama5: update with savedefconfig
> >   ARM: configs: at91: sama5: enable the Hantro G1 engine
> >
>
> These need review from Microchip maintainers.
>
Alexandre, Ludovic, Nicolas
Do you have any input of the patches or series as a whole?
If you prefer we can drop the last two patches for the defconfig. I've
included those for posterity.

Thanks for the review Eze.
Would you recommend that I resend the series with your R-B or it's
better to wait for feedback from others?

-Emil

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
  2021-03-24 12:49     ` Emil Velikov
@ 2021-03-24 13:44       ` Nicolas Ferre
  -1 siblings, 0 replies; 52+ messages in thread
From: Nicolas Ferre @ 2021-03-24 13:44 UTC (permalink / raw)
  To: Emil Velikov, Ezequiel Garcia, devicetree, Rob Herring,
	Ludovic Desroches, Alexandre Belloni
  Cc: Philipp Zabel, linux-media, linux-rockchip

Emil,

On 24/03/2021 at 13:49, Emil Velikov wrote:
> On Tue, 16 Mar 2021 at 17:23, Ezequiel Garcia <ezequiel@collabora.com> wrote:
> 
>> On Thu, 2021-03-11 at 15:40 +0000, Emil Velikov wrote:
>>> Emil Velikov (10):
>>>    media: hantro: use G1_REG_INTERRUPT directly for the mpeg2
>>>    media: hantro: imx: reuse MB_DIM define
>>>    media: hantro: imx: remove duplicate dec_base init
>>>    media: hantro: imx: remove unused include
>>>    media: hantro: introduce hantro_g1.c for common API
>>
>> For patches 1-5:
>>
>> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
>>
>>>    media: dt-bindings: Document SAMA5D4 VDEC bindings
>>
>> This one need to be reviewed by DT maintainers, I think.
>>
> Rob can you help with this one?
> 
>>>    media: hantro: add initial SAMA5D4 support
>>
>> For patch 7:
>>
>> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
>>
>>>    ARM: dts: sama5d4: enable Hantro G1 VDEC
>>>    ARM: configs: at91: sama5: update with savedefconfig
>>>    ARM: configs: at91: sama5: enable the Hantro G1 engine
>>>
>>
>> These need review from Microchip maintainers.
>>
> Alexandre, Ludovic, Nicolas
> Do you have any input of the patches or series as a whole?

The patch series looks good to me.

If needed on patches that we don't take ourselves, you can add my:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Now, when we have the tag from Rob, how to coordinate these different 
pieces? Will it go through the media git tree? Will we benefit from a 
stable branch to share or will we just have to wait for the driver to 
hit Mainline before adding the defconfig and DT patches?

> If you prefer we can drop the last two patches for the defconfig. I've
> included those for posterity.
No strong opinion on my side, except that defconfig stuff might be 
better handled in at91 + arm-soc trees because we'll have other changes 
to queue for 5.13.

> Thanks for the review Eze.
> Would you recommend that I resend the series with your R-B or it's
> better to wait for feedback from others?

Thanks a lot for this nice work. Best regards,
-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
@ 2021-03-24 13:44       ` Nicolas Ferre
  0 siblings, 0 replies; 52+ messages in thread
From: Nicolas Ferre @ 2021-03-24 13:44 UTC (permalink / raw)
  To: Emil Velikov, Ezequiel Garcia, devicetree, Rob Herring,
	Ludovic Desroches, Alexandre Belloni
  Cc: Philipp Zabel, linux-media, linux-rockchip

Emil,

On 24/03/2021 at 13:49, Emil Velikov wrote:
> On Tue, 16 Mar 2021 at 17:23, Ezequiel Garcia <ezequiel@collabora.com> wrote:
> 
>> On Thu, 2021-03-11 at 15:40 +0000, Emil Velikov wrote:
>>> Emil Velikov (10):
>>>    media: hantro: use G1_REG_INTERRUPT directly for the mpeg2
>>>    media: hantro: imx: reuse MB_DIM define
>>>    media: hantro: imx: remove duplicate dec_base init
>>>    media: hantro: imx: remove unused include
>>>    media: hantro: introduce hantro_g1.c for common API
>>
>> For patches 1-5:
>>
>> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
>>
>>>    media: dt-bindings: Document SAMA5D4 VDEC bindings
>>
>> This one need to be reviewed by DT maintainers, I think.
>>
> Rob can you help with this one?
> 
>>>    media: hantro: add initial SAMA5D4 support
>>
>> For patch 7:
>>
>> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
>>
>>>    ARM: dts: sama5d4: enable Hantro G1 VDEC
>>>    ARM: configs: at91: sama5: update with savedefconfig
>>>    ARM: configs: at91: sama5: enable the Hantro G1 engine
>>>
>>
>> These need review from Microchip maintainers.
>>
> Alexandre, Ludovic, Nicolas
> Do you have any input of the patches or series as a whole?

The patch series looks good to me.

If needed on patches that we don't take ourselves, you can add my:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Now, when we have the tag from Rob, how to coordinate these different 
pieces? Will it go through the media git tree? Will we benefit from a 
stable branch to share or will we just have to wait for the driver to 
hit Mainline before adding the defconfig and DT patches?

> If you prefer we can drop the last two patches for the defconfig. I've
> included those for posterity.
No strong opinion on my side, except that defconfig stuff might be 
better handled in at91 + arm-soc trees because we'll have other changes 
to queue for 5.13.

> Thanks for the review Eze.
> Would you recommend that I resend the series with your R-B or it's
> better to wait for feedback from others?

Thanks a lot for this nice work. Best regards,
-- 
Nicolas Ferre

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 06/10] media: dt-bindings: Document SAMA5D4 VDEC bindings
  2021-03-11 15:40   ` Emil Velikov
@ 2021-03-24 15:17     ` Rob Herring
  -1 siblings, 0 replies; 52+ messages in thread
From: Rob Herring @ 2021-03-24 15:17 UTC (permalink / raw)
  To: Emil Velikov
  Cc: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre, Frank Rowand, devicetree

On Thu, Mar 11, 2021 at 03:40:51PM +0000, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov@collabora.com>
> 
> Add devicetree binding documentation for the Hantro G1/G2 VDEC on
> the Microchip SAMAS5D4 SoC.
> 
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Frank Rowand <frowand.list@gmail.com>
> Cc: devicetree@vger.kernel.org>
> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> ---
> v2
>  - Newly introduced
>  - s/Atmel/Microchip/ (Nicolas)
>  - Drop leading 0 in node name/address
> ---
>  .../media/microchip,sama5d4-vdec.yaml         | 59 +++++++++++++++++++
>  1 file changed, 59 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> 
> diff --git a/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> new file mode 100644
> index 000000000000..9cb2c0295d54
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> @@ -0,0 +1,59 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/media/microchip,sama5d4-vdec.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: Hantro G1 VPU codec implemented on Microchip SAMA5D4 SoCs
> +
> +maintainers:
> +  - Emil Velikov <emil.velikov@collabora.com>
> +
> +description:
> +  Hantro G1 video decode accelerator present on Microchip SAMA5D4 SoCs.
> +
> +properties:
> +  compatible:
> +    const: microchip,sama5d4-vdec
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  interrupt-names:
> +    items:
> +      - const: vdec

Why do you need a name? *-names are used to distinguish multiple entries 
and don't add anything if only a single entry.

> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    items:
> +      - const: vdec_clk

And here too? These are typically named for either the name of input 
signal (hclk, aclk, etc.) or function ('core', 'bus', etc.). 

> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - interrupt-names
> +  - clocks
> +  - clock-names
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +        #include <dt-bindings/clock/at91.h>
> +        #include <dt-bindings/interrupt-controller/irq.h>
> +
> +        vdec0: vdec@300000 {
> +                compatible = "microchip,sama5d4-vdec";
> +                reg = <0x00300000 0x100000>;
> +                interrupts = <19 IRQ_TYPE_LEVEL_HIGH 4>;
> +                interrupt-names = "vdec";
> +                clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
> +                clock-names = "vdec_clk";
> +        };
> -- 
> 2.30.1
> 

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 06/10] media: dt-bindings: Document SAMA5D4 VDEC bindings
@ 2021-03-24 15:17     ` Rob Herring
  0 siblings, 0 replies; 52+ messages in thread
From: Rob Herring @ 2021-03-24 15:17 UTC (permalink / raw)
  To: Emil Velikov
  Cc: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre, Frank Rowand, devicetree

On Thu, Mar 11, 2021 at 03:40:51PM +0000, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov@collabora.com>
> 
> Add devicetree binding documentation for the Hantro G1/G2 VDEC on
> the Microchip SAMAS5D4 SoC.
> 
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Frank Rowand <frowand.list@gmail.com>
> Cc: devicetree@vger.kernel.org>
> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> ---
> v2
>  - Newly introduced
>  - s/Atmel/Microchip/ (Nicolas)
>  - Drop leading 0 in node name/address
> ---
>  .../media/microchip,sama5d4-vdec.yaml         | 59 +++++++++++++++++++
>  1 file changed, 59 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> 
> diff --git a/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> new file mode 100644
> index 000000000000..9cb2c0295d54
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> @@ -0,0 +1,59 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/media/microchip,sama5d4-vdec.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: Hantro G1 VPU codec implemented on Microchip SAMA5D4 SoCs
> +
> +maintainers:
> +  - Emil Velikov <emil.velikov@collabora.com>
> +
> +description:
> +  Hantro G1 video decode accelerator present on Microchip SAMA5D4 SoCs.
> +
> +properties:
> +  compatible:
> +    const: microchip,sama5d4-vdec
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  interrupt-names:
> +    items:
> +      - const: vdec

Why do you need a name? *-names are used to distinguish multiple entries 
and don't add anything if only a single entry.

> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    items:
> +      - const: vdec_clk

And here too? These are typically named for either the name of input 
signal (hclk, aclk, etc.) or function ('core', 'bus', etc.). 

> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - interrupt-names
> +  - clocks
> +  - clock-names
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +        #include <dt-bindings/clock/at91.h>
> +        #include <dt-bindings/interrupt-controller/irq.h>
> +
> +        vdec0: vdec@300000 {
> +                compatible = "microchip,sama5d4-vdec";
> +                reg = <0x00300000 0x100000>;
> +                interrupts = <19 IRQ_TYPE_LEVEL_HIGH 4>;
> +                interrupt-names = "vdec";
> +                clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
> +                clock-names = "vdec_clk";
> +        };
> -- 
> 2.30.1
> 

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
  2021-03-11 15:40 ` Emil Velikov
@ 2021-03-24 19:58   ` Nicolas Dufresne
  -1 siblings, 0 replies; 52+ messages in thread
From: Nicolas Dufresne @ 2021-03-24 19:58 UTC (permalink / raw)
  To: Emil Velikov, Ezequiel Garcia, Philipp Zabel, linux-media,
	linux-rockchip, Nicolas Ferre

Le jeudi 11 mars 2021 à 15:40 +0000, Emil Velikov a écrit :
> Hi all
> 
> This series adds support for the Microchip SAMA5D4 VPU, which it based
> on the Hantro G1.

Perhaps in your next version you could fix the object line, you wrote Microship
instead of Microchip.

> 
> The hardware can support up-to 1280x720 for each of the MPEG2, VP8 and
> H264 codecs. There is only a single decoder and no encoders on the SoC.
> 
> The Hantro G1 post-processing is also enabled on the platform.
> 
> To minimise duplication, the series starts with a few small cleanups.
> 
> 
> As you may have noticed, this is my first patches series to linux-media,
> so any tips how to make this as smoother process are appreciated.
> 
> 
> Changes in v2:
>  - Add testing results in the cover letter (thanks Eze)
>  - s/Atmel/Microchip/ through the series (thanks Nicolas)
>  - Split defconfig change into separate commit (thanks Eze, Nicolas)
>  - Added Reviewed-by and Fixes tags (thanks Philipp)
>  - Split DT into separate commit, wrote binding document, fixup minor DT
>    warnings (thanks Eze)
>  - Rebased on top of 5.12-rc2, as per Linus' email to avoid 5.12-rc1
>    https://lwn.net/Articles/848265/
> 
> 
> 
> Testing
> -------
> 
>  - v4l-compliance
> 
> Command used:
>   v4l2-compliance -m0
> 
> Output summary:
> 
> v4l2-compliance 1.21.0-4740, 32 bits, 32-bit time_t
> v4l2-compliance SHA: f253495fa6de 2021-03-06 15:32:09
> 
> Compliance test for hantro-vpu device /dev/media0:
> 
> Total for hantro-vpu device /dev/media0: 8, Succeeded: 8, Failed: 0,
> Warnings: 0
> 
> Compliance test for hantro-vpu device /dev/video0:
> 
> Total for hantro-vpu device /dev/video0: 46, Succeeded: 46, Failed: 0,
> Warnings: 0
> 
> 
>  - Post-processor testing
> 
> Command used:
>   gst-launch-1.0 -v filesrc location=test.mp4  ! decodebin3 !
> video/x-raw,format=YUY2 ! ...
> 
> Confirmed the VPU is used by observing the interrupts triggering, strace
> showed extra v4l2 ioctls - VIDIOC_S_FMT(... V4L2_PIX_FMT_YUYV  ...)
> 
> 
>  - MPEG2 testing, custom ffmpeg from
>    https://github.com/Kwiboo/FFmpeg/commits/v4l2-request-hwaccel-4.3
> 
> Command used:
>   ffmpeg -hwaccel drm -i mpeg2.mpeg2 -f rawvideo -pix_fmt yuv420p out.raw
> 
> Confirmed the VPU is used by observing the interrupts triggering, strace
> showed the v4l2 ioctls being used plus played back the resulting file.
> 
> 
>  - VP8 testing, using fluster
> 
> Command used:
>   fluster.py run -ts VP8-TEST-VECTORS -d GStreamer-VP8-V4L2SL-Gst1.0
> 
> Output summary:
> 
> Running test suite VP8-TEST-VECTORS with decoder GStreamer-VP8-V4L2SL-Gst1.0
> Ran 61 tests in 103.273s
> 
> FAILED (failures=9, errors=2)
> 
> 
>  - H264 testing, using fluster
> 
> Command used:
>   fluster.py run -ts JVT-AVC_V1 -d GStreamer-H.264-V4L2SL-Gst1.0
> 
> Output summary:
> 
> Running test suite JVT-AVC_V1 with decoder GStreamer-H.264-V4L2SL-Gst1.0
> Ran 135 tests in 420.444s
> 
> FAILED (failures=9, errors=55)
> 
> 
> Looking forward to your feedback,
> Emil
> 
> 
> Emil Velikov (10):
>   media: hantro: use G1_REG_INTERRUPT directly for the mpeg2
>   media: hantro: imx: reuse MB_DIM define
>   media: hantro: imx: remove duplicate dec_base init
>   media: hantro: imx: remove unused include
>   media: hantro: introduce hantro_g1.c for common API
>   media: dt-bindings: Document SAMA5D4 VDEC bindings
>   media: hantro: add initial SAMA5D4 support
>   ARM: dts: sama5d4: enable Hantro G1 VDEC
>   ARM: configs: at91: sama5: update with savedefconfig
>   ARM: configs: at91: sama5: enable the Hantro G1 engine
> 
>  .../media/microchip,sama5d4-vdec.yaml         |  59 +++++++++
>  arch/arm/boot/dts/sama5d4.dtsi                |   9 ++
>  arch/arm/configs/sama5_defconfig              |  40 +++---
>  drivers/staging/media/hantro/Kconfig          |  10 +-
>  drivers/staging/media/hantro/Makefile         |   4 +
>  drivers/staging/media/hantro/hantro_drv.c     |   3 +
>  drivers/staging/media/hantro/hantro_g1.c      |  39 ++++++
>  .../media/hantro/hantro_g1_mpeg2_dec.c        |   5 +-
>  drivers/staging/media/hantro/hantro_hw.h      |   4 +
>  drivers/staging/media/hantro/imx8m_vpu_hw.c   |  27 +---
>  drivers/staging/media/hantro/rk3288_vpu_hw.c  |  36 +-----
>  .../staging/media/hantro/sama5d4_vdec_hw.c    | 117 ++++++++++++++++++
>  12 files changed, 274 insertions(+), 79 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
>  create mode 100644 drivers/staging/media/hantro/hantro_g1.c
>  create mode 100644 drivers/staging/media/hantro/sama5d4_vdec_hw.c
> 



^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
@ 2021-03-24 19:58   ` Nicolas Dufresne
  0 siblings, 0 replies; 52+ messages in thread
From: Nicolas Dufresne @ 2021-03-24 19:58 UTC (permalink / raw)
  To: Emil Velikov, Ezequiel Garcia, Philipp Zabel, linux-media,
	linux-rockchip, Nicolas Ferre

Le jeudi 11 mars 2021 à 15:40 +0000, Emil Velikov a écrit :
> Hi all
> 
> This series adds support for the Microchip SAMA5D4 VPU, which it based
> on the Hantro G1.

Perhaps in your next version you could fix the object line, you wrote Microship
instead of Microchip.

> 
> The hardware can support up-to 1280x720 for each of the MPEG2, VP8 and
> H264 codecs. There is only a single decoder and no encoders on the SoC.
> 
> The Hantro G1 post-processing is also enabled on the platform.
> 
> To minimise duplication, the series starts with a few small cleanups.
> 
> 
> As you may have noticed, this is my first patches series to linux-media,
> so any tips how to make this as smoother process are appreciated.
> 
> 
> Changes in v2:
>  - Add testing results in the cover letter (thanks Eze)
>  - s/Atmel/Microchip/ through the series (thanks Nicolas)
>  - Split defconfig change into separate commit (thanks Eze, Nicolas)
>  - Added Reviewed-by and Fixes tags (thanks Philipp)
>  - Split DT into separate commit, wrote binding document, fixup minor DT
>    warnings (thanks Eze)
>  - Rebased on top of 5.12-rc2, as per Linus' email to avoid 5.12-rc1
>    https://lwn.net/Articles/848265/
> 
> 
> 
> Testing
> -------
> 
>  - v4l-compliance
> 
> Command used:
>   v4l2-compliance -m0
> 
> Output summary:
> 
> v4l2-compliance 1.21.0-4740, 32 bits, 32-bit time_t
> v4l2-compliance SHA: f253495fa6de 2021-03-06 15:32:09
> 
> Compliance test for hantro-vpu device /dev/media0:
> 
> Total for hantro-vpu device /dev/media0: 8, Succeeded: 8, Failed: 0,
> Warnings: 0
> 
> Compliance test for hantro-vpu device /dev/video0:
> 
> Total for hantro-vpu device /dev/video0: 46, Succeeded: 46, Failed: 0,
> Warnings: 0
> 
> 
>  - Post-processor testing
> 
> Command used:
>   gst-launch-1.0 -v filesrc location=test.mp4  ! decodebin3 !
> video/x-raw,format=YUY2 ! ...
> 
> Confirmed the VPU is used by observing the interrupts triggering, strace
> showed extra v4l2 ioctls - VIDIOC_S_FMT(... V4L2_PIX_FMT_YUYV  ...)
> 
> 
>  - MPEG2 testing, custom ffmpeg from
>    https://github.com/Kwiboo/FFmpeg/commits/v4l2-request-hwaccel-4.3
> 
> Command used:
>   ffmpeg -hwaccel drm -i mpeg2.mpeg2 -f rawvideo -pix_fmt yuv420p out.raw
> 
> Confirmed the VPU is used by observing the interrupts triggering, strace
> showed the v4l2 ioctls being used plus played back the resulting file.
> 
> 
>  - VP8 testing, using fluster
> 
> Command used:
>   fluster.py run -ts VP8-TEST-VECTORS -d GStreamer-VP8-V4L2SL-Gst1.0
> 
> Output summary:
> 
> Running test suite VP8-TEST-VECTORS with decoder GStreamer-VP8-V4L2SL-Gst1.0
> Ran 61 tests in 103.273s
> 
> FAILED (failures=9, errors=2)
> 
> 
>  - H264 testing, using fluster
> 
> Command used:
>   fluster.py run -ts JVT-AVC_V1 -d GStreamer-H.264-V4L2SL-Gst1.0
> 
> Output summary:
> 
> Running test suite JVT-AVC_V1 with decoder GStreamer-H.264-V4L2SL-Gst1.0
> Ran 135 tests in 420.444s
> 
> FAILED (failures=9, errors=55)
> 
> 
> Looking forward to your feedback,
> Emil
> 
> 
> Emil Velikov (10):
>   media: hantro: use G1_REG_INTERRUPT directly for the mpeg2
>   media: hantro: imx: reuse MB_DIM define
>   media: hantro: imx: remove duplicate dec_base init
>   media: hantro: imx: remove unused include
>   media: hantro: introduce hantro_g1.c for common API
>   media: dt-bindings: Document SAMA5D4 VDEC bindings
>   media: hantro: add initial SAMA5D4 support
>   ARM: dts: sama5d4: enable Hantro G1 VDEC
>   ARM: configs: at91: sama5: update with savedefconfig
>   ARM: configs: at91: sama5: enable the Hantro G1 engine
> 
>  .../media/microchip,sama5d4-vdec.yaml         |  59 +++++++++
>  arch/arm/boot/dts/sama5d4.dtsi                |   9 ++
>  arch/arm/configs/sama5_defconfig              |  40 +++---
>  drivers/staging/media/hantro/Kconfig          |  10 +-
>  drivers/staging/media/hantro/Makefile         |   4 +
>  drivers/staging/media/hantro/hantro_drv.c     |   3 +
>  drivers/staging/media/hantro/hantro_g1.c      |  39 ++++++
>  .../media/hantro/hantro_g1_mpeg2_dec.c        |   5 +-
>  drivers/staging/media/hantro/hantro_hw.h      |   4 +
>  drivers/staging/media/hantro/imx8m_vpu_hw.c   |  27 +---
>  drivers/staging/media/hantro/rk3288_vpu_hw.c  |  36 +-----
>  .../staging/media/hantro/sama5d4_vdec_hw.c    | 117 ++++++++++++++++++
>  12 files changed, 274 insertions(+), 79 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
>  create mode 100644 drivers/staging/media/hantro/hantro_g1.c
>  create mode 100644 drivers/staging/media/hantro/sama5d4_vdec_hw.c
> 



_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
  2021-03-24 13:44       ` Nicolas Ferre
@ 2021-03-25  8:48         ` Alexandre Belloni
  -1 siblings, 0 replies; 52+ messages in thread
From: Alexandre Belloni @ 2021-03-25  8:48 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Emil Velikov, Ezequiel Garcia, devicetree, Rob Herring,
	Ludovic Desroches, Philipp Zabel, linux-media, linux-rockchip

On 24/03/2021 14:44:14+0100, Nicolas Ferre wrote:
> Now, when we have the tag from Rob, how to coordinate these different
> pieces? Will it go through the media git tree? Will we benefit from a stable
> branch to share or will we just have to wait for the driver to hit Mainline
> before adding the defconfig and DT patches?
> 

I think the defconfig and dt patches can go through at91 as soon as we
get Rob's ack. There is no build dependency so it can be taken at any
time. Worst case, we end up with a selected config option that doesn't
exist.

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
@ 2021-03-25  8:48         ` Alexandre Belloni
  0 siblings, 0 replies; 52+ messages in thread
From: Alexandre Belloni @ 2021-03-25  8:48 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Emil Velikov, Ezequiel Garcia, devicetree, Rob Herring,
	Ludovic Desroches, Philipp Zabel, linux-media, linux-rockchip

On 24/03/2021 14:44:14+0100, Nicolas Ferre wrote:
> Now, when we have the tag from Rob, how to coordinate these different
> pieces? Will it go through the media git tree? Will we benefit from a stable
> branch to share or will we just have to wait for the driver to hit Mainline
> before adding the defconfig and DT patches?
> 

I think the defconfig and dt patches can go through at91 as soon as we
get Rob's ack. There is no build dependency so it can be taken at any
time. Worst case, we end up with a selected config option that doesn't
exist.

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 06/10] media: dt-bindings: Document SAMA5D4 VDEC bindings
  2021-03-24 15:17     ` Rob Herring
@ 2021-03-25 14:14       ` Emil Velikov
  -1 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-25 14:14 UTC (permalink / raw)
  To: Rob Herring
  Cc: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre, Frank Rowand, devicetree

On Wed, 24 Mar 2021 at 15:17, Rob Herring <robh@kernel.org> wrote:
>
> On Thu, Mar 11, 2021 at 03:40:51PM +0000, Emil Velikov wrote:
> > From: Emil Velikov <emil.velikov@collabora.com>
> >
> > Add devicetree binding documentation for the Hantro G1/G2 VDEC on
> > the Microchip SAMAS5D4 SoC.
> >
> > Cc: Rob Herring <robh+dt@kernel.org>
> > Cc: Frank Rowand <frowand.list@gmail.com>
> > Cc: devicetree@vger.kernel.org>
> > Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> > ---
> > v2
> >  - Newly introduced
> >  - s/Atmel/Microchip/ (Nicolas)
> >  - Drop leading 0 in node name/address
> > ---
> >  .../media/microchip,sama5d4-vdec.yaml         | 59 +++++++++++++++++++
> >  1 file changed, 59 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > new file mode 100644
> > index 000000000000..9cb2c0295d54
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > @@ -0,0 +1,59 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +
> > +%YAML 1.2
> > +---
> > +$id: "http://devicetree.org/schemas/media/microchip,sama5d4-vdec.yaml#"
> > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> > +
> > +title: Hantro G1 VPU codec implemented on Microchip SAMA5D4 SoCs
> > +
> > +maintainers:
> > +  - Emil Velikov <emil.velikov@collabora.com>
> > +
> > +description:
> > +  Hantro G1 video decode accelerator present on Microchip SAMA5D4 SoCs.
> > +
> > +properties:
> > +  compatible:
> > +    const: microchip,sama5d4-vdec
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  interrupt-names:
> > +    items:
> > +      - const: vdec
>
> Why do you need a name? *-names are used to distinguish multiple entries
> and don't add anything if only a single entry.
>
On one hand the names are used to describe the hardware - the SAMA
board uses designated clock and interrupt lines - both called "vdec".
Additionally the names are ultimately required by the underlying API -
platform_get_irq_byname and  devm_clk_bulk_get respectively.
How can we get the respective entries without the name?

Skimming through the existing dts file -
arch/arm/boot/dts/sama5d4.dtsi and other dts files - there are lots of
examples where the device tree binding contains the name for a single
clock/interrupt.

Thanks
Emil

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 06/10] media: dt-bindings: Document SAMA5D4 VDEC bindings
@ 2021-03-25 14:14       ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-25 14:14 UTC (permalink / raw)
  To: Rob Herring
  Cc: Ezequiel Garcia, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre, Frank Rowand, devicetree

On Wed, 24 Mar 2021 at 15:17, Rob Herring <robh@kernel.org> wrote:
>
> On Thu, Mar 11, 2021 at 03:40:51PM +0000, Emil Velikov wrote:
> > From: Emil Velikov <emil.velikov@collabora.com>
> >
> > Add devicetree binding documentation for the Hantro G1/G2 VDEC on
> > the Microchip SAMAS5D4 SoC.
> >
> > Cc: Rob Herring <robh+dt@kernel.org>
> > Cc: Frank Rowand <frowand.list@gmail.com>
> > Cc: devicetree@vger.kernel.org>
> > Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> > ---
> > v2
> >  - Newly introduced
> >  - s/Atmel/Microchip/ (Nicolas)
> >  - Drop leading 0 in node name/address
> > ---
> >  .../media/microchip,sama5d4-vdec.yaml         | 59 +++++++++++++++++++
> >  1 file changed, 59 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > new file mode 100644
> > index 000000000000..9cb2c0295d54
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > @@ -0,0 +1,59 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +
> > +%YAML 1.2
> > +---
> > +$id: "http://devicetree.org/schemas/media/microchip,sama5d4-vdec.yaml#"
> > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> > +
> > +title: Hantro G1 VPU codec implemented on Microchip SAMA5D4 SoCs
> > +
> > +maintainers:
> > +  - Emil Velikov <emil.velikov@collabora.com>
> > +
> > +description:
> > +  Hantro G1 video decode accelerator present on Microchip SAMA5D4 SoCs.
> > +
> > +properties:
> > +  compatible:
> > +    const: microchip,sama5d4-vdec
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  interrupt-names:
> > +    items:
> > +      - const: vdec
>
> Why do you need a name? *-names are used to distinguish multiple entries
> and don't add anything if only a single entry.
>
On one hand the names are used to describe the hardware - the SAMA
board uses designated clock and interrupt lines - both called "vdec".
Additionally the names are ultimately required by the underlying API -
platform_get_irq_byname and  devm_clk_bulk_get respectively.
How can we get the respective entries without the name?

Skimming through the existing dts file -
arch/arm/boot/dts/sama5d4.dtsi and other dts files - there are lots of
examples where the device tree binding contains the name for a single
clock/interrupt.

Thanks
Emil

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
  2021-03-25  8:48         ` Alexandre Belloni
@ 2021-03-25 14:22           ` Emil Velikov
  -1 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-25 14:22 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Nicolas Ferre, Ezequiel Garcia, devicetree, Rob Herring,
	Ludovic Desroches, Philipp Zabel, linux-media, linux-rockchip

Greetings all,

On Thu, 25 Mar 2021 at 08:48, Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
>
> On 24/03/2021 14:44:14+0100, Nicolas Ferre wrote:
> > Now, when we have the tag from Rob, how to coordinate these different
> > pieces? Will it go through the media git tree? Will we benefit from a stable
> > branch to share or will we just have to wait for the driver to hit Mainline
> > before adding the defconfig and DT patches?
> >
Thanks for the Acked-by Nicolas.

>
> I think the defconfig and dt patches can go through at91 as soon as we
> get Rob's ack. There is no build dependency so it can be taken at any
> time. Worst case, we end up with a selected config option that doesn't
> exist.
>
My personal preference is to merge everything in one go.
I believe it will be easier from maintainer's point of view, plus odds
of conflicts with the AT91 tree are close to zero.

Then again, as long as the maintainers are happy - I'm fine either way.

Thanks
Emil

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
@ 2021-03-25 14:22           ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-25 14:22 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Nicolas Ferre, Ezequiel Garcia, devicetree, Rob Herring,
	Ludovic Desroches, Philipp Zabel, linux-media, linux-rockchip

Greetings all,

On Thu, 25 Mar 2021 at 08:48, Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
>
> On 24/03/2021 14:44:14+0100, Nicolas Ferre wrote:
> > Now, when we have the tag from Rob, how to coordinate these different
> > pieces? Will it go through the media git tree? Will we benefit from a stable
> > branch to share or will we just have to wait for the driver to hit Mainline
> > before adding the defconfig and DT patches?
> >
Thanks for the Acked-by Nicolas.

>
> I think the defconfig and dt patches can go through at91 as soon as we
> get Rob's ack. There is no build dependency so it can be taken at any
> time. Worst case, we end up with a selected config option that doesn't
> exist.
>
My personal preference is to merge everything in one go.
I believe it will be easier from maintainer's point of view, plus odds
of conflicts with the AT91 tree are close to zero.

Then again, as long as the maintainers are happy - I'm fine either way.

Thanks
Emil

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
  2021-03-25  8:48         ` Alexandre Belloni
@ 2021-03-25 15:50           ` Nicolas Ferre
  -1 siblings, 0 replies; 52+ messages in thread
From: Nicolas Ferre @ 2021-03-25 15:50 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Emil Velikov, Ezequiel Garcia, devicetree, Rob Herring,
	Ludovic Desroches, Philipp Zabel, linux-media, linux-rockchip

On 25/03/2021 at 09:48, Alexandre Belloni wrote:
> On 24/03/2021 14:44:14+0100, Nicolas Ferre wrote:
>> Now, when we have the tag from Rob, how to coordinate these different
>> pieces? Will it go through the media git tree? Will we benefit from a stable
>> branch to share or will we just have to wait for the driver to hit Mainline
>> before adding the defconfig and DT patches?
>>
> 
> I think the defconfig and dt patches can go through at91 as soon as we
> get Rob's ack. There is no build dependency so it can be taken at any
> time. Worst case, we end up with a selected config option that doesn't
> exist.

Agreed, and it simplify things.

My only concern is with triggering some of the bots while checking for 
DT compatible string definition.

Regards,
   Nicolas



-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
@ 2021-03-25 15:50           ` Nicolas Ferre
  0 siblings, 0 replies; 52+ messages in thread
From: Nicolas Ferre @ 2021-03-25 15:50 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Emil Velikov, Ezequiel Garcia, devicetree, Rob Herring,
	Ludovic Desroches, Philipp Zabel, linux-media, linux-rockchip

On 25/03/2021 at 09:48, Alexandre Belloni wrote:
> On 24/03/2021 14:44:14+0100, Nicolas Ferre wrote:
>> Now, when we have the tag from Rob, how to coordinate these different
>> pieces? Will it go through the media git tree? Will we benefit from a stable
>> branch to share or will we just have to wait for the driver to hit Mainline
>> before adding the defconfig and DT patches?
>>
> 
> I think the defconfig and dt patches can go through at91 as soon as we
> get Rob's ack. There is no build dependency so it can be taken at any
> time. Worst case, we end up with a selected config option that doesn't
> exist.

Agreed, and it simplify things.

My only concern is with triggering some of the bots while checking for 
DT compatible string definition.

Regards,
   Nicolas



-- 
Nicolas Ferre

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 06/10] media: dt-bindings: Document SAMA5D4 VDEC bindings
  2021-03-25 14:14       ` Emil Velikov
@ 2021-03-26 14:28         ` Ezequiel Garcia
  -1 siblings, 0 replies; 52+ messages in thread
From: Ezequiel Garcia @ 2021-03-26 14:28 UTC (permalink / raw)
  To: Emil Velikov, Rob Herring
  Cc: Philipp Zabel, linux-media, linux-rockchip, Nicolas Ferre,
	Frank Rowand, devicetree

Hi Emil,

On Thu, 2021-03-25 at 14:14 +0000, Emil Velikov wrote:
> On Wed, 24 Mar 2021 at 15:17, Rob Herring <robh@kernel.org> wrote:
> > 
> > On Thu, Mar 11, 2021 at 03:40:51PM +0000, Emil Velikov wrote:
> > > From: Emil Velikov <emil.velikov@collabora.com>
> > > 
> > > Add devicetree binding documentation for the Hantro G1/G2 VDEC on
> > > the Microchip SAMAS5D4 SoC.
> > > 
> > > Cc: Rob Herring <robh+dt@kernel.org>
> > > Cc: Frank Rowand <frowand.list@gmail.com>
> > > Cc: devicetree@vger.kernel.org>
> > > Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> > > ---
> > > v2
> > >  - Newly introduced
> > >  - s/Atmel/Microchip/ (Nicolas)
> > >  - Drop leading 0 in node name/address
> > > ---
> > >  .../media/microchip,sama5d4-vdec.yaml         | 59 +++++++++++++++++++
> > >  1 file changed, 59 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > > 
> > > diff --git a/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml b/Documentation/devicetree/bindings/media/microchip,sama5d4-
> > > vdec.yaml
> > > new file mode 100644
> > > index 000000000000..9cb2c0295d54
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > > @@ -0,0 +1,59 @@
> > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > > +
> > > +%YAML 1.2
> > > +---
> > > +$id: "http://devicetree.org/schemas/media/microchip,sama5d4-vdec.yaml#"
> > > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> > > +
> > > +title: Hantro G1 VPU codec implemented on Microchip SAMA5D4 SoCs
> > > +
> > > +maintainers:
> > > +  - Emil Velikov <emil.velikov@collabora.com>
> > > +
> > > +description:
> > > +  Hantro G1 video decode accelerator present on Microchip SAMA5D4 SoCs.
> > > +
> > > +properties:
> > > +  compatible:
> > > +    const: microchip,sama5d4-vdec
> > > +
> > > +  reg:
> > > +    maxItems: 1
> > > +
> > > +  interrupts:
> > > +    maxItems: 1
> > > +
> > > +  interrupt-names:
> > > +    items:
> > > +      - const: vdec
> > 
> > Why do you need a name? *-names are used to distinguish multiple entries
> > and don't add anything if only a single entry.
> > 
> On one hand the names are used to describe the hardware - the SAMA
> board uses designated clock and interrupt lines - both called "vdec".
> Additionally the names are ultimately required by the underlying API -
> platform_get_irq_byname and  devm_clk_bulk_get respectively.
> How can we get the respective entries without the name?
> 

There are APIs to get the resource by index as opposed to by name.
E.g. platform_get_irq.

However, you are confusing here internal kernel implementation
with devicetree bindings. The latter is just a representation
of the hardware.

> Skimming through the existing dts file -
> arch/arm/boot/dts/sama5d4.dtsi and other dts files - there are lots of
> examples where the device tree binding contains the name for a single
> clock/interrupt.
> 


Note that dtsi and dts are the device-tree files, not the bindings.
And even if you find examples, the fact that there exist examples
doesn't mean it's the right thing to do.

Thanks,
Ezequiel


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 06/10] media: dt-bindings: Document SAMA5D4 VDEC bindings
@ 2021-03-26 14:28         ` Ezequiel Garcia
  0 siblings, 0 replies; 52+ messages in thread
From: Ezequiel Garcia @ 2021-03-26 14:28 UTC (permalink / raw)
  To: Emil Velikov, Rob Herring
  Cc: Philipp Zabel, linux-media, linux-rockchip, Nicolas Ferre,
	Frank Rowand, devicetree

Hi Emil,

On Thu, 2021-03-25 at 14:14 +0000, Emil Velikov wrote:
> On Wed, 24 Mar 2021 at 15:17, Rob Herring <robh@kernel.org> wrote:
> > 
> > On Thu, Mar 11, 2021 at 03:40:51PM +0000, Emil Velikov wrote:
> > > From: Emil Velikov <emil.velikov@collabora.com>
> > > 
> > > Add devicetree binding documentation for the Hantro G1/G2 VDEC on
> > > the Microchip SAMAS5D4 SoC.
> > > 
> > > Cc: Rob Herring <robh+dt@kernel.org>
> > > Cc: Frank Rowand <frowand.list@gmail.com>
> > > Cc: devicetree@vger.kernel.org>
> > > Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> > > ---
> > > v2
> > >  - Newly introduced
> > >  - s/Atmel/Microchip/ (Nicolas)
> > >  - Drop leading 0 in node name/address
> > > ---
> > >  .../media/microchip,sama5d4-vdec.yaml         | 59 +++++++++++++++++++
> > >  1 file changed, 59 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > > 
> > > diff --git a/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml b/Documentation/devicetree/bindings/media/microchip,sama5d4-
> > > vdec.yaml
> > > new file mode 100644
> > > index 000000000000..9cb2c0295d54
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > > @@ -0,0 +1,59 @@
> > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > > +
> > > +%YAML 1.2
> > > +---
> > > +$id: "http://devicetree.org/schemas/media/microchip,sama5d4-vdec.yaml#"
> > > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> > > +
> > > +title: Hantro G1 VPU codec implemented on Microchip SAMA5D4 SoCs
> > > +
> > > +maintainers:
> > > +  - Emil Velikov <emil.velikov@collabora.com>
> > > +
> > > +description:
> > > +  Hantro G1 video decode accelerator present on Microchip SAMA5D4 SoCs.
> > > +
> > > +properties:
> > > +  compatible:
> > > +    const: microchip,sama5d4-vdec
> > > +
> > > +  reg:
> > > +    maxItems: 1
> > > +
> > > +  interrupts:
> > > +    maxItems: 1
> > > +
> > > +  interrupt-names:
> > > +    items:
> > > +      - const: vdec
> > 
> > Why do you need a name? *-names are used to distinguish multiple entries
> > and don't add anything if only a single entry.
> > 
> On one hand the names are used to describe the hardware - the SAMA
> board uses designated clock and interrupt lines - both called "vdec".
> Additionally the names are ultimately required by the underlying API -
> platform_get_irq_byname and  devm_clk_bulk_get respectively.
> How can we get the respective entries without the name?
> 

There are APIs to get the resource by index as opposed to by name.
E.g. platform_get_irq.

However, you are confusing here internal kernel implementation
with devicetree bindings. The latter is just a representation
of the hardware.

> Skimming through the existing dts file -
> arch/arm/boot/dts/sama5d4.dtsi and other dts files - there are lots of
> examples where the device tree binding contains the name for a single
> clock/interrupt.
> 


Note that dtsi and dts are the device-tree files, not the bindings.
And even if you find examples, the fact that there exist examples
doesn't mean it's the right thing to do.

Thanks,
Ezequiel


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 06/10] media: dt-bindings: Document SAMA5D4 VDEC bindings
  2021-03-24 15:17     ` Rob Herring
@ 2021-03-26 14:33       ` Ezequiel Garcia
  -1 siblings, 0 replies; 52+ messages in thread
From: Ezequiel Garcia @ 2021-03-26 14:33 UTC (permalink / raw)
  To: Rob Herring, Emil Velikov
  Cc: Philipp Zabel, linux-media, linux-rockchip, Nicolas Ferre,
	Frank Rowand, devicetree

Hi Rob,

Thanks for reviewing.

On Wed, 2021-03-24 at 09:17 -0600, Rob Herring wrote:
> On Thu, Mar 11, 2021 at 03:40:51PM +0000, Emil Velikov wrote:
> > From: Emil Velikov <emil.velikov@collabora.com>
> > 
> > Add devicetree binding documentation for the Hantro G1/G2 VDEC on
> > the Microchip SAMAS5D4 SoC.
> > 
> > Cc: Rob Herring <robh+dt@kernel.org>
> > Cc: Frank Rowand <frowand.list@gmail.com>
> > Cc: devicetree@vger.kernel.org>
> > Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> > ---
> > v2
> >  - Newly introduced
> >  - s/Atmel/Microchip/ (Nicolas)
> >  - Drop leading 0 in node name/address
> > ---
> >  .../media/microchip,sama5d4-vdec.yaml         | 59 +++++++++++++++++++
> >  1 file changed, 59 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml b/Documentation/devicetree/bindings/media/microchip,sama5d4-
> > vdec.yaml
> > new file mode 100644
> > index 000000000000..9cb2c0295d54
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > @@ -0,0 +1,59 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +
> > +%YAML 1.2
> > +---
> > +$id: "http://devicetree.org/schemas/media/microchip,sama5d4-vdec.yaml#"
> > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> > +
> > +title: Hantro G1 VPU codec implemented on Microchip SAMA5D4 SoCs
> > +
> > +maintainers:
> > +  - Emil Velikov <emil.velikov@collabora.com>
> > +
> > +description:
> > +  Hantro G1 video decode accelerator present on Microchip SAMA5D4 SoCs.
> > +
> > +properties:
> > +  compatible:
> > +    const: microchip,sama5d4-vdec
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  interrupt-names:
> > +    items:
> > +      - const: vdec
> 
> Why do you need a name? *-names are used to distinguish multiple entries 
> and don't add anything if only a single entry.
> 

I guess you are right.

I was about to argue that it makes backwards compatibility easier,
but I suspect that's not the case either.

> > +
> > +  clocks:
> > +    maxItems: 1
> > +
> > +  clock-names:
> > +    items:
> > +      - const: vdec_clk
> 
> And here too? These are typically named for either the name of input 
> signal (hclk, aclk, etc.) or function ('core', 'bus', etc.). 
> 

Indeed, "core" might be a better choice. But it seems we don't need
names here.

Thanks,
Ezequiel


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 06/10] media: dt-bindings: Document SAMA5D4 VDEC bindings
@ 2021-03-26 14:33       ` Ezequiel Garcia
  0 siblings, 0 replies; 52+ messages in thread
From: Ezequiel Garcia @ 2021-03-26 14:33 UTC (permalink / raw)
  To: Rob Herring, Emil Velikov
  Cc: Philipp Zabel, linux-media, linux-rockchip, Nicolas Ferre,
	Frank Rowand, devicetree

Hi Rob,

Thanks for reviewing.

On Wed, 2021-03-24 at 09:17 -0600, Rob Herring wrote:
> On Thu, Mar 11, 2021 at 03:40:51PM +0000, Emil Velikov wrote:
> > From: Emil Velikov <emil.velikov@collabora.com>
> > 
> > Add devicetree binding documentation for the Hantro G1/G2 VDEC on
> > the Microchip SAMAS5D4 SoC.
> > 
> > Cc: Rob Herring <robh+dt@kernel.org>
> > Cc: Frank Rowand <frowand.list@gmail.com>
> > Cc: devicetree@vger.kernel.org>
> > Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> > ---
> > v2
> >  - Newly introduced
> >  - s/Atmel/Microchip/ (Nicolas)
> >  - Drop leading 0 in node name/address
> > ---
> >  .../media/microchip,sama5d4-vdec.yaml         | 59 +++++++++++++++++++
> >  1 file changed, 59 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml b/Documentation/devicetree/bindings/media/microchip,sama5d4-
> > vdec.yaml
> > new file mode 100644
> > index 000000000000..9cb2c0295d54
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > @@ -0,0 +1,59 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +
> > +%YAML 1.2
> > +---
> > +$id: "http://devicetree.org/schemas/media/microchip,sama5d4-vdec.yaml#"
> > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> > +
> > +title: Hantro G1 VPU codec implemented on Microchip SAMA5D4 SoCs
> > +
> > +maintainers:
> > +  - Emil Velikov <emil.velikov@collabora.com>
> > +
> > +description:
> > +  Hantro G1 video decode accelerator present on Microchip SAMA5D4 SoCs.
> > +
> > +properties:
> > +  compatible:
> > +    const: microchip,sama5d4-vdec
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  interrupt-names:
> > +    items:
> > +      - const: vdec
> 
> Why do you need a name? *-names are used to distinguish multiple entries 
> and don't add anything if only a single entry.
> 

I guess you are right.

I was about to argue that it makes backwards compatibility easier,
but I suspect that's not the case either.

> > +
> > +  clocks:
> > +    maxItems: 1
> > +
> > +  clock-names:
> > +    items:
> > +      - const: vdec_clk
> 
> And here too? These are typically named for either the name of input 
> signal (hclk, aclk, etc.) or function ('core', 'bus', etc.). 
> 

Indeed, "core" might be a better choice. But it seems we don't need
names here.

Thanks,
Ezequiel


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
  2021-03-25 14:22           ` Emil Velikov
@ 2021-03-29  9:53             ` Nicolas Ferre
  -1 siblings, 0 replies; 52+ messages in thread
From: Nicolas Ferre @ 2021-03-29  9:53 UTC (permalink / raw)
  To: Emil Velikov, Alexandre Belloni
  Cc: Ezequiel Garcia, devicetree, Rob Herring, Ludovic Desroches,
	Philipp Zabel, linux-media, linux-rockchip

On 25/03/2021 at 15:22, Emil Velikov wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Greetings all,
> 
> On Thu, 25 Mar 2021 at 08:48, Alexandre Belloni
> <alexandre.belloni@bootlin.com> wrote:
>>
>> On 24/03/2021 14:44:14+0100, Nicolas Ferre wrote:
>>> Now, when we have the tag from Rob, how to coordinate these different
>>> pieces? Will it go through the media git tree? Will we benefit from a stable
>>> branch to share or will we just have to wait for the driver to hit Mainline
>>> before adding the defconfig and DT patches?
>>>
> Thanks for the Acked-by Nicolas.
> 
>>
>> I think the defconfig and dt patches can go through at91 as soon as we
>> get Rob's ack. There is no build dependency so it can be taken at any
>> time. Worst case, we end up with a selected config option that doesn't
>> exist.
>>
> My personal preference is to merge everything in one go.
> I believe it will be easier from maintainer's point of view, plus odds
> of conflicts with the AT91 tree are close to zero.
> 
> Then again, as long as the maintainers are happy - I'm fine either way.

I'm taking defconfig 2 last patches of your series right now. No need to 
include them in subsequent versions.

For DT, I'm waiting for settlement on refined code. As indicated by 
Alexandre, changes will need to travel through arm-soc tree so we'll 
coordinate when patches are ready.

Thanks a lot! Best regards,
   Nicolas


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
@ 2021-03-29  9:53             ` Nicolas Ferre
  0 siblings, 0 replies; 52+ messages in thread
From: Nicolas Ferre @ 2021-03-29  9:53 UTC (permalink / raw)
  To: Emil Velikov, Alexandre Belloni
  Cc: Ezequiel Garcia, devicetree, Rob Herring, Ludovic Desroches,
	Philipp Zabel, linux-media, linux-rockchip

On 25/03/2021 at 15:22, Emil Velikov wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Greetings all,
> 
> On Thu, 25 Mar 2021 at 08:48, Alexandre Belloni
> <alexandre.belloni@bootlin.com> wrote:
>>
>> On 24/03/2021 14:44:14+0100, Nicolas Ferre wrote:
>>> Now, when we have the tag from Rob, how to coordinate these different
>>> pieces? Will it go through the media git tree? Will we benefit from a stable
>>> branch to share or will we just have to wait for the driver to hit Mainline
>>> before adding the defconfig and DT patches?
>>>
> Thanks for the Acked-by Nicolas.
> 
>>
>> I think the defconfig and dt patches can go through at91 as soon as we
>> get Rob's ack. There is no build dependency so it can be taken at any
>> time. Worst case, we end up with a selected config option that doesn't
>> exist.
>>
> My personal preference is to merge everything in one go.
> I believe it will be easier from maintainer's point of view, plus odds
> of conflicts with the AT91 tree are close to zero.
> 
> Then again, as long as the maintainers are happy - I'm fine either way.

I'm taking defconfig 2 last patches of your series right now. No need to 
include them in subsequent versions.

For DT, I'm waiting for settlement on refined code. As indicated by 
Alexandre, changes will need to travel through arm-soc tree so we'll 
coordinate when patches are ready.

Thanks a lot! Best regards,
   Nicolas


-- 
Nicolas Ferre

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
  2021-03-29  9:53             ` Nicolas Ferre
@ 2021-03-31 17:36               ` Emil Velikov
  -1 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-31 17:36 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Alexandre Belloni, Ezequiel Garcia, devicetree, Rob Herring,
	Ludovic Desroches, Philipp Zabel, linux-media, linux-rockchip

On Mon, 29 Mar 2021 at 10:54, Nicolas Ferre <nicolas.ferre@microchip.com> wrote:
>
> On 25/03/2021 at 15:22, Emil Velikov wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> >
> > Greetings all,
> >
> > On Thu, 25 Mar 2021 at 08:48, Alexandre Belloni
> > <alexandre.belloni@bootlin.com> wrote:
> >>
> >> On 24/03/2021 14:44:14+0100, Nicolas Ferre wrote:
> >>> Now, when we have the tag from Rob, how to coordinate these different
> >>> pieces? Will it go through the media git tree? Will we benefit from a stable
> >>> branch to share or will we just have to wait for the driver to hit Mainline
> >>> before adding the defconfig and DT patches?
> >>>
> > Thanks for the Acked-by Nicolas.
> >
> >>
> >> I think the defconfig and dt patches can go through at91 as soon as we
> >> get Rob's ack. There is no build dependency so it can be taken at any
> >> time. Worst case, we end up with a selected config option that doesn't
> >> exist.
> >>
> > My personal preference is to merge everything in one go.
> > I believe it will be easier from maintainer's point of view, plus odds
> > of conflicts with the AT91 tree are close to zero.
> >
> > Then again, as long as the maintainers are happy - I'm fine either way.
>
> I'm taking defconfig 2 last patches of your series right now. No need to
> include them in subsequent versions.
>
> For DT, I'm waiting for settlement on refined code. As indicated by
> Alexandre, changes will need to travel through arm-soc tree so we'll
> coordinate when patches are ready.
>
Ack, dropped from v3 (also fixed the Microchip typo).

Thanks again
Emil

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 00/10] Microship SAMA5D4 VPU support et al
@ 2021-03-31 17:36               ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-31 17:36 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Alexandre Belloni, Ezequiel Garcia, devicetree, Rob Herring,
	Ludovic Desroches, Philipp Zabel, linux-media, linux-rockchip

On Mon, 29 Mar 2021 at 10:54, Nicolas Ferre <nicolas.ferre@microchip.com> wrote:
>
> On 25/03/2021 at 15:22, Emil Velikov wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> >
> > Greetings all,
> >
> > On Thu, 25 Mar 2021 at 08:48, Alexandre Belloni
> > <alexandre.belloni@bootlin.com> wrote:
> >>
> >> On 24/03/2021 14:44:14+0100, Nicolas Ferre wrote:
> >>> Now, when we have the tag from Rob, how to coordinate these different
> >>> pieces? Will it go through the media git tree? Will we benefit from a stable
> >>> branch to share or will we just have to wait for the driver to hit Mainline
> >>> before adding the defconfig and DT patches?
> >>>
> > Thanks for the Acked-by Nicolas.
> >
> >>
> >> I think the defconfig and dt patches can go through at91 as soon as we
> >> get Rob's ack. There is no build dependency so it can be taken at any
> >> time. Worst case, we end up with a selected config option that doesn't
> >> exist.
> >>
> > My personal preference is to merge everything in one go.
> > I believe it will be easier from maintainer's point of view, plus odds
> > of conflicts with the AT91 tree are close to zero.
> >
> > Then again, as long as the maintainers are happy - I'm fine either way.
>
> I'm taking defconfig 2 last patches of your series right now. No need to
> include them in subsequent versions.
>
> For DT, I'm waiting for settlement on refined code. As indicated by
> Alexandre, changes will need to travel through arm-soc tree so we'll
> coordinate when patches are ready.
>
Ack, dropped from v3 (also fixed the Microchip typo).

Thanks again
Emil

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 06/10] media: dt-bindings: Document SAMA5D4 VDEC bindings
  2021-03-26 14:28         ` Ezequiel Garcia
@ 2021-03-31 17:42           ` Emil Velikov
  -1 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-31 17:42 UTC (permalink / raw)
  To: Ezequiel Garcia
  Cc: Rob Herring, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre, Frank Rowand, devicetree

On Fri, 26 Mar 2021 at 14:29, Ezequiel Garcia <ezequiel@collabora.com> wrote:
>
> Hi Emil,
>
> On Thu, 2021-03-25 at 14:14 +0000, Emil Velikov wrote:
> > On Wed, 24 Mar 2021 at 15:17, Rob Herring <robh@kernel.org> wrote:
> > >
> > > On Thu, Mar 11, 2021 at 03:40:51PM +0000, Emil Velikov wrote:
> > > > From: Emil Velikov <emil.velikov@collabora.com>
> > > >
> > > > Add devicetree binding documentation for the Hantro G1/G2 VDEC on
> > > > the Microchip SAMAS5D4 SoC.
> > > >
> > > > Cc: Rob Herring <robh+dt@kernel.org>
> > > > Cc: Frank Rowand <frowand.list@gmail.com>
> > > > Cc: devicetree@vger.kernel.org>
> > > > Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> > > > ---
> > > > v2
> > > >  - Newly introduced
> > > >  - s/Atmel/Microchip/ (Nicolas)
> > > >  - Drop leading 0 in node name/address
> > > > ---
> > > >  .../media/microchip,sama5d4-vdec.yaml         | 59 +++++++++++++++++++
> > > >  1 file changed, 59 insertions(+)
> > > >  create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml b/Documentation/devicetree/bindings/media/microchip,sama5d4-
> > > > vdec.yaml
> > > > new file mode 100644
> > > > index 000000000000..9cb2c0295d54
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > > > @@ -0,0 +1,59 @@
> > > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > > > +
> > > > +%YAML 1.2
> > > > +---
> > > > +$id: "http://devicetree.org/schemas/media/microchip,sama5d4-vdec.yaml#"
> > > > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> > > > +
> > > > +title: Hantro G1 VPU codec implemented on Microchip SAMA5D4 SoCs
> > > > +
> > > > +maintainers:
> > > > +  - Emil Velikov <emil.velikov@collabora.com>
> > > > +
> > > > +description:
> > > > +  Hantro G1 video decode accelerator present on Microchip SAMA5D4 SoCs.
> > > > +
> > > > +properties:
> > > > +  compatible:
> > > > +    const: microchip,sama5d4-vdec
> > > > +
> > > > +  reg:
> > > > +    maxItems: 1
> > > > +
> > > > +  interrupts:
> > > > +    maxItems: 1
> > > > +
> > > > +  interrupt-names:
> > > > +    items:
> > > > +      - const: vdec
> > >
> > > Why do you need a name? *-names are used to distinguish multiple entries
> > > and don't add anything if only a single entry.
> > >
> > On one hand the names are used to describe the hardware - the SAMA
> > board uses designated clock and interrupt lines - both called "vdec".
> > Additionally the names are ultimately required by the underlying API -
> > platform_get_irq_byname and  devm_clk_bulk_get respectively.
> > How can we get the respective entries without the name?
> >
>
> There are APIs to get the resource by index as opposed to by name.
> E.g. platform_get_irq.
>
> However, you are confusing here internal kernel implementation
> with devicetree bindings. The latter is just a representation
> of the hardware.
>
My train of thought was that if we're missing API to fetch the entries
via non-name means, then there's a reasonable precedent to expose the
name. Clearly I missed the API, so my argument is just off.

> > Skimming through the existing dts file -
> > arch/arm/boot/dts/sama5d4.dtsi and other dts files - there are lots of
> > examples where the device tree binding contains the name for a single
> > clock/interrupt.
> >
>
>
> Note that dtsi and dts are the device-tree files, not the bindings.
> And even if you find examples, the fact that there exist examples
> doesn't mean it's the right thing to do.
>
Fully agreed. Thanks for the correction and hints.

The v3, just submitted, lacks the names all together.

-Emil

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2 06/10] media: dt-bindings: Document SAMA5D4 VDEC bindings
@ 2021-03-31 17:42           ` Emil Velikov
  0 siblings, 0 replies; 52+ messages in thread
From: Emil Velikov @ 2021-03-31 17:42 UTC (permalink / raw)
  To: Ezequiel Garcia
  Cc: Rob Herring, Philipp Zabel, linux-media, linux-rockchip,
	Nicolas Ferre, Frank Rowand, devicetree

On Fri, 26 Mar 2021 at 14:29, Ezequiel Garcia <ezequiel@collabora.com> wrote:
>
> Hi Emil,
>
> On Thu, 2021-03-25 at 14:14 +0000, Emil Velikov wrote:
> > On Wed, 24 Mar 2021 at 15:17, Rob Herring <robh@kernel.org> wrote:
> > >
> > > On Thu, Mar 11, 2021 at 03:40:51PM +0000, Emil Velikov wrote:
> > > > From: Emil Velikov <emil.velikov@collabora.com>
> > > >
> > > > Add devicetree binding documentation for the Hantro G1/G2 VDEC on
> > > > the Microchip SAMAS5D4 SoC.
> > > >
> > > > Cc: Rob Herring <robh+dt@kernel.org>
> > > > Cc: Frank Rowand <frowand.list@gmail.com>
> > > > Cc: devicetree@vger.kernel.org>
> > > > Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
> > > > ---
> > > > v2
> > > >  - Newly introduced
> > > >  - s/Atmel/Microchip/ (Nicolas)
> > > >  - Drop leading 0 in node name/address
> > > > ---
> > > >  .../media/microchip,sama5d4-vdec.yaml         | 59 +++++++++++++++++++
> > > >  1 file changed, 59 insertions(+)
> > > >  create mode 100644 Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml b/Documentation/devicetree/bindings/media/microchip,sama5d4-
> > > > vdec.yaml
> > > > new file mode 100644
> > > > index 000000000000..9cb2c0295d54
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/media/microchip,sama5d4-vdec.yaml
> > > > @@ -0,0 +1,59 @@
> > > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > > > +
> > > > +%YAML 1.2
> > > > +---
> > > > +$id: "http://devicetree.org/schemas/media/microchip,sama5d4-vdec.yaml#"
> > > > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> > > > +
> > > > +title: Hantro G1 VPU codec implemented on Microchip SAMA5D4 SoCs
> > > > +
> > > > +maintainers:
> > > > +  - Emil Velikov <emil.velikov@collabora.com>
> > > > +
> > > > +description:
> > > > +  Hantro G1 video decode accelerator present on Microchip SAMA5D4 SoCs.
> > > > +
> > > > +properties:
> > > > +  compatible:
> > > > +    const: microchip,sama5d4-vdec
> > > > +
> > > > +  reg:
> > > > +    maxItems: 1
> > > > +
> > > > +  interrupts:
> > > > +    maxItems: 1
> > > > +
> > > > +  interrupt-names:
> > > > +    items:
> > > > +      - const: vdec
> > >
> > > Why do you need a name? *-names are used to distinguish multiple entries
> > > and don't add anything if only a single entry.
> > >
> > On one hand the names are used to describe the hardware - the SAMA
> > board uses designated clock and interrupt lines - both called "vdec".
> > Additionally the names are ultimately required by the underlying API -
> > platform_get_irq_byname and  devm_clk_bulk_get respectively.
> > How can we get the respective entries without the name?
> >
>
> There are APIs to get the resource by index as opposed to by name.
> E.g. platform_get_irq.
>
> However, you are confusing here internal kernel implementation
> with devicetree bindings. The latter is just a representation
> of the hardware.
>
My train of thought was that if we're missing API to fetch the entries
via non-name means, then there's a reasonable precedent to expose the
name. Clearly I missed the API, so my argument is just off.

> > Skimming through the existing dts file -
> > arch/arm/boot/dts/sama5d4.dtsi and other dts files - there are lots of
> > examples where the device tree binding contains the name for a single
> > clock/interrupt.
> >
>
>
> Note that dtsi and dts are the device-tree files, not the bindings.
> And even if you find examples, the fact that there exist examples
> doesn't mean it's the right thing to do.
>
Fully agreed. Thanks for the correction and hints.

The v3, just submitted, lacks the names all together.

-Emil

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2021-03-31 17:44 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 15:40 [PATCH v2 00/10] Microship SAMA5D4 VPU support et al Emil Velikov
2021-03-11 15:40 ` Emil Velikov
2021-03-11 15:40 ` [PATCH v2 01/10] media: hantro: use G1_REG_INTERRUPT directly for the mpeg2 Emil Velikov
2021-03-11 15:40   ` Emil Velikov
2021-03-11 15:40 ` [PATCH v2 02/10] media: hantro: imx: reuse MB_DIM define Emil Velikov
2021-03-11 15:40   ` Emil Velikov
2021-03-11 15:40 ` [PATCH v2 03/10] media: hantro: imx: remove duplicate dec_base init Emil Velikov
2021-03-11 15:40   ` Emil Velikov
2021-03-11 15:40 ` [PATCH v2 04/10] media: hantro: imx: remove unused include Emil Velikov
2021-03-11 15:40   ` Emil Velikov
2021-03-11 15:40 ` [PATCH v2 05/10] media: hantro: introduce hantro_g1.c for common API Emil Velikov
2021-03-11 15:40   ` Emil Velikov
2021-03-11 15:40 ` [PATCH v2 06/10] media: dt-bindings: Document SAMA5D4 VDEC bindings Emil Velikov
2021-03-11 15:40   ` Emil Velikov
2021-03-24 15:17   ` Rob Herring
2021-03-24 15:17     ` Rob Herring
2021-03-25 14:14     ` Emil Velikov
2021-03-25 14:14       ` Emil Velikov
2021-03-26 14:28       ` Ezequiel Garcia
2021-03-26 14:28         ` Ezequiel Garcia
2021-03-31 17:42         ` Emil Velikov
2021-03-31 17:42           ` Emil Velikov
2021-03-26 14:33     ` Ezequiel Garcia
2021-03-26 14:33       ` Ezequiel Garcia
2021-03-11 15:40 ` [PATCH v2 07/10] media: hantro: add initial SAMA5D4 support Emil Velikov
2021-03-11 15:40   ` Emil Velikov
2021-03-11 15:40 ` [PATCH v2 08/10] ARM: dts: sama5d4: enable Hantro G1 VDEC Emil Velikov
2021-03-11 15:40   ` Emil Velikov
2021-03-11 15:40 ` [PATCH v2 09/10] ARM: configs: at91: sama5: update with savedefconfig Emil Velikov
2021-03-11 15:40   ` Emil Velikov
2021-03-11 15:40   ` Emil Velikov
2021-03-11 15:40 ` [PATCH v2 10/10] ARM: configs: at91: sama5: enable the Hantro G1 engine Emil Velikov
2021-03-11 15:40   ` Emil Velikov
2021-03-11 15:40   ` Emil Velikov
2021-03-16 17:23 ` [PATCH v2 00/10] Microship SAMA5D4 VPU support et al Ezequiel Garcia
2021-03-16 17:23   ` Ezequiel Garcia
2021-03-24 12:49   ` Emil Velikov
2021-03-24 12:49     ` Emil Velikov
2021-03-24 13:44     ` Nicolas Ferre
2021-03-24 13:44       ` Nicolas Ferre
2021-03-25  8:48       ` Alexandre Belloni
2021-03-25  8:48         ` Alexandre Belloni
2021-03-25 14:22         ` Emil Velikov
2021-03-25 14:22           ` Emil Velikov
2021-03-29  9:53           ` Nicolas Ferre
2021-03-29  9:53             ` Nicolas Ferre
2021-03-31 17:36             ` Emil Velikov
2021-03-31 17:36               ` Emil Velikov
2021-03-25 15:50         ` Nicolas Ferre
2021-03-25 15:50           ` Nicolas Ferre
2021-03-24 19:58 ` Nicolas Dufresne
2021-03-24 19:58   ` Nicolas Dufresne

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.