Skip to contentSkip to conversation

media: platform: Renesas IMR driver

PATCH Superseded Sergei Shtylyov 4 participants 7 messages Mar 2, 2017 – Mar 6, 2017 3 messages not in the archive

Subsystems (3)

v1 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: platform: Renesas IMR driver

From: Konstantin Kozhevnikov <[email protected]>

The image renderer, or the distortion correction engine, is a drawing processor with a simple instruction system capable of referencing video capture data or data in an external memory as the 2D texture data and performing texture mapping and drawing with respect to any shape that is split into triangular objects.

This V4L2 memory-to-memory device driver only supports image renderer light extended 4 (IMR-LX4) found in the R-Car gen3 SoCs; the R-Car gen2 support can be added later...

[Sergei: merged 2 original patches, added the patch description, removed unrelated parts, added the binding document, ported the driver to the modern kernel, renamed the UAPI header file and the guard macros to match the driver name, extended the copyrights, fixed up Kconfig prompt/depends/ help, made use of the BIT()/GENMASK() macros, sorted #include's, removed leading dots and fixed grammar in the comments, fixed up indentation to use tabs where possible, renamed DLSR, CMRCR.DY1{0|2}, and ICR bits to match the manual, changed the prefixes of the CMRCR[2]/TRI{M|C}R bits/ fields to match the manual, removed non-existent TRIMR.D{Y|U}D{X|V}M bits, added/used the IMR bits, separated the register offset/bit #define's, sorted the instruction macros by opcode, masked the register address in WTL[2]/WTS instruction macros, avoided setting reserved bits when writing to CMRCCR[2]/TRIMCR, used the SR bits instead of a bare number, removed *inline* from .c file, fixed lines over 80 columns, removed useless parens, operators, casts, braces, variables, #include's, statements, and even 1 function, inserted empty line after desclaration, removed extra empty lines, reordered some local variable desclarations, removed calls to 4l2_err() on kmalloc() failure, fixed the error returned by imr_default(), avoided code duplication in the IRQ handler, used '__packed' for the UAPI structures, enclosed the macro parameters in parens, exchanged the values of IMR_MAP_AUTO{S|D}G macros.]

---
Changes in version 2:
- renamed the ICR bits to match the manual;
- added/used the IMR bits;
- changed the prefixes of the CMRCR[2]/TRI{M|C}R bits/fields to match the manual;
- renamed the CMRCR.DY1{0|2} bits to match the manual;
- removed non-existent TRIMR.D{Y|U}D{X|V}M bits;
- used the SR bits instead of a bare number;
- sorted the instruction macros by opcode, removing redundant parens;
- masked the register address in WTL[2]/WTS instruction macros;
- avoided setting reserved bits when writing to CMRCCR[2]/TRIMCR;
- mentioned the video capture data as a texture source in the binding and the patch description;
- documented the SoC specific "compatible" values;
- clarified the "interrupts" and "clocks" property text;
- updated the patch description.

 Documentation/devicetree/bindings/media/rcar_imr.txt |   28 
 drivers/media/platform/Kconfig                       |   13 
 drivers/media/platform/Makefile                      |    1 
 drivers/media/platform/rcar_imr.c                    | 1926 +++++++++++++++++++
 include/uapi/linux/rcar_imr.h                        |   94 
 5 files changed, 2062 insertions(+)
Documentation/devicetree/bindings/media/rcar_imr.txt new file +28 -0
Index: media_tree/Documentation/devicetree/bindings/media/rcar_imr.txt
===================================================================
@@ -0,0 +1,28 @@
+Renesas R-Car Image Renderer (Distortion Correction Engine)
+-----------------------------------------------------------
+
+The image renderer, or the distortion correction engine, is a drawing processor
+with a simple instruction system capable of referencing video capture data or
+data in an external memory as 2D texture data and performing texture mapping
+and drawing with respect to any shape that is split into triangular objects.
+
+Required properties:
+
+- compatible: "renesas,imr-lx4-<soctype>", "renesas,imr-lx4" as a fallback for
+  the image renderer light extended 4 (IMR-LX4) found in the R-Car gen3 SoCs,
+  where the examples with <soctype> are:
+  - "renesas,imr-lx4-h3" for R-Car H3,
+  - "renesas,imr-lx4-m3-w" for R-Car M3-W,
+  - "renesas,imr-lx4-v3m" for R-Car V3M.
+- reg: offset and length of the register block;
+- interrupts: single interrupt specifier;
+- clocks: single clock phandle/specifier pair.
+
+Example:
+
+	imr-lx4@fe860000 {
+		compatible = "renesas,imr-lx4-h3", "renesas,imr-lx4";
+		reg = <0 0xfe860000 0 0x2000>;
+		interrupts = <GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cpg CPG_MOD 823>;
+	};
drivers/media/platform/Kconfig +13 -0
Index: media_tree/drivers/media/platform/Kconfig
===================================================================
@@ -399,6 +399,19 @@ config VIDEO_RENESAS_FCP
 	  To compile this driver as a module, choose M here: the module
 	  will be called rcar-fcp.
 
+config VIDEO_RENESAS_IMR
+	tristate "Renesas Image Renderer (Distortion Correction Engine)"
+	depends on VIDEO_DEV && VIDEO_V4L2
+	depends on ARCH_RENESAS || COMPILE_TEST
+	select VIDEOBUF2_DMA_CONTIG
+	select V4L2_MEM2MEM_DEV
+	---help---
+	  This is a V4L2 driver for the Renesas Image Renderer Light Extended 4
+	  (IMR-LX4).
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called rcar_imr.
+
 config VIDEO_RENESAS_VSP1
 	tristate "Renesas VSP1 Video Processing Engine"
 	depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && HAS_DMA
drivers/media/platform/Makefile +1 -0
Index: media_tree/drivers/media/platform/Makefile
===================================================================
@@ -52,6 +52,7 @@ obj-$(CONFIG_SOC_CAMERA)		+= soc_camera/
 obj-$(CONFIG_VIDEO_RENESAS_FCP) 	+= rcar-fcp.o
 obj-$(CONFIG_VIDEO_RENESAS_FDP1)	+= rcar_fdp1.o
 obj-$(CONFIG_VIDEO_RENESAS_JPU) 	+= rcar_jpu.o
+obj-$(CONFIG_VIDEO_RENESAS_IMR) 	+= rcar_imr.o
 obj-$(CONFIG_VIDEO_RENESAS_VSP1)	+= vsp1/
 
 obj-y	+= omap/
drivers/media/platform/rcar_imr.c new file +1926 -0

1,926 lines not on this page · raw message

include/uapi/linux/rcar_imr.h new file +94 -0

94 lines not on this page · raw message

#1 lore raw

Hi Sergei,

Documentation/devicetree/bindings/media/rcar_imr.txt

Quoted 4 lines · Sergei Shtylyov
Documentation/devicetree/bindings/media/rcar_imr.txt new file +1 -0
 
+- compatible: "renesas,imr-lx4-<soctype>", "renesas,imr-lx4" as a fallback for

"renesas,<soctype>-imr-lx4"

Documentation/devicetree/bindings/media/rcar_imr.txt line 14

Quoted 3 lines
Documentation/devicetree/bindings/media/rcar_imr.txt new file +3 -0
+  the image renderer light extended 4 (IMR-LX4) found in the R-Car gen3 SoCs,
+  where the examples with <soctype> are:
+  - "renesas,imr-lx4-h3" for R-Car H3,

"renesas,r8a7795-imr-lx4"

Quoted 1 line

+ - "renesas,imr-lx4-m3-w" for R-Car M3-W,

"renesas,r8a7796-imr-lx4"

Quoted 1 line

+ - "renesas,imr-lx4-v3m" for R-Car V3M.

"renesas,-EPROBE_DEFER-imr-lx4"

Gr{oetje,eeting}s,

Geert

A message that is not in the archive (sent off-list or not yet received): CAMuHMdVg5N82bu8fxRS=3iqF2MQmqoR0idb_x0t2RNn8eoedQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#3 lore raw

Hello!

Quoted 5 lines · Geert Uytterhoeven

Documentation/devicetree/bindings/media/rcar_imr.txt

Quoted 4 lines
Documentation/devicetree/bindings/media/rcar_imr.txt new file +1 -0
 
+- compatible: "renesas,imr-lx4-<soctype>", "renesas,imr-lx4" as a fallback for
Quoted 7 lines

"renesas,<soctype>-imr-lx4"

Documentation/devicetree/bindings/media/rcar_imr.txt line 14

Quoted 3 lines
Documentation/devicetree/bindings/media/rcar_imr.txt new file +3 -0
+  the image renderer light extended 4 (IMR-LX4) found in the R-Car gen3 SoCs,
+  where the examples with <soctype> are:
+  - "renesas,imr-lx4-h3" for R-Car H3,

"renesas,r8a7795-imr-lx4"

The IMR core names were copied from the manual verbatim (just in lower case).

Quoted 7 lines
Quoted 1 line

+ - "renesas,imr-lx4-m3-w" for R-Car M3-W,

"renesas,r8a7796-imr-lx4"

Quoted 1 line

+ - "renesas,imr-lx4-v3m" for R-Car V3M.

"renesas,-EPROBE_DEFER-imr-lx4"

Huh? :-)

