Skip to contentSkip to conversation

drm: EPDC driver for i.MX6

RFC PATCH In review Andreas Kemnade 5 participants 22 messages Feb 6, 2022 – Mar 14, 2022

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover drm: EPDC driver for i.MX6

Add a driver for the Electrophoretic Display Controller found in the i.MX6 SoCs.

In combination with a driver for an EPD PMIC (like the TPS65185 or the SY7636A), it works with the EPDC found in i.MX6SLL based devices and the EPDC found in i.MX6SL devices.

Support for waveforms might be limited, there was no 4bit waveform found which works with the 6SLL but it works with the vendor waveforms of the Kobo Clara HD (6SLL), the Tolino Shine 2/3 (6SL).
On the 6SL devices, also the epdc_E060SCM.fw works but not as brilliant as the vendor one.

It does not involve the PXP yet. The NXP/Freescale kernel fork uses that for rotation and mysterious waveform handling. That is not planed to be upstreamed in the first step.

Also it does not provide any special userspace API to fine-tune updates. That is also IMHO something for a second step.

Andreas Kemnade (6):
dt-bindings: display: imx: Add EPDC
drm: Add skeleton for EPDC driver
drm: mxc-epdc: Add display and waveform initialisation
drm: mxc-epdc: Add update management
ARM: dts: imx6sll: add EPDC
arm: dts: imx6sl: Add EPDC

 .../bindings/display/imx/fsl,mxc-epdc.yaml    |  159 +++
 arch/arm/boot/dts/imx6sl.dtsi                 |    3 +
 arch/arm/boot/dts/imx6sll.dtsi                |    9 +
 drivers/gpu/drm/Kconfig                       |    2 +
 drivers/gpu/drm/Makefile                      |    1 +
 drivers/gpu/drm/mxc-epdc/Kconfig              |   15 +
 drivers/gpu/drm/mxc-epdc/Makefile             |    5 +
 drivers/gpu/drm/mxc-epdc/epdc_hw.c            |  497 +++++++
 drivers/gpu/drm/mxc-epdc/epdc_hw.h            |    8 +
 drivers/gpu/drm/mxc-epdc/epdc_regs.h          |  442 ++++++
 drivers/gpu/drm/mxc-epdc/epdc_update.c        | 1210 +++++++++++++++++
 drivers/gpu/drm/mxc-epdc/epdc_update.h        |    9 +
 drivers/gpu/drm/mxc-epdc/epdc_waveform.c      |  189 +++
 drivers/gpu/drm/mxc-epdc/epdc_waveform.h      |    7 +
 drivers/gpu/drm/mxc-epdc/mxc_epdc.h           |  151 ++
 drivers/gpu/drm/mxc-epdc/mxc_epdc_drv.c       |  373 +++++
 16 files changed, 3080 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml
 create mode 100644 drivers/gpu/drm/mxc-epdc/Kconfig
 create mode 100644 drivers/gpu/drm/mxc-epdc/Makefile
 create mode 100644 drivers/gpu/drm/mxc-epdc/epdc_hw.c
 create mode 100644 drivers/gpu/drm/mxc-epdc/epdc_hw.h
 create mode 100644 drivers/gpu/drm/mxc-epdc/epdc_regs.h
 create mode 100644 drivers/gpu/drm/mxc-epdc/epdc_update.c
 create mode 100644 drivers/gpu/drm/mxc-epdc/epdc_update.h
 create mode 100644 drivers/gpu/drm/mxc-epdc/epdc_waveform.c
 create mode 100644 drivers/gpu/drm/mxc-epdc/epdc_waveform.h
 create mode 100644 drivers/gpu/drm/mxc-epdc/mxc_epdc.h
 create mode 100644 drivers/gpu/drm/mxc-epdc/mxc_epdc_drv.c
Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw

RFC PATCH 1/6 dt-bindings: display: imx: Add EPDC

Add a binding for the Electrophoretic Display Controller found at least in the i.MX6.
The timing subnode is directly here to avoid having display parameters spread all over the plate.

Supplies are organized the same way as in the fbdev driver in the NXP/Freescale kernel forks. The regulators used for that purpose, like the TPS65185, the SY7636A and MAX17135 have typically a single bit to start a bunch of regulators of higher or negative voltage with a well-defined timing. VCOM can be handled separately, but can also be incorporated into that single bit.

---
 .../bindings/display/imx/fsl,mxc-epdc.yaml    | 159 ++++++++++++++++++
 1 file changed, 159 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +159 -0
new file mode 100644
index 000000000000..7e0795cc3f70
@@ -0,0 +1,159 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/imx/fsl,mxc-epdc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX6 EPDC
+
+maintainers:
+  - Andreas Kemnade <[email protected]>
+
+description: |
+  The EPDC is a controller for handling electronic paper displays found in
+  i.MX6 SoCs.
+
+properties:
+  compatible:
+    enum:
+      - fsl,imx6sl-epdc
+      - fsl,imx6sll-epdc
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: Bus clock
+      - description: Pixel clock
+
+  clock-names:
+    items:
+      - const: axi
+      - const: pix
+
+  interrupts:
+    maxItems: 1
+
+  vscan-holdoff:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  sdoed-width:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  sdoed-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  sdoez-width:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  sdoez-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  gdclk-hp-offs:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  gdsp-offs:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  gdoe-offs:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  gdclk-offs:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  num-ce:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  timing:
+    $ref: /display/panel/panel-timing.yaml#
+
+  DISPLAY-supply:
+    description:
+      A couple of +/- voltages automatically powered on in a defintive order
+
+  VCOM-supply:
+    description: compensation voltage
+
+  V3P3-supply:
+    description: V3P3 supply
+
+  epd-thermal-zone:
+    description:
+      Zone to get temperature of the EPD from, practically ambient temperature.
+
+
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+  - vscan-holdoff
+  - sdoed-width
+  - sdoed-delay
+  - sdoez-width
+  - sdoez-delay
+  - gdclk-hp-offs
+  - gdsp-offs
+  - gdoe-offs
+  - gdclk-offs
+  - num-ce
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx6sl-clock.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    epdc: epdc@20f4000 {
+        compatible = "fsl,imx6sl-epdc";
+        reg = <0x020f4000 0x4000>;
+        interrupts = <0 97 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&clks IMX6SL_CLK_EPDC_AXI>, <&clks IMX6SL_CLK_EPDC_PIX>;
+        clock-names = "axi", "pix";
+
+        pinctrl-names = "default";
+        pinctrl-0 = <&pinctrl_epdc0>;
+        V3P3-supply = <&V3P3_reg>;
+        VCOM-supply = <&VCOM_reg>;
+        DISPLAY-supply = <&DISPLAY_reg>;
+        epd-thermal-zone = "epd-thermal";
+
+        vscan-holdoff = <4>;
+        sdoed-width = <10>;
+        sdoed-delay = <20>;
+        sdoez-width = <10>;
+        sdoez-delay = <20>;
+        gdclk-hp-offs = <562>;
+        gdsp-offs = <662>;
+        gdoe-offs = <0>;
+        gdclk-offs = <225>;
+        num-ce = <3>;
+        status = "okay";
+
+        timing {
+                clock-frequency = <80000000>;
+                hactive = <1448>;
+                hback-porch = <16>;
+                hfront-porch = <102>;
+                hsync-len = <28>;
+                vactive = <1072>;
+                vback-porch = <4>;
+                vfront-porch = <4>;
+                vsync-len = <2>;
+        };
+    };
+...
Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#2 lore raw

Re: [RFC PATCH 1/6] dt-bindings: display: imx: Add EPDC

Quoted 2 lines · Andreas Kemnade

Add a binding for the Electrophoretic Display Controller found at least in the i.MX6.

The first version was in i.MX50 (I helped design the register interface). Is that version compatible?

Quoted 32 lines

The timing subnode is directly here to avoid having display parameters spread all over the plate.

Supplies are organized the same way as in the fbdev driver in the NXP/Freescale kernel forks. The regulators used for that purpose, like the TPS65185, the SY7636A and MAX17135 have typically a single bit to start a bunch of regulators of higher or negative voltage with a well-defined timing. VCOM can be handled separately, but can also be incorporated into that single bit.

---
 .../bindings/display/imx/fsl,mxc-epdc.yaml    | 159 ++++++++++++++++++
 1 file changed, 159 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +10 -0
new file mode 100644
index 000000000000..7e0795cc3f70
@@ -0,0 +1,159 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/imx/fsl,mxc-epdc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX6 EPDC
+
+maintainers:
+  - Andreas Kemnade <[email protected]>

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 20

Quoted 10 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +10 -0
+
+description: |
+  The EPDC is a controller for handling electronic paper displays found in
+  i.MX6 SoCs.
+
+properties:
+  compatible:
+    enum:
+      - fsl,imx6sl-epdc
+      - fsl,imx6sll-epdc

Not compatible with each other?

Quoted 47 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +46 -0
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: Bus clock
+      - description: Pixel clock
+
+  clock-names:
+    items:
+      - const: axi
+      - const: pix
+
+  interrupts:
+    maxItems: 1
+
 
+  vscan-holdoff:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  sdoed-width:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  sdoed-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  sdoez-width:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  sdoez-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  gdclk-hp-offs:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  gdsp-offs:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  gdoe-offs:

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 76

Quoted 10 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +10 -0
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  gdclk-offs:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  num-ce:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1

All these need a vendor prefix and descriptions.

Quoted 10 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +10 -0
+
+  timing:
+    $ref: /display/panel/panel-timing.yaml#
+
+  DISPLAY-supply:
+    description:
+      A couple of +/- voltages automatically powered on in a defintive order
+
+  VCOM-supply:
+    description: compensation voltage

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 96

Quoted 10 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +10 -0
+
+  V3P3-supply:
+    description: V3P3 supply
+
+  epd-thermal-zone:
+    description:
+      Zone to get temperature of the EPD from, practically ambient temperature.
+
+
+

1 blank line.

Quoted 39 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +39 -0
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+  - vscan-holdoff
+  - sdoed-width
+  - sdoed-delay
+  - sdoez-width
+  - sdoez-delay
+  - gdclk-hp-offs
+  - gdsp-offs
+  - gdoe-offs
+  - gdclk-offs
+  - num-ce
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx6sl-clock.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    epdc: epdc@20f4000 {
+        compatible = "fsl,imx6sl-epdc";
+        reg = <0x020f4000 0x4000>;
+        interrupts = <0 97 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&clks IMX6SL_CLK_EPDC_AXI>, <&clks IMX6SL_CLK_EPDC_PIX>;
+        clock-names = "axi", "pix";
+
+        pinctrl-names = "default";
+        pinctrl-0 = <&pinctrl_epdc0>;
+        V3P3-supply = <&V3P3_reg>;
+        VCOM-supply = <&VCOM_reg>;
+        DISPLAY-supply = <&DISPLAY_reg>;
+        epd-thermal-zone = "epd-thermal";
+
+        vscan-holdoff = <4>;

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 145

Quoted 10 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +10 -0
+        sdoed-width = <10>;
+        sdoed-delay = <20>;
+        sdoez-width = <10>;
+        sdoez-delay = <20>;
+        gdclk-hp-offs = <562>;
+        gdsp-offs = <662>;
+        gdoe-offs = <0>;
+        gdclk-offs = <225>;
+        num-ce = <3>;
+        status = "okay";

Don't need status in examples.

Quoted 18 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +14 -0
+
+        timing {
+                clock-frequency = <80000000>;
+                hactive = <1448>;
+                hback-porch = <16>;
+                hfront-porch = <102>;
+                hsync-len = <28>;
+                vactive = <1072>;
+                vback-porch = <4>;
+                vfront-porch = <4>;
+                vsync-len = <2>;
+        };
+    };
+...
Signature · 1 line
2.30.2
#3 lore raw

Re: [RFC PATCH 1/6] dt-bindings: display: imx: Add EPDC

Hi Rob,

Quoted 7 lines · On Fri, 11 Feb 2022 09:46:27 -0600 Rob Herring <[email protected]> wrote:
Quoted 2 lines · Andreas Kemnade

Add a binding for the Electrophoretic Display Controller found at least in the i.MX6.

The first version was in i.MX50 (I helped design the register interface). Is that version compatible?

it has some differences, but that could be detected by EPDC_VERSION register. I do not own such a device, so I cannot fully check. I have not seen any driver with devicetree for IMX5. For now I am rejecting anything which has a EPDC version which I cannot check.

Quoted 36 lines
Quoted 36 lines

The timing subnode is directly here to avoid having display parameters spread all over the plate.

Supplies are organized the same way as in the fbdev driver in the NXP/Freescale kernel forks. The regulators used for that purpose, like the TPS65185, the SY7636A and MAX17135 have typically a single bit to start a bunch of regulators of higher or negative voltage with a well-defined timing. VCOM can be handled separately, but can also be incorporated into that single bit.

---
 .../bindings/display/imx/fsl,mxc-epdc.yaml    | 159 ++++++++++++++++++
 1 file changed, 159 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +14 -0
new file mode 100644
index 000000000000..7e0795cc3f70
@@ -0,0 +1,159 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/imx/fsl,mxc-epdc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX6 EPDC
+
+maintainers:
+  - Andreas Kemnade <[email protected]>
+
+description: |
+  The EPDC is a controller for handling electronic paper displays found in
+  i.MX6 SoCs.
Quoted 9 lines

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 20

Quoted 6 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +6 -0
+
+properties:
+  compatible:
+    enum:
+      - fsl,imx6sl-epdc
+      - fsl,imx6sll-epdc  

Not compatible with each other?

differences are detectable by EPDC_VERSION register, so probably so problem. NXP/Freescale kernel uses
fsl,imx6dl-epdc
and
fsl,imx7d-epdc (used also by imx6 devices with EPDC_VERSION = 3.0) in their drivers.

fsl,imx6dl-epdc
fsl,imx6sl-epdc
fsl,imx6sll-epdc
fsl,imx7d-epdc
in their dtsis.

But the general rule is to use as less as possible compatible strings if differences can be probed properly, so only one should be sufficient? Which one?

Regards,
Andreas

maintainer
#4 lore raw

Re: [RFC PATCH 1/6] dt-bindings: display: imx: Add EPDC

Quoted 75 lines · Andreas Kemnade

Hi Rob,

Quoted 7 lines · On Fri, 11 Feb 2022 09:46:27 -0600 Rob Herring <[email protected]> wrote:
Quoted 2 lines · Andreas Kemnade

Add a binding for the Electrophoretic Display Controller found at least in the i.MX6.

The first version was in i.MX50 (I helped design the register interface). Is that version compatible?

it has some differences, but that could be detected by EPDC_VERSION register. I do not own such a device, so I cannot fully check. I have not seen any driver with devicetree for IMX5. For now I am rejecting anything which has a EPDC version which I cannot check.

Quoted 36 lines
Quoted 36 lines

The timing subnode is directly here to avoid having display parameters spread all over the plate.

Supplies are organized the same way as in the fbdev driver in the NXP/Freescale kernel forks. The regulators used for that purpose, like the TPS65185, the SY7636A and MAX17135 have typically a single bit to start a bunch of regulators of higher or negative voltage with a well-defined timing. VCOM can be handled separately, but can also be incorporated into that single bit.

---
 .../bindings/display/imx/fsl,mxc-epdc.yaml    | 159 ++++++++++++++++++
 1 file changed, 159 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +14 -0
new file mode 100644
index 000000000000..7e0795cc3f70
@@ -0,0 +1,159 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/imx/fsl,mxc-epdc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX6 EPDC
+
+maintainers:
+  - Andreas Kemnade <[email protected]>
+
+description: |
+  The EPDC is a controller for handling electronic paper displays found in
+  i.MX6 SoCs.
Quoted 9 lines

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 20

Quoted 6 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +6 -0
+
+properties:
+  compatible:
+    enum:
+      - fsl,imx6sl-epdc
+      - fsl,imx6sll-epdc  

Not compatible with each other?

differences are detectable by EPDC_VERSION register, so probably so problem. NXP/Freescale kernel uses
fsl,imx6dl-epdc
and
fsl,imx7d-epdc (used also by imx6 devices with EPDC_VERSION = 3.0) in their drivers.

fsl,imx6dl-epdc
fsl,imx6sl-epdc
fsl,imx6sll-epdc
fsl,imx7d-epdc
in their dtsis.

Quoted 3 lines

But the general rule is to use as less as possible compatible strings if differences can be probed properly, so only one should be sufficient? Which one?

If you can probe all the differences, then just 'fsl,imx-epdc' is sufficient. Just document that so the next time around I don't forget and tell you it needs to be specific.

Rob

#5 lore raw

Re: [RFC PATCH 1/6] dt-bindings: display: imx: Add EPDC

In reply to Andreas Kemnade
Quoted 54 lines · Andreas Kemnade

Add a binding for the Electrophoretic Display Controller found at least in the i.MX6.
The timing subnode is directly here to avoid having display parameters spread all over the plate.

Supplies are organized the same way as in the fbdev driver in the NXP/Freescale kernel forks. The regulators used for that purpose, like the TPS65185, the SY7636A and MAX17135 have typically a single bit to start a bunch of regulators of higher or negative voltage with a well-defined timing. VCOM can be handled separately, but can also be incorporated into that single bit.

---
 .../bindings/display/imx/fsl,mxc-epdc.yaml    | 159 ++++++++++++++++++
 1 file changed, 159 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +30 -0
new file mode 100644
index 000000000000..7e0795cc3f70
@@ -0,0 +1,159 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/imx/fsl,mxc-epdc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX6 EPDC
+
+maintainers:
+  - Andreas Kemnade <[email protected]>
+
+description: |
+  The EPDC is a controller for handling electronic paper displays found in
+  i.MX6 SoCs.
+
+properties:
+  compatible:
+    enum:
+      - fsl,imx6sl-epdc
+      - fsl,imx6sll-epdc
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: Bus clock
+      - description: Pixel clock
+
+  clock-names:

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 40

Quoted 10 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +10 -0
+    items:
+      - const: axi
+      - const: pix
+
+  interrupts:
+    maxItems: 1
+
+  vscan-holdoff:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1

Except what Rob already said, all these are not arrays, so maxItems is not appropriate. You can define minimum/maximum values instead.

Quoted 33 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +33 -0
+
+  sdoed-width:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  sdoed-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  sdoez-width:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  sdoez-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  gdclk-hp-offs:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  gdsp-offs:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  gdoe-offs:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  gdclk-offs:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 83

Quoted 10 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +10 -0
+  num-ce:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  timing:
+    $ref: /display/panel/panel-timing.yaml#
+
+  DISPLAY-supply:
+    description:
+      A couple of +/- voltages automatically powered on in a defintive order

Typo, definitive?

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 88

Quoted 5 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +5 -0
+
+  VCOM-supply:
+    description: compensation voltage
+
+  V3P3-supply:

All of supplies names - lowercase.

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 93

Quoted 5 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +5 -0
+    description: V3P3 supply
+
+  epd-thermal-zone:
+    description:
+      Zone to get temperature of the EPD from, practically ambient temperature.

Is it a phandle?

Quoted 18 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +18 -0
+
+
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+  - vscan-holdoff
+  - sdoed-width
+  - sdoed-delay
+  - sdoez-width
+  - sdoez-delay
+  - gdclk-hp-offs
+  - gdsp-offs
+  - gdoe-offs
+  - gdclk-offs

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 121