Quoted 3 lines

Gr{oetje,eeting}s,

Geert

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 7 lines · Sergei Shtylyov
Quoted 4 lines
Quoted 1 line

+ - "renesas,imr-lx4-v3m" for R-Car V3M.

"renesas,-EPROBE_DEFER-imr-lx4"

   Huh? :-)

Do you know the part number of V3M?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

A message that is not in the archive (sent off-list or not yet received): CAMuHMdUa4n_Gw7bMiSvDzb8TYQMu3WgnR6kTXtsMu_=k1mQrsA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#6 lore raw
Quoted 9 lines · Geert Uytterhoeven
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

+ - "renesas,imr-lx4-v3m" for R-Car V3M.

"renesas,-EPROBE_DEFER-imr-lx4"

   Huh? :-)

Do you know the part number of V3M?

No, but using the names from the manual I don't need it.

Quoted 3 lines

Gr{oetje,eeting}s,

Geert

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): abdfa250-8b13-7471-3e60-2b33b41aa1a5-M4DtvfQ/[email protected]

#8 lore raw

Hi Sergei,

Thanks for your efforts with this driver. Nice to see that V2 is getting in better shape.

In the future, would it be possible for you to include the patch version number in the [PATCH] tag somehow?

Quoted 10 lines · Sergei Shtylyov
Quoted 8 lines · Geert Uytterhoeven
Quoted 8 lines
Quoted 5 lines
Quoted 1 line

+ - "renesas,imr-lx4-v3m" for R-Car V3M.

"renesas,-EPROBE_DEFER-imr-lx4"

Quoted 7 lines
Quoted 4 lines
Quoted 1 line
   Huh? :-)

Do you know the part number of V3M?

No, but using the names from the manual I don't need it.

NAK, like Geert says, please follow the same style as other upstream drivers. DT compat strings is not a place for random polices.

Thanks,

/ magnus
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw
Quoted 5 lines · Magnus Damm

Thanks for your efforts with this driver. Nice to see that V2 is getting in better shape.

In the future, would it be possible for you to include the patch version number in the [PATCH] tag somehow?

Sorry, I'm still getting used to 'quilt mail'...

Quoted 15 lines
Quoted 13 lines · Sergei Shtylyov
Quoted 11 lines · Geert Uytterhoeven
Quoted 9 lines
Quoted 5 lines
Quoted 1 line

+ - "renesas,imr-lx4-v3m" for R-Car V3M.

"renesas,-EPROBE_DEFER-imr-lx4"

   Huh? :-)
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Do you know the part number of V3M?

No, but using the names from the manual I don't need it.

NAK, like Geert says, please follow the same style as other upstream drivers. DT compat strings is not a place for random polices.

Note that I don't think we need the SoC specific strings (like was done
with the VSP1/2 driver). I'm not seeing any differences between the gen3 SoCs looking at the most current manual...

Quoted 3 lines

Thanks,

/ magnus

MBR, Sergei