Quoted 10 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +10 -0
+  - num-ce
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx6sl-clock.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    epdc: epdc@20f4000 {

Generic node name, e.g. display-controller

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 124

Quoted 3 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +3 -0
+        compatible = "fsl,imx6sl-epdc";
+        reg = <0x020f4000 0x4000>;
+        interrupts = <0 97 IRQ_TYPE_LEVEL_HIGH>;

s/0/GIC_SPI/

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 127

Quoted 3 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +3 -0
+        clocks = <&clks IMX6SL_CLK_EPDC_AXI>, <&clks IMX6SL_CLK_EPDC_PIX>;
+        clock-names = "axi", "pix";
+

Best regards,
Krzysztof

#6 lore raw

Re: [RFC PATCH 1/6] dt-bindings: display: imx: Add EPDC

Quoted 19 lines · On Thu, 17 Feb 2022 10:21:15 +0100 Krzysztof Kozlowski…
Quoted 18 lines · Andreas Kemnade

Add a binding for the Electrophoretic Display Controller found at least in the i.MX6.
The timing subnode is directly here to avoid having display parameters spread all over the plate.

Supplies are organized the same way as in the fbdev driver in the NXP/Freescale kernel forks. The regulators used for that purpose, like the TPS65185, the SY7636A and MAX17135 have typically a single bit to start a bunch of regulators of higher or negative voltage with a well-defined timing. VCOM can be handled separately, but can also be incorporated into that single bit.

---
 .../bindings/display/imx/fsl,mxc-epdc.yaml    | 159 ++++++++++++++++++
 1 file changed, 159 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml

[..]

Quoted 7 lines

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 83

Quoted 4 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +4 -0
+
+  DISPLAY-supply:
+    description:
+      A couple of +/- voltages automatically powered on in a defintive order  

Typo, definitive?

yes, of course.

Quoted 8 lines

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 88

Quoted 5 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +5 -0
+
+  VCOM-supply:
+    description: compensation voltage
+
+  V3P3-supply:  

All of supplies names - lowercase.

Quoted 8 lines

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 93

Quoted 5 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +5 -0
+    description: V3P3 supply
+
+  epd-thermal-zone:
+    description:
+      Zone to get temperature of the EPD from, practically ambient temperature.  

Is it a phandle?

a string used in

       of_property_read_string(priv->drm.dev->of_node,
                                "epd-thermal-zone", &thermal);
        if (thermal) {
                priv->thermal = thermal_zone_get_zone_by_name(thermal);
                if (IS_ERR(priv->thermal))
                        return dev_err_probe(priv->drm.dev, PTR_ERR(priv->thermal),
                                             "unable to get thermal");
        }

[...]

Quoted 9 lines

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 121

Quoted 6 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +6 -0
+examples:
+  - |
+    #include <dt-bindings/clock/imx6sl-clock.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    epdc: epdc@20f4000 {  

Generic node name, e.g. display-controller

hmm, does IHMO not make too much sense here. E.g. in the imx6sll.dtsi we have lcd-controller next to it. So having epd-controller? But that is exactly what epdc stands for.

Regards,
Andreas

#7 lore raw

Re: [RFC PATCH 1/6] dt-bindings: display: imx: Add EPDC

Quoted 50 lines · Andreas Kemnade
Quoted 19 lines · On Thu, 17 Feb 2022 10:21:15 +0100 Krzysztof Kozlowski…
Quoted 18 lines · Andreas Kemnade

Add a binding for the Electrophoretic Display Controller found at least in the i.MX6.
The timing subnode is directly here to avoid having display parameters spread all over the plate.

Supplies are organized the same way as in the fbdev driver in the NXP/Freescale kernel forks. The regulators used for that purpose, like the TPS65185, the SY7636A and MAX17135 have typically a single bit to start a bunch of regulators of higher or negative voltage with a well-defined timing. VCOM can be handled separately, but can also be incorporated into that single bit.

---
 .../bindings/display/imx/fsl,mxc-epdc.yaml    | 159 ++++++++++++++++++
 1 file changed, 159 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml

[..]

Quoted 7 lines

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 83

Quoted 4 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +4 -0
+
+  DISPLAY-supply:
+    description:
+      A couple of +/- voltages automatically powered on in a defintive order  

Typo, definitive?

yes, of course.

Quoted 8 lines

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 88

Quoted 5 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +5 -0
+
+  VCOM-supply:
+    description: compensation voltage
+
+  V3P3-supply:  

All of supplies names - lowercase.

Quoted 8 lines

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 93

Quoted 5 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +5 -0
+    description: V3P3 supply
+
+  epd-thermal-zone:
+    description:
+      Zone to get temperature of the EPD from, practically ambient temperature.  

Is it a phandle?

a string used in

Quoted 8 lines
       of_property_read_string(priv->drm.dev->of_node,
                                "epd-thermal-zone", &thermal);
        if (thermal) {
                priv->thermal = thermal_zone_get_zone_by_name(thermal);
                if (IS_ERR(priv->thermal))
                        return dev_err_probe(priv->drm.dev, PTR_ERR(priv->thermal),
                                             "unable to get thermal");
        }

OK, then:
$ref: /schemas/types.yaml#/definitions/string

Quoted 11 lines

[...]

Quoted 9 lines

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 121

Quoted 6 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +6 -0
+examples:
+  - |
+    #include <dt-bindings/clock/imx6sl-clock.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    epdc: epdc@20f4000 {  

Generic node name, e.g. display-controller

Quoted 3 lines

hmm, does IHMO not make too much sense here. E.g. in the imx6sll.dtsi we have lcd-controller next to it. So having epd-controller? But that is exactly what epdc stands for.

Still we have "lcd-controller", not "lcdc". Since this is only for epd, then "epd-controller" seems reasonable. The same as we use "interrupt-controller" (not "ic"), "dma-controller" (not "dmac" or "dc") and so on. See also list of recommended generic names from DT specification.

Best regards,
Krzysztof

#8 lore raw

Re: [RFC PATCH 1/6] dt-bindings: display: imx: Add EPDC

In reply to Andreas Kemnade

Hello Andreas,

Sorry for the delay, I finally got around to having a look at the patchset.

Some comments from skimming the patches below, and in my other replies.

Quoted 27 lines · Andreas Kemnade

Add a binding for the Electrophoretic Display Controller found at least in the i.MX6.
The timing subnode is directly here to avoid having display parameters spread all over the plate.

Supplies are organized the same way as in the fbdev driver in the NXP/Freescale kernel forks. The regulators used for that purpose, like the TPS65185, the SY7636A and MAX17135 have typically a single bit to start a bunch of regulators of higher or negative voltage with a well-defined timing. VCOM can be handled separately, but can also be incorporated into that single bit.

---
 .../bindings/display/imx/fsl,mxc-epdc.yaml    | 159 ++++++++++++++++++
 1 file changed, 159 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +3 -0
new file mode 100644
index 000000000000..7e0795cc3f70
@@ -0,0 +1,159 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---

[...]

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 112

Quoted 10 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +10 -0
+  - vscan-holdoff
+  - sdoed-width
+  - sdoed-delay
+  - sdoez-width
+  - sdoez-delay
+  - gdclk-hp-offs
+  - gdsp-offs
+  - gdoe-offs
+  - gdclk-offs
+  - num-ce

These parameters should perhaps have sane defaults in the driver, and be optional in the DT.

Quoted 9 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +9 -0
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx6sl-clock.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    epdc: epdc@20f4000 {

[...]

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 158

Quoted 13 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +13 -0
+
+        timing {
+                clock-frequency = <80000000>;
+                hactive = <1448>;
+                hback-porch = <16>;
+                hfront-porch = <102>;
+                hsync-len = <28>;
+                vactive = <1072>;
+                vback-porch = <4>;
+                vfront-porch = <4>;
+                vsync-len = <2>;
+        };
+    };

The way you did it here, the timing parameters are directly under the EPDC node in the DT, but I wonder if it would be better to have a separate node for the display panel, which can then provide the timing parameters either in the DT or in the panel driver (selected by compatible string of the panel).

Jonathan

#9 lore raw

Re: [RFC PATCH 1/6] dt-bindings: display: imx: Add EPDC

Quoted 48 lines · On Sat, 12 Mar 2022 20:23:48 +0100 Jonathan Neuschäfer <[email protected]>…

Hello Andreas,

Sorry for the delay, I finally got around to having a look at the patchset.

Some comments from skimming the patches below, and in my other replies.

Quoted 27 lines · Andreas Kemnade

Add a binding for the Electrophoretic Display Controller found at least in the i.MX6.
The timing subnode is directly here to avoid having display parameters spread all over the plate.

Supplies are organized the same way as in the fbdev driver in the NXP/Freescale kernel forks. The regulators used for that purpose, like the TPS65185, the SY7636A and MAX17135 have typically a single bit to start a bunch of regulators of higher or negative voltage with a well-defined timing. VCOM can be handled separately, but can also be incorporated into that single bit.

---
 .../bindings/display/imx/fsl,mxc-epdc.yaml    | 159 ++++++++++++++++++
 1 file changed, 159 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +3 -0
new file mode 100644
index 000000000000..7e0795cc3f70
@@ -0,0 +1,159 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---  

[...]

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 112

Quoted 10 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +10 -0
+  - vscan-holdoff
+  - sdoed-width
+  - sdoed-delay
+  - sdoez-width
+  - sdoez-delay
+  - gdclk-hp-offs
+  - gdsp-offs
+  - gdoe-offs
+  - gdclk-offs
+  - num-ce  
Quoted 3 lines

These parameters should perhaps have sane defaults in the driver, and be optional in the DT.

First of all I think I should document them better (as said in an earlier review mail)

I doubt there are sane defaults, in vendor kernels, there is typically a definition of these parameters and a video mode per display.

Quoted 25 lines
Quoted 10 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +9 -0
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx6sl-clock.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    epdc: epdc@20f4000 {  

[...]

Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml line 158

Quoted 13 lines
Documentation/devicetree/bindings/display/imx/fsl,mxc-epdc.yaml new file +13 -0
+
+        timing {
+                clock-frequency = <80000000>;
+                hactive = <1448>;
+                hback-porch = <16>;
+                hfront-porch = <102>;
+                hsync-len = <28>;
+                vactive = <1072>;
+                vback-porch = <4>;
+                vfront-porch = <4>;
+                vsync-len = <2>;
+        };
+    };  
Quoted 6 lines

The way you did it here, the timing parameters are directly under the EPDC node in the DT, but I wonder if it would be better to have a separate node for the display panel, which can then provide the timing parameters either in the DT or in the panel driver (selected by compatible string of the panel).

IMHO it makes sense to store these timing parameters together with the timing parameters from above. If that all somehow comes from a panel driver, we need to design an interface for it. So for simplicity I added the stuff just to the EPDC node.

Vendor kernel has this:

struct imx_epdc_fb_mode {
    struct fb_videomode *vmode;
    int vscan_holdoff;
    int sdoed_width;
    int sdoed_delay;
    int sdoez_width;
    int sdoez_delay;
    int gdclk_hp_offs;
    int gdsp_offs;
    int gdoe_offs;
    int gdclk_offs;
    int num_ce;
};

So things are basically combined here.

Regards,
Andreas

#10 lore raw

RFC PATCH 2/6 drm: Add skeleton for EPDC driver

In reply to Andreas Kemnade

This driver is for the EPD controller in the i.MX SoCs. Add a skeleton and basic things for the driver

---
 drivers/gpu/drm/Kconfig                 |   2 +
 drivers/gpu/drm/Makefile                |   1 +
 drivers/gpu/drm/mxc-epdc/Kconfig        |  15 +
 drivers/gpu/drm/mxc-epdc/Makefile       |   5 +
 drivers/gpu/drm/mxc-epdc/epdc_regs.h    | 442 ++++++++++++++++++++++++
 drivers/gpu/drm/mxc-epdc/mxc_epdc.h     |  20 ++
 drivers/gpu/drm/mxc-epdc/mxc_epdc_drv.c | 248 +++++++++++++
 7 files changed, 733 insertions(+)
 create mode 100644 drivers/gpu/drm/mxc-epdc/Kconfig
 create mode 100644 drivers/gpu/drm/mxc-epdc/Makefile
 create mode 100644 drivers/gpu/drm/mxc-epdc/epdc_regs.h
 create mode 100644 drivers/gpu/drm/mxc-epdc/mxc_epdc.h
 create mode 100644 drivers/gpu/drm/mxc-epdc/mxc_epdc_drv.c
drivers/gpu/drm/Kconfig +2 -0
index b1f22e457fd0..6b6b44ff7556 100644
@@ -390,6 +390,8 @@ source "drivers/gpu/drm/gud/Kconfig"
 
 source "drivers/gpu/drm/sprd/Kconfig"
 
+source "drivers/gpu/drm/mxc-epdc/Kconfig"
+
 config DRM_HYPERV
 	tristate "DRM Support for Hyper-V synthetic video device"
 	depends on DRM && PCI && MMU && HYPERV
drivers/gpu/drm/Makefile +1 -0
index 301a44dc18e3..e5eb9815cf9a 100644
@@ -131,6 +131,7 @@ obj-$(CONFIG_DRM_PANFROST) += panfrost/
 obj-$(CONFIG_DRM_ASPEED_GFX) += aspeed/
 obj-$(CONFIG_DRM_MCDE) += mcde/
 obj-$(CONFIG_DRM_TIDSS) += tidss/
+obj-$(CONFIG_DRM_MXC_EPDC) += mxc-epdc/
 obj-y			+= xlnx/
 obj-y			+= gud/
 obj-$(CONFIG_DRM_HYPERV) += hyperv/
drivers/gpu/drm/mxc-epdc/Kconfig new file +15 -0
new file mode 100644
index 000000000000..3f5744161cff
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: GPL-2.0
+config DRM_MXC_EPDC
+	tristate "i.MX EPD Controller"
+	depends on DRM && OF
+	depends on (COMPILE_TEST || ARCH_MXC)
+	select DRM_KMS_HELPER
+	select DRM_KMS_CMA_HELPER
+	select DMA_CMA if HAVE_DMA_CONTIGUOUS
+	select CMA if HAVE_DMA_CONTIGUOUS
+	help
+	  Choose this option if you have an i.MX system with an EPDC.
+	  It enables the usage of E-paper displays. A waveform is expected
+	  to be present in /lib/firmware/imx/epdc/epdc.fw
+
+	  If M is selected this module will be called mxc_epdc_drm.
drivers/gpu/drm/mxc-epdc/Makefile new file +5 -0
new file mode 100644
index 000000000000..a47ced72b7f6
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+mxc_epdc_drm-y := mxc_epdc_drv.o
+
+obj-$(CONFIG_DRM_MXC_EPDC) += mxc_epdc_drm.o
+
drivers/gpu/drm/mxc-epdc/epdc_regs.h new file +442 -0

442 lines not on this page · raw message

drivers/gpu/drm/mxc-epdc/mxc_epdc.h new file +20 -0
new file mode 100644
index 000000000000..c5f5280b574f
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (C) 2022 Andreas Kemnade */
+
+#include <video/display_timing.h>
+#include <video/of_display_timing.h>
+#include <video/videomode.h>
+
+#include <drm/drm_drv.h>
+#include <drm/drm_connector.h>
+#include <drm/drm_simple_kms_helper.h>
+
+struct clk;
+struct regulator;
+struct mxc_epdc {
+	struct drm_device drm;
+	struct drm_simple_display_pipe pipe;
+	struct drm_connector connector;
+	struct display_timing timing;
+};
+
drivers/gpu/drm/mxc-epdc/mxc_epdc_drv.c new file +248 -0

248 lines not on this page · raw message

Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#11 lore raw

Re: [RFC PATCH 2/6] drm: Add skeleton for EPDC driver

[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch]

Hi Andreas,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on drm/drm-next]
[also build test WARNING on robh/for-next v5.17-rc2 next-20220204] [cannot apply to pza/reset/next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Andreas-Kemnade/drm-EPDC-driver-for-i-MX6/20220206-162244
base:   git://anongit.freedesktop.org/drm/drm drm-next
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220206/202202061826.LPDjzpu4-lkp(a)intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.2.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/866c716aefa059db036e47d33b3002d59a6b7428
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Andreas-Kemnade/drm-EPDC-driver-for-i-MX6/20220206-162244
git checkout 866c716aefa059db036e47d33b3002d59a6b7428
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/gpu/drm/mxc-epdc/

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/mxc-epdc/mxc_epdc_drv.c:111:5: warning: no previous prototype for 'mxc_epdc_output' [-Wmissing-prototypes]

111 | int mxc_epdc_output(struct drm_device *drm)
| ^~~~~~~~~~~~~~~

vim +/mxc_epdc_output +111 drivers/gpu/drm/mxc-epdc/mxc_epdc_drv.c

110

 > 111	int mxc_epdc_output(struct drm_device *drm)

112 {
113 struct mxc_epdc *priv = to_mxc_epdc(drm);
114 int ret;
115
116 priv->connector.dpms = DRM_MODE_DPMS_OFF;
117 priv->connector.polled = 0;
118 drm_connector_helper_add(&priv->connector,
119 &mxc_epdc_connector_helper_funcs);
120 ret = drm_connector_init(drm, &priv->connector,
121 &mxc_epdc_connector_funcs,
122 DRM_MODE_CONNECTOR_Unknown);
123 if (ret)
124 return ret;
125 ret = of_get_display_timing(drm->dev->of_node, "timing", &priv->timing);
126 if (ret)
127 return ret;
128
129 return 0;
130 }
131

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#12 lore raw

Re: [RFC PATCH 2/6] drm: Add skeleton for EPDC driver

In reply to Andreas Kemnade
Quoted 24 lines · Andreas Kemnade

This driver is for the EPD controller in the i.MX SoCs. Add a skeleton and basic things for the driver

---
 drivers/gpu/drm/Kconfig                 |   2 +
 drivers/gpu/drm/Makefile                |   1 +
 drivers/gpu/drm/mxc-epdc/Kconfig        |  15 +
 drivers/gpu/drm/mxc-epdc/Makefile       |   5 +
 drivers/gpu/drm/mxc-epdc/epdc_regs.h    | 442 ++++++++++++++++++++++++
 drivers/gpu/drm/mxc-epdc/mxc_epdc.h     |  20 ++
 drivers/gpu/drm/mxc-epdc/mxc_epdc_drv.c | 248 +++++++++++++
 7 files changed, 733 insertions(+)
 create mode 100644 drivers/gpu/drm/mxc-epdc/Kconfig
 create mode 100644 drivers/gpu/drm/mxc-epdc/Makefile
 create mode 100644 drivers/gpu/drm/mxc-epdc/epdc_regs.h
 create mode 100644 drivers/gpu/drm/mxc-epdc/mxc_epdc.h
 create mode 100644 drivers/gpu/drm/mxc-epdc/mxc_epdc_drv.c
drivers/gpu/drm/Kconfig +0 -0
index b1f22e457fd0..6b6b44ff7556 100644

drivers/gpu/drm/Kconfig source "drivers/gpu/drm/gud/Kconfig" · line 393

Quoted 4 lines
drivers/gpu/drm/Kconfig +1 -0
@@ -390,6 +390,8 @@ source "drivers/gpu/drm/gud/Kconfig"
 
 source "drivers/gpu/drm/sprd/Kconfig"
 
+source "drivers/gpu/drm/mxc-epdc/Kconfig"

I'd put it under gpu/drm/imx/epdc, perhaps.

Quoted 9 lines
drivers/gpu/drm/Kconfig +9 -0
+int mxc_epdc_output(struct drm_device *drm)
+{
+	struct mxc_epdc *priv = to_mxc_epdc(drm);
+	int ret;
+
+	priv->connector.dpms = DRM_MODE_DPMS_OFF;
+	priv->connector.polled = 0;
+	drm_connector_helper_add(&priv->connector,
+				 &mxc_epdc_connector_helper_funcs);

drivers/gpu/drm/Kconfig source "drivers/gpu/drm/gud/Kconfig"

Quoted 10 lines
drivers/gpu/drm/Kconfig +10 -0
+	ret = drm_connector_init(drm, &priv->connector,
+				 &mxc_epdc_connector_funcs,
+				 DRM_MODE_CONNECTOR_Unknown);
+	if (ret)
+		return ret;
+	ret = of_get_display_timing(drm->dev->of_node, "timing", &priv->timing);
+	if (ret)
+		return ret;
+
+	return 0;

Possible to simplify to:

	return of_get_display_timing(drm->dev->of_node, "timing", &priv->timing);

Jonathan

#13 lore raw

RFC PATCH 3/6 drm: mxc-epdc: Add display and waveform initialisation

In reply to Andreas Kemnade

Adds display parameter initialisation, display power up/down and waveform loading

---
 drivers/gpu/drm/mxc-epdc/Makefile        |   2 +-
 drivers/gpu/drm/mxc-epdc/epdc_hw.c       | 495 +++++++++++++++++++++++
 drivers/gpu/drm/mxc-epdc/epdc_hw.h       |   8 +
 drivers/gpu/drm/mxc-epdc/epdc_waveform.c | 189 +++++++++
 drivers/gpu/drm/mxc-epdc/epdc_waveform.h |   7 +
 drivers/gpu/drm/mxc-epdc/mxc_epdc.h      |  81 ++++
 drivers/gpu/drm/mxc-epdc/mxc_epdc_drv.c  |  94 +++++
 7 files changed, 875 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/mxc-epdc/epdc_hw.c
 create mode 100644 drivers/gpu/drm/mxc-epdc/epdc_hw.h
 create mode 100644 drivers/gpu/drm/mxc-epdc/epdc_waveform.c
 create mode 100644 drivers/gpu/drm/mxc-epdc/epdc_waveform.h
drivers/gpu/drm/mxc-epdc/Makefile +1 -1
index a47ced72b7f6..0263ef2bf0db 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-mxc_epdc_drm-y := mxc_epdc_drv.o
+mxc_epdc_drm-y := mxc_epdc_drv.o epdc_hw.o epdc_waveform.o
 
 obj-$(CONFIG_DRM_MXC_EPDC) += mxc_epdc_drm.o
 
drivers/gpu/drm/mxc-epdc/epdc_hw.c new file +495 -0

495 lines not on this page · raw message

drivers/gpu/drm/mxc-epdc/epdc_hw.h new file +8 -0
new file mode 100644
index 000000000000..dbf1f0d1e23e
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (C) 2022 Andreas Kemnade */
+void mxc_epdc_init_sequence(struct mxc_epdc *priv, struct drm_display_mode *m);
+int mxc_epdc_init_hw(struct mxc_epdc *priv);
+
+void mxc_epdc_powerup(struct mxc_epdc *priv);
+void mxc_epdc_powerdown(struct mxc_epdc *priv);
+
drivers/gpu/drm/mxc-epdc/epdc_waveform.c new file +189 -0

189 lines not on this page · raw message

drivers/gpu/drm/mxc-epdc/epdc_waveform.h new file +7 -0
new file mode 100644
index 000000000000..c5c461b975cb
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (C) 2022 Andreas Kemnade */
+int mxc_epdc_fb_get_temp_index(struct mxc_epdc *priv, int temp);
+int mxc_epdc_prepare_waveform(struct mxc_epdc *priv,
+			      const u8 *waveform, size_t size);
+void mxc_epdc_set_update_waveform(struct mxc_epdc *priv,
+				  struct mxcfb_waveform_modes *wv_modes);
drivers/gpu/drm/mxc-epdc/mxc_epdc.h +81 -0

92 lines not on this page · raw message

drivers/gpu/drm/mxc-epdc/mxc_epdc_drv.c +94 -0

130 lines not on this page · raw message

Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#14 lore raw

Re: [RFC PATCH 3/6] drm: mxc-epdc: Add display and waveform initialisation

[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch]

Hi Andreas,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on drm/drm-next]
[also build test WARNING on robh/for-next v5.17-rc2 next-20220204] [cannot apply to pza/reset/next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Andreas-Kemnade/drm-EPDC-driver-for-i-MX6/20220206-162244
base:   git://anongit.freedesktop.org/drm/drm drm-next
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220206/202202061857.ZmlrNbez-lkp(a)intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.2.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/e5b9ffe09a0668f81e87931aee2281dc7340d40b
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Andreas-Kemnade/drm-EPDC-driver-for-i-MX6/20220206-162244
git checkout e5b9ffe09a0668f81e87931aee2281dc7340d40b
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/gpu/drm/mxc-epdc/

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/mxc-epdc/epdc_hw.c:174:6: warning: no previous prototype for 'epdc_init_settings' [-Wmissing-prototypes]
     174 | void epdc_init_settings(struct mxc_epdc *priv, struct drm_display_mode *m)
         |      ^~~~~~~~~~~~~~~~~~
--
>> drivers/gpu/drm/mxc-epdc/epdc_waveform.c:49:6: warning: no previous prototype for 'mxc_epdc_set_update_waveform' [-Wmissing-prototypes]
      49 | void mxc_epdc_set_update_waveform(struct mxc_epdc *priv,
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/mxc-epdc/epdc_waveform.c:77:5: warning: no previous prototype for 'mxc_epdc_fb_get_temp_index' [-Wmissing-prototypes]
      77 | int mxc_epdc_fb_get_temp_index(struct mxc_epdc *priv, int temp)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/mxc-epdc/epdc_waveform.c:132:5: warning: no previous prototype for 'mxc_epdc_prepare_waveform' [-Wmissing-prototypes]

132 | int mxc_epdc_prepare_waveform(struct mxc_epdc *priv,
| ^~~~~~~~~~~~~~~~~~~~~~~~~

vim +/epdc_init_settings +174 drivers/gpu/drm/mxc-epdc/epdc_hw.c

172
173

 > 174	void epdc_init_settings(struct mxc_epdc *priv, struct drm_display_mode *m)
   175	{
   176		u32 reg_val;
   177		int num_ce;
   178		int i;
   179	
   180		/* Enable clocks to access EPDC regs */
   181		clk_prepare_enable(priv->epdc_clk_axi);
   182		clk_prepare_enable(priv->epdc_clk_pix);
   183	
   184		/* Reset */
   185		epdc_write(priv, EPDC_CTRL_SET, EPDC_CTRL_SFTRST);
   186		while (!(epdc_read(priv, EPDC_CTRL) & EPDC_CTRL_CLKGATE))
   187			;
   188		epdc_write(priv, EPDC_CTRL_CLEAR, EPDC_CTRL_SFTRST);
   189	
   190		/* Enable clock gating (clear to enable) */
   191		epdc_write(priv, EPDC_CTRL_CLEAR, EPDC_CTRL_CLKGATE);
   192		while (epdc_read(priv, EPDC_CTRL) & (EPDC_CTRL_SFTRST | EPDC_CTRL_CLKGATE))
   193			;
   194	
   195		/* EPDC_CTRL */
   196		reg_val = epdc_read(priv, EPDC_CTRL);
   197		reg_val &= ~EPDC_CTRL_UPD_DATA_SWIZZLE_MASK;
   198		reg_val |= EPDC_CTRL_UPD_DATA_SWIZZLE_NO_SWAP;
   199		reg_val &= ~EPDC_CTRL_LUT_DATA_SWIZZLE_MASK;
   200		reg_val |= EPDC_CTRL_LUT_DATA_SWIZZLE_NO_SWAP;
   201		epdc_write(priv, EPDC_CTRL_SET, reg_val);
   202	
   203		/* EPDC_FORMAT - 2bit TFT and buf_pix_fmt Buf pixel format */
   204		reg_val = EPDC_FORMAT_TFT_PIXEL_FORMAT_2BIT
   205			| priv->buf_pix_fmt
   206		    | ((0x0 << EPDC_FORMAT_DEFAULT_TFT_PIXEL_OFFSET) &
   207		       EPDC_FORMAT_DEFAULT_TFT_PIXEL_MASK);
   208		epdc_write(priv, EPDC_FORMAT, reg_val);
   209		if (priv->rev >= 30) {
   210			if (priv->buf_pix_fmt == EPDC_FORMAT_BUF_PIXEL_FORMAT_P5N) {
   211				epdc_write(priv, EPDC_WB_FIELD2, 0xc554);
   212				epdc_write(priv, EPDC_WB_FIELD1, 0xa004);
   213			} else {
   214				epdc_write(priv, EPDC_WB_FIELD2, 0xc443);
   215				epdc_write(priv, EPDC_WB_FIELD1, 0xa003);
   216			}
   217		}
   218	
   219		/* EPDC_FIFOCTRL (disabled) */
   220		reg_val =
   221		    ((100 << EPDC_FIFOCTRL_FIFO_INIT_LEVEL_OFFSET) &
   222		     EPDC_FIFOCTRL_FIFO_INIT_LEVEL_MASK)
   223		    | ((200 << EPDC_FIFOCTRL_FIFO_H_LEVEL_OFFSET) &
   224		       EPDC_FIFOCTRL_FIFO_H_LEVEL_MASK)
   225		    | ((100 << EPDC_FIFOCTRL_FIFO_L_LEVEL_OFFSET) &
   226		       EPDC_FIFOCTRL_FIFO_L_LEVEL_MASK);
   227		epdc_write(priv, EPDC_FIFOCTRL, reg_val);
   228	
   229		/* EPDC_TEMP - Use default temp to get index */
   230		epdc_write(priv, EPDC_TEMP,
   231			   mxc_epdc_fb_get_temp_index(priv, TEMP_USE_AMBIENT));
   232	
   233		/* EPDC_RES */
   234		epdc_set_screen_res(priv, m->hdisplay, m->vdisplay);
   235	
   236		/* EPDC_AUTOWV_LUT */
   237		/* Initialize all auto-wavefrom look-up values to 2 - GC16 */
   238		for (i = 0; i < 8; i++)
   239			epdc_write(priv, EPDC_AUTOWV_LUT,
   240				(2 << EPDC_AUTOWV_LUT_DATA_OFFSET) |
   241				(i << EPDC_AUTOWV_LUT_ADDR_OFFSET));
   242	
   243		/*
   244		 * EPDC_TCE_CTRL
   245		 * VSCAN_HOLDOFF = 4
   246		 * VCOM_MODE = MANUAL
   247		 * VCOM_VAL = 0
   248		 * DDR_MODE = DISABLED
   249		 * LVDS_MODE_CE = DISABLED
   250		 * LVDS_MODE = DISABLED
   251		 * DUAL_SCAN = DISABLED
   252		 * SDDO_WIDTH = 8bit
   253		 * PIXELS_PER_SDCLK = 4
   254		 */
   255		reg_val =
   256		    ((priv->imx_mode.vscan_holdoff << EPDC_TCE_CTRL_VSCAN_HOLDOFF_OFFSET) &
   257		     EPDC_TCE_CTRL_VSCAN_HOLDOFF_MASK)
   258		    | EPDC_TCE_CTRL_PIXELS_PER_SDCLK_4;
   259		epdc_write(priv, EPDC_TCE_CTRL, reg_val);
   260	
   261		/* EPDC_TCE_HSCAN */
   262		epdc_set_horizontal_timing(priv, m->hsync_start - m->hdisplay,
   263					   m->htotal - m->hsync_end,
   264					   m->hsync_end - m->hsync_start,
   265					   m->hsync_end - m->hsync_start);

266
267 /* EPDC_TCE_VSCAN */
268 epdc_set_vertical_timing(priv, m->vsync_start - m->vdisplay,
269 m->vtotal - m->vsync_end,
270 m->vsync_end - m->vsync_start);
271
272 /* EPDC_TCE_OE */
273 reg_val =
274 ((priv->imx_mode.sdoed_width << EPDC_TCE_OE_SDOED_WIDTH_OFFSET) &
275 EPDC_TCE_OE_SDOED_WIDTH_MASK)
276 | ((priv->imx_mode.sdoed_delay << EPDC_TCE_OE_SDOED_DLY_OFFSET) &
277 EPDC_TCE_OE_SDOED_DLY_MASK)
278 | ((priv->imx_mode.sdoez_width << EPDC_TCE_OE_SDOEZ_WIDTH_OFFSET) &
279 EPDC_TCE_OE_SDOEZ_WIDTH_MASK)
280 | ((priv->imx_mode.sdoez_delay << EPDC_TCE_OE_SDOEZ_DLY_OFFSET) &
281 EPDC_TCE_OE_SDOEZ_DLY_MASK);
282 epdc_write(priv, EPDC_TCE_OE, reg_val);
283
284 /* EPDC_TCE_TIMING1 */
285 epdc_write(priv, EPDC_TCE_TIMING1, 0x0);
286
287 /* EPDC_TCE_TIMING2 */
288 reg_val =
289 ((priv->imx_mode.gdclk_hp_offs << EPDC_TCE_TIMING2_GDCLK_HP_OFFSET) &
290 EPDC_TCE_TIMING2_GDCLK_HP_MASK)
291 | ((priv->imx_mode.gdsp_offs << EPDC_TCE_TIMING2_GDSP_OFFSET_OFFSET) &
292 EPDC_TCE_TIMING2_GDSP_OFFSET_MASK);
293 epdc_write(priv, EPDC_TCE_TIMING2, reg_val);
294
295 /* EPDC_TCE_TIMING3 */
296 reg_val =
297 ((priv->imx_mode.gdoe_offs << EPDC_TCE_TIMING3_GDOE_OFFSET_OFFSET) &
298 EPDC_TCE_TIMING3_GDOE_OFFSET_MASK)
299 | ((priv->imx_mode.gdclk_offs << EPDC_TCE_TIMING3_GDCLK_OFFSET_OFFSET) &
300 EPDC_TCE_TIMING3_GDCLK_OFFSET_MASK);
301 epdc_write(priv, EPDC_TCE_TIMING3, reg_val);
302
303 /*
304 * EPDC_TCE_SDCFG
305 * SDCLK_HOLD = 1
306 * SDSHR = 1
307 * NUM_CE = 1
308 * SDDO_REFORMAT = FLIP_PIXELS
309 * SDDO_INVERT = DISABLED
310 * PIXELS_PER_CE = display horizontal resolution
311 */
312 num_ce = priv->imx_mode.num_ce;
313 if (num_ce == 0)
314 num_ce = 1;
315 reg_val = EPDC_TCE_SDCFG_SDCLK_HOLD | EPDC_TCE_SDCFG_SDSHR
316 | ((num_ce << EPDC_TCE_SDCFG_NUM_CE_OFFSET) &
317 EPDC_TCE_SDCFG_NUM_CE_MASK)
318 | EPDC_TCE_SDCFG_SDDO_REFORMAT_FLIP_PIXELS
319 | ((priv->epdc_mem_width/num_ce << EPDC_TCE_SDCFG_PIXELS_PER_CE_OFFSET) &
320 EPDC_TCE_SDCFG_PIXELS_PER_CE_MASK);
321 epdc_write(priv, EPDC_TCE_SDCFG, reg_val);
322
323 /*
324 * EPDC_TCE_GDCFG
325 * GDRL = 1
326 * GDOE_MODE = 0;
327 * GDSP_MODE = 0;
328 */
329 reg_val = EPDC_TCE_SDCFG_GDRL;
330 epdc_write(priv, EPDC_TCE_GDCFG, reg_val);
331
332 /*
333 * EPDC_TCE_POLARITY
334 * SDCE_POL = ACTIVE LOW
335 * SDLE_POL = ACTIVE HIGH
336 * SDOE_POL = ACTIVE HIGH
337 * GDOE_POL = ACTIVE HIGH
338 * GDSP_POL = ACTIVE LOW
339 */
340 reg_val = EPDC_TCE_POLARITY_SDLE_POL_ACTIVE_HIGH
341 | EPDC_TCE_POLARITY_SDOE_POL_ACTIVE_HIGH
342 | EPDC_TCE_POLARITY_GDOE_POL_ACTIVE_HIGH;
343 epdc_write(priv, EPDC_TCE_POLARITY, reg_val);
344
345 /* EPDC_IRQ_MASK */
346 epdc_write(priv, EPDC_IRQ_MASK, EPDC_IRQ_TCE_UNDERRUN_IRQ);
347
348 /*
349 * EPDC_GPIO
350 * PWRCOM = ?
351 * PWRCTRL = ?
352 * BDR = ?
353 */
354 reg_val = ((0 << EPDC_GPIO_PWRCTRL_OFFSET) & EPDC_GPIO_PWRCTRL_MASK)
355 | ((0 << EPDC_GPIO_BDR_OFFSET) & EPDC_GPIO_BDR_MASK);
356 epdc_write(priv, EPDC_GPIO, reg_val);
357
358 epdc_write(priv, EPDC_WVADDR, priv->waveform_buffer_phys);
359 epdc_write(priv, EPDC_WB_ADDR, priv->working_buffer_phys);
360 if (priv->rev >= 30)
361 epdc_write(priv, EPDC_WB_ADDR_TCE_V3,
362 priv->working_buffer_phys);
363 else
364 epdc_write(priv, EPDC_WB_ADDR_TCE,
365 priv->working_buffer_phys);
366
367 /* Disable clock */
368 clk_disable_unprepare(priv->epdc_clk_axi);
369 clk_disable_unprepare(priv->epdc_clk_pix);
370 }
371

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#15 lore raw

Re: [RFC PATCH 3/6] drm: mxc-epdc: Add display and waveform initialisation

In reply to Andreas Kemnade
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch]

Hi Andreas,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on drm/drm-next]
[also build test WARNING on robh/for-next v5.17-rc2 next-20220204] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Andreas-Kemnade/drm-EPDC-driver-for-i-MX6/20220206-162244
base:   git://anongit.freedesktop.org/drm/drm drm-next
config: ia64-allmodconfig (https://download.01.org/0day-ci/archive/20220206/202202061800.LKz4rHPK-lkp(a)intel.com/config)
compiler: ia64-linux-gcc (GCC) 11.2.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/e5b9ffe09a0668f81e87931aee2281dc7340d40b
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Andreas-Kemnade/drm-EPDC-driver-for-i-MX6/20220206-162244
git checkout e5b9ffe09a0668f81e87931aee2281dc7340d40b
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/gpu/drm/mxc-epdc/

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

drivers/gpu/drm/mxc-epdc/epdc_hw.c: In function 'mxc_epdc_powerup':

>> drivers/gpu/drm/mxc-epdc/epdc_hw.c:49:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      49 |         if (IS_ERR((void *)ret)) {
         |                    ^
   drivers/gpu/drm/mxc-epdc/epdc_hw.c:69:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      69 |         if (IS_ERR((void *)ret)) {
         |                    ^
   drivers/gpu/drm/mxc-epdc/epdc_hw.c:78:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      78 |         if (IS_ERR((void *)ret)) {
         |                    ^

drivers/gpu/drm/mxc-epdc/epdc_hw.c: At top level:
drivers/gpu/drm/mxc-epdc/epdc_hw.c:174:6: warning: no previous prototype for 'epdc_init_settings' [-Wmissing-prototypes]
174 | void epdc_init_settings(struct mxc_epdc *priv, struct drm_display_mode *m)
| ^~~~~~~~~~~~~~~~~~

vim +49 drivers/gpu/drm/mxc-epdc/epdc_hw.c

    24	
    25	void mxc_epdc_powerup(struct mxc_epdc *priv)
    26	{
    27		int ret = 0;
    28	
    29		mutex_lock(&priv->power_mutex);
    30	
    31		/*
    32		 * If power down request is pending, clear
    33		 * powering_down to cancel the request.
    34		 */
    35		if (priv->powering_down)
    36			priv->powering_down = false;
    37	
    38		if (priv->powered) {
    39			mutex_unlock(&priv->power_mutex);
    40			return;
    41		}
    42	
    43		dev_dbg(priv->drm.dev, "EPDC Powerup\n");
    44	
    45		priv->updates_active = true;
    46	
    47		/* Enable the v3p3 regulator */
    48		ret = regulator_enable(priv->v3p3_regulator);
  > 49		if (IS_ERR((void *)ret)) {
    50			dev_err(priv->drm.dev,
    51				"Unable to enable V3P3 regulator. err = 0x%x\n",
    52				ret);
    53			mutex_unlock(&priv->power_mutex);
    54			return;
    55		}
    56	
    57		usleep_range(1000, 2000);
    58	
    59		pm_runtime_get_sync(priv->drm.dev);
    60	
    61		/* Enable clocks to EPDC */
    62		clk_prepare_enable(priv->epdc_clk_axi);
    63		clk_prepare_enable(priv->epdc_clk_pix);
    64	
    65		epdc_write(priv, EPDC_CTRL_CLEAR, EPDC_CTRL_CLKGATE);
    66	
    67		/* Enable power to the EPD panel */
    68		ret = regulator_enable(priv->display_regulator);
    69		if (IS_ERR((void *)ret)) {
    70			dev_err(priv->drm.dev,
    71				"Unable to enable DISPLAY regulator. err = 0x%x\n",
    72				ret);
    73			mutex_unlock(&priv->power_mutex);
    74			return;
    75		}
    76	
    77		ret = regulator_enable(priv->vcom_regulator);
    78		if (IS_ERR((void *)ret)) {
    79			dev_err(priv->drm.dev,
    80				"Unable to enable VCOM regulator. err = 0x%x\n",
    81				ret);
    82			mutex_unlock(&priv->power_mutex);
    83			return;
    84		}
    85	
    86		priv->powered = true;
    87	
    88		mutex_unlock(&priv->power_mutex);
    89	}
    90	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#16 lore raw

Re: [RFC PATCH 3/6] drm: mxc-epdc: Add display and waveform initialisation

In reply to Andreas Kemnade
Quoted 5 lines · Andreas Kemnade

Adds display parameter initialisation, display power up/down and waveform loading

---

[...]

drivers/gpu/drm/mxc-epdc/epdc_hw.c line 49

Quoted 3 lines
drivers/gpu/drm/mxc-epdc/epdc_hw.c new file +3 -0
+	/* Enable the v3p3 regulator */
+	ret = regulator_enable(priv->v3p3_regulator);
+	if (IS_ERR((void *)ret)) {

if (ret < 0) is common enough to be understood.

Quoted 10 lines
drivers/gpu/drm/mxc-epdc/epdc_hw.c new file +10 -0
+		dev_err(priv->drm.dev,
+			"Unable to enable V3P3 regulator. err = 0x%x\n",
+			ret);
+		mutex_unlock(&priv->power_mutex);
+		return;
+	}
+
+	usleep_range(1000, 2000);
+
+	pm_runtime_get_sync(priv->drm.dev);

drivers/gpu/drm/mxc-epdc/epdc_hw.c line 69

Quoted 10 lines
drivers/gpu/drm/mxc-epdc/epdc_hw.c new file +10 -0
+
+	/* Enable clocks to EPDC */
+	clk_prepare_enable(priv->epdc_clk_axi);
+	clk_prepare_enable(priv->epdc_clk_pix);
+
+	epdc_write(priv, EPDC_CTRL_CLEAR, EPDC_CTRL_CLKGATE);
+
+	/* Enable power to the EPD panel */
+	ret = regulator_enable(priv->display_regulator);
+	if (IS_ERR((void *)ret)) {

dito

drivers/gpu/drm/mxc-epdc/epdc_hw.c line 78

Quoted 9 lines
drivers/gpu/drm/mxc-epdc/epdc_hw.c new file +9 -0
+		dev_err(priv->drm.dev,
+			"Unable to enable DISPLAY regulator. err = 0x%x\n",
+			ret);
+		mutex_unlock(&priv->power_mutex);
+		return;
+	}
+
+	ret = regulator_enable(priv->vcom_regulator);
+	if (IS_ERR((void *)ret)) {

dito

Quoted 11 lines
drivers/gpu/drm/mxc-epdc/epdc_hw.c new file +11 -0
+		dev_err(priv->drm.dev,
+			"Unable to enable VCOM regulator. err = 0x%x\n",
+			ret);
+		mutex_unlock(&priv->power_mutex);
+		return;
+	}
+
+	priv->powered = true;
+
+	mutex_unlock(&priv->power_mutex);
+}

[...]

drivers/gpu/drm/mxc-epdc/epdc_hw.c line 477

Quoted 4 lines
drivers/gpu/drm/mxc-epdc/epdc_hw.c new file +4 -0
+	priv->rev = ((val & EPDC_VERSION_MAJOR_MASK) >>
+				EPDC_VERSION_MAJOR_OFFSET) * 10
+			+ ((val & EPDC_VERSION_MINOR_MASK) >>
+				EPDC_VERSION_MINOR_OFFSET);

Instead of this transformation it might be (1) safer against unexpected versions and (2) simpler, to store the EPDC_VERSION register content directly.

Instead of

	if (priv->rev == 20) { ... }

we'd have

	if (priv->rev == 0x02000000) { ... }

or perhaps something along the lines of

	if (priv->rev == EPDC_REV(2, 0, 0)) { ... }

(using a macro that does the proper bitshifts).

Quoted 18 lines
drivers/gpu/drm/mxc-epdc/epdc_hw.c new file +18 -0
+	dev_dbg(priv->drm.dev, "EPDC version = %d\n", priv->rev);
+
+	if (priv->rev <= 20) {
+		dev_err(priv->drm.dev, "Unsupported version (%d)\n", priv->rev);
+		return -ENODEV;
+	}
+
+	/* Initialize EPDC pins */
+	pinctrl = devm_pinctrl_get_select_default(priv->drm.dev);
+	if (IS_ERR(pinctrl)) {
+		dev_err(priv->drm.dev, "can't get/select pinctrl\n");
+		return PTR_ERR(pinctrl);
+	}
+
+	mutex_init(&priv->power_mutex);
+
+	return 0;
+}

[...]

Quoted 18 lines
drivers/gpu/drm/mxc-epdc/epdc_waveform.h new file +7 -0
new file mode 100644
index 000000000000..c5c461b975cb
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (C) 2022 Andreas Kemnade */
+int mxc_epdc_fb_get_temp_index(struct mxc_epdc *priv, int temp);
+int mxc_epdc_prepare_waveform(struct mxc_epdc *priv,
+			      const u8 *waveform, size_t size);
+void mxc_epdc_set_update_waveform(struct mxc_epdc *priv,
+				  struct mxcfb_waveform_modes *wv_modes);
drivers/gpu/drm/mxc-epdc/mxc_epdc.h +0 -0
index c5f5280b574f..f7b1cbc4cc4e 100644

drivers/gpu/drm/mxc-epdc/mxc_epdc.h line 14

Quoted 7 lines
drivers/gpu/drm/mxc-epdc/mxc_epdc.h +4 -0
@@ -8,6 +8,32 @@
 #include <drm/drm_drv.h>
 #include <drm/drm_connector.h>
 #include <drm/drm_simple_kms_helper.h>
+#include <linux/thermal.h>
+#include "epdc_regs.h"
+
+#define TEMP_USE_AMBIENT			0x1000

What's the significance of 0x1000 here? Is it a register value?

Quoted 10 lines
drivers/gpu/drm/mxc-epdc/mxc_epdc.h +1 -0
 static void mxc_epdc_pipe_update(struct drm_simple_display_pipe *pipe,
@@ -187,6 +267,7 @@ static struct drm_driver mxc_epdc_driver = {
 static int mxc_epdc_probe(struct platform_device *pdev)
 {
 	struct mxc_epdc *priv;
+	const struct firmware *firmware;
 	int ret;
 
 	priv = devm_drm_dev_alloc(&pdev->dev, &mxc_epdc_driver, struct mxc_epdc, drm);

drivers/gpu/drm/mxc-epdc/mxc_epdc.h static int mxc_epdc_probe(struct platform_device *pdev) · line 283

Quoted 8 lines
drivers/gpu/drm/mxc-epdc/mxc_epdc.h +5 -0
@@ -195,6 +276,19 @@ static int mxc_epdc_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, priv);
 
+	ret = mxc_epdc_init_hw(priv);
+	if (ret)
+		return ret;
+
+	ret = request_firmware(&firmware, "imx/epdc/epdc.fw", priv->drm.dev);

Thinking ahead to the point when we'll have multiple waveforms for different modes... What's your idea for a naming scheme to distinguish the different waveform files, and should the default name be epdc.fw, or perhaps something more specific?

drivers/gpu/drm/mxc-epdc/mxc_epdc.h static int mxc_epdc_probe(struct platform_device *pdev) · line 294

Quoted 11 lines
drivers/gpu/drm/mxc-epdc/mxc_epdc.h +8 -0
+	if (ret)
+		return ret;
+
+	ret = mxc_epdc_prepare_waveform(priv, firmware->data, firmware->size);
+	release_firmware(firmware);
+	if (ret)
+		return ret;
+
 	mxc_epdc_setup_mode_config(&priv->drm);
 
 	ret = mxc_epdc_output(&priv->drm);

Jonathan

#17 lore raw

RFC PATCH 4/6 drm: mxc-epdc: Add update management

In reply to Andreas Kemnade

The EPDC can process some dirty rectangles at a time, pick them up and forward them to the controller. Only processes not involving PXP are supported at the moment. Due to that and to work with more waveforms, there is some masking/shifting done. It was tested with the factory waveforms of Kobo Clara HD, Tolino Shine 3, and Tolino Shine 2HD. Also the waveform called epdc_E060SCM.fw from NXP BSP works with the i.MX6SL devices.

---
 drivers/gpu/drm/mxc-epdc/Makefile       |    2 +-
 drivers/gpu/drm/mxc-epdc/epdc_hw.c      |    2 +
 drivers/gpu/drm/mxc-epdc/epdc_update.c  | 1210 +++++++++++++++++++++++
 drivers/gpu/drm/mxc-epdc/epdc_update.h  |    9 +
 drivers/gpu/drm/mxc-epdc/mxc_epdc.h     |   50 +
 drivers/gpu/drm/mxc-epdc/mxc_epdc_drv.c |   33 +-
 6 files changed, 1304 insertions(+), 2 deletions(-)
 create mode 100644 drivers/gpu/drm/mxc-epdc/epdc_update.c
 create mode 100644 drivers/gpu/drm/mxc-epdc/epdc_update.h
drivers/gpu/drm/mxc-epdc/Makefile +1 -1
index 0263ef2bf0db..a55e2bfe824a 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-mxc_epdc_drm-y := mxc_epdc_drv.o epdc_hw.o epdc_waveform.o
+mxc_epdc_drm-y := mxc_epdc_drv.o epdc_hw.o epdc_update.o epdc_waveform.o
 
 obj-$(CONFIG_DRM_MXC_EPDC) += mxc_epdc_drm.o
 
drivers/gpu/drm/mxc-epdc/epdc_hw.c +2 -0
index a74cbd237e0d..22a065ac6992 100644
@@ -20,6 +20,7 @@
 #include "mxc_epdc.h"
 #include "epdc_regs.h"
 #include "epdc_hw.h"
+#include "epdc_update.h"
 #include "epdc_waveform.h"
 
 void mxc_epdc_powerup(struct mxc_epdc *priv)
@@ -410,6 +411,7 @@ void mxc_epdc_init_sequence(struct mxc_epdc *priv, struct drm_display_mode *m)
 
 	priv->in_init = true;
 	mxc_epdc_powerup(priv);
+	mxc_epdc_draw_mode0(priv);
 	/* Force power down event */
 	priv->powering_down = true;
 	mxc_epdc_powerdown(priv);
drivers/gpu/drm/mxc-epdc/epdc_update.c new file +1210 -0

1,210 lines not on this page · raw message

drivers/gpu/drm/mxc-epdc/epdc_update.h new file +9 -0
new file mode 100644
index 000000000000..b6f30cf8eda7
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (C) 2020 Andreas Kemnade */
+int mxc_epdc_send_single_update(struct drm_rect *clip, int pitch,
+				void *vaddr,
+				struct mxc_epdc *priv);
+void mxc_epdc_draw_mode0(struct mxc_epdc *priv);
+int mxc_epdc_init_update(struct mxc_epdc *priv);
+void mxc_epdc_flush_updates(struct mxc_epdc *priv);
+
drivers/gpu/drm/mxc-epdc/mxc_epdc.h +50 -0

62 lines not on this page · raw message

drivers/gpu/drm/mxc-epdc/mxc_epdc_drv.c +32 -1
index 4810e5c5bc6e..a0bde06187ca 100644
@@ -12,6 +12,7 @@
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_damage_helper.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_fb_cma_helper.h>
 #include <drm/drm_fb_helper.h>
@@ -26,6 +27,7 @@
 #include <drm/drm_probe_helper.h>
 #include "mxc_epdc.h"
 #include "epdc_hw.h"
+#include "epdc_update.h"
 #include "epdc_waveform.h"
 
 #define DRIVER_NAME "mxc_epdc"
@@ -211,6 +213,7 @@ static void mxc_epdc_pipe_disable(struct drm_simple_display_pipe *pipe)
 	struct mxc_epdc *priv = drm_pipe_to_mxc_epdc(pipe);
 
 	dev_dbg(priv->drm.dev, "pipe disable\n");
+	mxc_epdc_flush_updates(priv);
 
 	if (priv->epdc_mem_virt) {
 		dma_free_wc(priv->drm.dev, priv->epdc_mem_width * priv->epdc_mem_height,
@@ -227,11 +230,35 @@ static void mxc_epdc_pipe_disable(struct drm_simple_display_pipe *pipe)
 }
 
 static void mxc_epdc_pipe_update(struct drm_simple_display_pipe *pipe,
-				   struct drm_plane_state *plane_state)
+				   struct drm_plane_state *old_state)
 {
 	struct mxc_epdc *priv = drm_pipe_to_mxc_epdc(pipe);
+	struct drm_gem_cma_object *gem;
+	struct drm_atomic_helper_damage_iter iter;
+	struct drm_rect clip;
+
 
 	dev_dbg(priv->drm.dev, "pipe update\n");
+	if (!old_state->fb) {
+		dev_dbg(priv->drm.dev, "no fb, nothing to update\n");
+		return;
+	}
+
+	if (priv->epdc_mem_virt == NULL)
+		return;
+
+	gem = drm_fb_cma_get_gem_obj(old_state->fb, 0);
+	drm_atomic_helper_damage_iter_init(&iter, old_state, pipe->plane.state);
+	drm_atomic_for_each_plane_damage(&iter, &clip) {
+
+		dev_dbg(priv->drm.dev, "damaged: %d,%d-%d,%d\n",
+			clip.x1, clip.y1, clip.x2, clip.y2);
+
+		mxc_epdc_send_single_update(&clip, old_state->fb->pitches[0],
+					    gem->vaddr, priv);
+	}
+
+	return;
 }
 
 static const struct drm_simple_display_pipe_funcs mxc_epdc_funcs = {
@@ -280,6 +307,10 @@ static int mxc_epdc_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
+	ret = mxc_epdc_init_update(priv);
+	if (ret)
+		return ret;
+
 	ret = request_firmware(&firmware, "imx/epdc/epdc.fw", priv->drm.dev);
 	if (ret)
 		return ret;
Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#18 lore raw

Re: [RFC PATCH 4/6] drm: mxc-epdc: Add update management

[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch]

Hi Andreas,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on drm/drm-next]
[also build test WARNING on robh/for-next v5.17-rc2 next-20220204] [cannot apply to pza/reset/next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Andreas-Kemnade/drm-EPDC-driver-for-i-MX6/20220206-162244
base:   git://anongit.freedesktop.org/drm/drm drm-next
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220206/202202061935.pxyST7Cb-lkp(a)intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.2.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/eb5c0a854ad92babcd34da63230029077f3e35a3
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Andreas-Kemnade/drm-EPDC-driver-for-i-MX6/20220206-162244
git checkout eb5c0a854ad92babcd34da63230029077f3e35a3
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/gpu/drm/mxc-epdc/

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

drivers/gpu/drm/mxc-epdc/epdc_update.c: In function 'epdc_submit_work_func':

>> drivers/gpu/drm/mxc-epdc/epdc_update.c:516:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
     516 |         int ret;
         |             ^~~
>> drivers/gpu/drm/mxc-epdc/epdc_update.c:515:18: warning: variable 'update_addr_virt' set but not used [-Wunused-but-set-variable]
     515 |         uint8_t *update_addr_virt;
         |                  ^~~~~~~~~~~~~~~~
   drivers/gpu/drm/mxc-epdc/epdc_update.c: At top level:
>> drivers/gpu/drm/mxc-epdc/epdc_update.c:739:6: warning: no previous prototype for 'mxc_epdc_flush_updates' [-Wmissing-prototypes]
     739 | void mxc_epdc_flush_updates(struct mxc_epdc *priv)
         |      ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/mxc-epdc/epdc_update.c:778:6: warning: no previous prototype for 'mxc_epdc_draw_mode0' [-Wmissing-prototypes]
     778 | void mxc_epdc_draw_mode0(struct mxc_epdc *priv)
         |      ^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/mxc-epdc/epdc_update.c: In function 'mxc_epdc_draw_mode0':
>> drivers/gpu/drm/mxc-epdc/epdc_update.c:780:14: warning: variable 'upd_buf_ptr' set but not used [-Wunused-but-set-variable]
     780 |         u32 *upd_buf_ptr;
         |              ^~~~~~~~~~~
   drivers/gpu/drm/mxc-epdc/epdc_update.c: At top level:
>> drivers/gpu/drm/mxc-epdc/epdc_update.c:814:5: warning: no previous prototype for 'mxc_epdc_send_single_update' [-Wmissing-prototypes]
     814 | int mxc_epdc_send_single_update(struct drm_rect *clip, int pitch, void *vaddr,
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/mxc-epdc/epdc_update.c: In function 'epdc_intr_work_func':
>> drivers/gpu/drm/mxc-epdc/epdc_update.c:884:45: warning: variable 'epdc_luts_avail' set but not used [-Wunused-but-set-variable]
     884 |         u32 epdc_luts_active, epdc_wb_busy, epdc_luts_avail, epdc_lut_cancelled;
         |                                             ^~~~~~~~~~~~~~~
>> drivers/gpu/drm/mxc-epdc/epdc_update.c:882:14: warning: variable 'wb_lut_done' set but not used [-Wunused-but-set-variable]
     882 |         bool wb_lut_done = false;
         |              ^~~~~~~~~~~
   drivers/gpu/drm/mxc-epdc/epdc_update.c: At top level:
>> drivers/gpu/drm/mxc-epdc/epdc_update.c:1134:5: warning: no previous prototype for 'mxc_epdc_init_update' [-Wmissing-prototypes]

1134 | int mxc_epdc_init_update(struct mxc_epdc *priv)
| ^~~~~~~~~~~~~~~~~~~~

vim +/ret +516 drivers/gpu/drm/mxc-epdc/epdc_update.c

501
502
503
504
505 static void epdc_submit_work_func(struct work_struct *work)
506 {
507 struct update_data_list *next_update, *temp_update;
508 struct update_desc_list *next_desc, *temp_desc;
509 struct mxc_epdc *priv =
510 container_of(work, struct mxc_epdc, epdc_submit_work);
511 struct update_data_list *upd_data_list = NULL;
512 struct drm_rect adj_update_region, *upd_region;
513 bool end_merge = false;
514 u32 update_addr;

 > 515		uint8_t *update_addr_virt;
 > 516		int ret;
   517	
   518		/* Protect access to buffer queues and to update HW */
   519		mutex_lock(&priv->queue_mutex);
   520	
   521		/*
   522		 * Are any of our collision updates able to go now?
   523		 * Go through all updates in the collision list and check to see
   524		 * if the collision mask has been fully cleared
   525		 */
   526		list_for_each_entry_safe(next_update, temp_update,
   527					&priv->upd_buf_collision_list, list) {
   528	
   529			if (next_update->collision_mask != 0)
   530				continue;
   531	
   532			dev_dbg(priv->drm.dev, "A collision update is ready to go!\n");
   533	
   534			/* Force waveform mode to auto for resubmitted collisions */
   535			next_update->update_desc->upd_data.waveform_mode =
   536				WAVEFORM_MODE_AUTO;
   537	
   538			/*
   539			 * We have a collision cleared, so select it for resubmission.
   540			 * If an update is already selected, attempt to merge.
   541			 */
   542			if (!upd_data_list) {
   543				upd_data_list = next_update;
   544				list_del_init(&next_update->list);
   545			} else {
   546				switch (epdc_submit_merge(upd_data_list->update_desc,
   547							  next_update->update_desc,
   548							  priv)) {
   549				case MERGE_OK:
   550					dev_dbg(priv->drm.dev,
   551						"Update merged [collision]\n");
   552					list_del_init(&next_update->update_desc->list);
   553					kfree(next_update->update_desc);
   554					next_update->update_desc = NULL;
   555					list_del_init(&next_update->list);
   556					/* Add to free buffer list */
   557					list_add_tail(&next_update->list,
   558						 &priv->upd_buf_free_list);
   559					break;
   560				case MERGE_FAIL:
   561					dev_dbg(priv->drm.dev,
   562						"Update not merged [collision]\n");
   563					break;
   564				case MERGE_BLOCK:
   565					dev_dbg(priv->drm.dev,
   566						"Merge blocked [collision]\n");
   567					end_merge = true;
   568					break;
   569				}
   570	
   571				if (end_merge) {
   572					end_merge = false;
   573					break;
   574				}
   575			}
   576		}
   577	
   578		/*
   579		 * If we didn't find a collision update ready to go, we
   580		 * need to get a free buffer and match it to a pending update.
   581		 */
   582	
   583		/*
   584		 * Can't proceed if there are no free buffers (and we don't
   585		 * already have a collision update selected)
   586		 */
   587		if (!upd_data_list &&
   588			list_empty(&priv->upd_buf_free_list)) {
   589			mutex_unlock(&priv->queue_mutex);
   590			return;
   591		}
   592	
   593		list_for_each_entry_safe(next_desc, temp_desc,
   594				&priv->upd_pending_list, list) {
   595	
   596			dev_dbg(priv->drm.dev, "Found a pending update!\n");
   597	
   598			if (!upd_data_list) {
   599				if (list_empty(&priv->upd_buf_free_list))
   600					break;
   601				upd_data_list =
   602					list_entry(priv->upd_buf_free_list.next,
   603						struct update_data_list, list);
   604				list_del_init(&upd_data_list->list);
   605				upd_data_list->update_desc = next_desc;
   606				list_del_init(&next_desc->list);
   607			} else {
   608				switch (epdc_submit_merge(upd_data_list->update_desc,
   609						next_desc, priv)) {
   610				case MERGE_OK:
   611					dev_dbg(priv->drm.dev,
   612						"Update merged [queue]\n");
   613					list_del_init(&next_desc->list);
   614					kfree(next_desc);
   615					break;
   616				case MERGE_FAIL:
   617					dev_dbg(priv->drm.dev,
   618						"Update not merged [queue]\n");
   619					break;
   620				case MERGE_BLOCK:
   621					dev_dbg(priv->drm.dev,
   622						"Merge blocked [collision]\n");
   623					end_merge = true;
   624					break;
   625				}
   626	
   627				if (end_merge)
   628					break;
   629			}
   630		}
   631	
   632		/* Is update list empty? */
   633		if (!upd_data_list) {
   634			mutex_unlock(&priv->queue_mutex);
   635			return;
   636		}
   637	
   638		if ((!priv->powered)
   639			|| priv->powering_down)
   640			mxc_epdc_powerup(priv);
   641	
   642		/*
   643		 * Set update buffer pointer to the start of
   644		 * the update region in the frame buffer.
   645		 */
   646		upd_region = &upd_data_list->update_desc->upd_data.update_region;
   647		update_addr = priv->epdc_mem_phys +
   648			((upd_region->y1 * priv->epdc_mem_width) +
   649			upd_region->x1);
   650		update_addr_virt = (u8 *)(priv->epdc_mem_virt) +
   651			((upd_region->y1 * priv->epdc_mem_width) +
   652			upd_region->x1);
   653	
   654		adj_update_region = upd_data_list->update_desc->upd_data.update_region;
   655		/*
   656		 * Is the working buffer idle?
   657		 * If the working buffer is busy, we must wait for the resource
   658		 * to become free. The IST will signal this event.
   659		 */
   660		if (priv->cur_update != NULL) {
   661			dev_dbg(priv->drm.dev, "working buf busy!\n");
   662	
   663			/* Initialize event signalling an update resource is free */
   664			init_completion(&priv->update_res_free);
   665	
   666			priv->waiting_for_wb = true;
   667	
   668			/* Leave spinlock while waiting for WB to complete */
   669			mutex_unlock(&priv->queue_mutex);
   670			wait_for_completion(&priv->update_res_free);
   671			mutex_lock(&priv->queue_mutex);
   672		}
   673	
   674		/*
   675		 * If there are no LUTs available,
   676		 * then we must wait for the resource to become free.
   677		 * The IST will signal this event.
   678		 */
   679		if (!epdc_any_luts_available(priv)) {
   680			dev_dbg(priv->drm.dev, "no luts available!\n");
   681	
   682			/* Initialize event signalling an update resource is free */
   683			init_completion(&priv->update_res_free);
   684	
   685			priv->waiting_for_lut = true;
   686	
   687			/* Leave spinlock while waiting for LUT to free up */
   688			mutex_unlock(&priv->queue_mutex);
   689			wait_for_completion(&priv->update_res_free);
   690			mutex_lock(&priv->queue_mutex);
   691		}
   692	
   693		ret = epdc_choose_next_lut(priv, &upd_data_list->lut_num);
   694	
   695		/* LUTs are available, so we get one here */
   696		priv->cur_update = upd_data_list;
   697	
   698		/* Reset mask for LUTS that have completed during WB processing */
   699		priv->luts_complete_wb = 0;
   700	
   701		/* Mark LUT with order */
   702		priv->lut_update_order[upd_data_list->lut_num] =
   703				upd_data_list->update_desc->update_order;
   704	
   705		epdc_lut_complete_intr(priv, upd_data_list->lut_num,
   706					       true);
   707	
   708		/* Enable Collision and WB complete IRQs */
   709		epdc_working_buf_intr(priv, true);
   710	
   711		epdc_write(priv, EPDC_TEMP,
   712			   mxc_epdc_fb_get_temp_index(priv, TEMP_USE_AMBIENT));
   713	
   714		/* Program EPDC update to process buffer */
   715	
   716		epdc_set_update_area(priv, update_addr,
   717				     adj_update_region.x1, adj_update_region.y1,
   718				     drm_rect_width(&adj_update_region),
   719				     drm_rect_height(&adj_update_region),
   720				     priv->epdc_mem_width);
   721	
   722		if (priv->wv_modes_update &&
   723			(upd_data_list->update_desc->upd_data.waveform_mode
   724				== WAVEFORM_MODE_AUTO)) {
   725			mxc_epdc_set_update_waveform(priv, &priv->wv_modes);
   726			priv->wv_modes_update = false;
   727		}
   728	
   729		epdc_submit_update(priv, upd_data_list->lut_num,
   730				   upd_data_list->update_desc->upd_data.waveform_mode,
   731				   upd_data_list->update_desc->upd_data.update_mode,
   732				   false,
   733				   false, 0);

734
735 /* Release buffer queues */
736 mutex_unlock(&priv->queue_mutex);
737 }
738

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#19 lore raw

Re: [RFC PATCH 4/6] drm: mxc-epdc: Add update management

In reply to Andreas Kemnade
Quoted 10 lines · Andreas Kemnade

The EPDC can process some dirty rectangles at a time, pick them up and forward them to the controller. Only processes not involving PXP are supported at the moment. Due to that and to work with more waveforms, there is some masking/shifting done. It was tested with the factory waveforms of Kobo Clara HD, Tolino Shine 3, and Tolino Shine 2HD. Also the waveform called epdc_E060SCM.fw from NXP BSP works with the i.MX6SL devices.

---

[...]

drivers/gpu/drm/mxc-epdc/epdc_update.c line 658

Quoted 5 lines
drivers/gpu/drm/mxc-epdc/epdc_update.c new file +5 -0
+	adj_update_region = upd_data_list->update_desc->upd_data.update_region;
+	/*
+	 * Is the working buffer idle?
+	 * If the working buffer is busy, we must wait for the resource
+	 * to become free. The IST will signal this event.

What does IST mean?

Quoted 1 line

+void mxc_epdc_draw_mode0(struct mxc_epdc *priv)

What does mode 0 imply? An overview of the possible modes would be appreciated.

Quoted 27 lines
drivers/gpu/drm/mxc-epdc/epdc_update.c new file +27 -0
+{
+	u32 *upd_buf_ptr;
+	int i;
+	u32 xres, yres;
+
+	upd_buf_ptr = (u32 *)priv->epdc_mem_virt;
+
+	epdc_working_buf_intr(priv, true);
+	epdc_lut_complete_intr(priv, 0, true);
+
+	/* Use unrotated (native) width/height */
+	xres = priv->epdc_mem_width;
+	yres = priv->epdc_mem_height;
+
+	/* Program EPDC update to process buffer */
+	epdc_set_update_area(priv, priv->epdc_mem_phys, 0, 0, xres, yres, 0);
+	epdc_submit_update(priv, 0, priv->wv_modes.mode_init, UPDATE_MODE_FULL,
+		false, true, 0xFF);
+
+	dev_dbg(priv->drm.dev, "Mode0 update - Waiting for LUT to complete...\n");
+
+	/* Will timeout after ~4-5 seconds */
+
+	for (i = 0; i < 40; i++) {
+		if (!epdc_is_lut_active(priv, 0)) {
+			dev_dbg(priv->drm.dev, "Mode0 init complete\n");
+			return;

drivers/gpu/drm/mxc-epdc/epdc_update.c

Quoted 10 lines
drivers/gpu/drm/mxc-epdc/epdc_update.c new file +9 -0
+		}
+		msleep(100);
+	}
+
+	dev_err(priv->drm.dev, "Mode0 init failed!\n");
+}
 
+#define WAVEFORM_MODE_GLR16			4
+#define WAVEFORM_MODE_GLD16			5
+#define WAVEFORM_MODE_AUTO			257

(How) are these mode numbers related to "mode 0"?

Jonathan

#20 lore raw

RFC PATCH 5/6 ARM: dts: imx6sll: add EPDC

In reply to Andreas Kemnade

The commercial variant has a controller for e-Paper displays.

---
 arch/arm/boot/dts/imx6sll.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm/boot/dts/imx6sll.dtsi +9 -0
index d4a000c3dde7..042e8a391b2f 100644
@@ -643,6 +643,15 @@ pxp: pxp@20f0000 {
 				clock-names = "axi";
 			};
 
+			epdc: epdc@20f4000 {
+				compatible = "fsl,imx6sll-epdc";
+				reg = <0x020f4000 0x4000>;
+				interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks IMX6SLL_CLK_EPDC_AXI>, <&clks IMX6SLL_CLK_EPDC_PIX>;
+				clock-names = "axi", "pix";
+				status = "disabled";
+			};
+
 			lcdif: lcd-controller@20f8000 {
 				compatible = "fsl,imx6sll-lcdif", "fsl,imx28-lcdif";
 				reg = <0x020f8000 0x4000>;
Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#21 lore raw

RFC PATCH 6/6 arm: dts: imx6sl: Add EPDC

In reply to Andreas Kemnade

Extend definition of EPDC.

---
 arch/arm/boot/dts/imx6sl.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/boot/dts/imx6sl.dtsi +3 -0
index c7d907c5c352..919e86e4fc74 100644
@@ -765,8 +765,11 @@ pxp: pxp@20f0000 {
 			};
 
 			epdc: epdc@20f4000 {
+				compatible = "fsl,imx6sl-epdc";
 				reg = <0x020f4000 0x4000>;
 				interrupts = <0 97 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clks IMX6SL_CLK_EPDC_AXI>, <&clks IMX6SL_CLK_EPDC_PIX>;
+				clock-names = "axi", "pix";
 			};
 
 			lcdif: lcdif@20f8000 {
Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel