Skip to contentSkip to conversation

Add support for DisplayPort driver on

PATCH Superseded Tanmay Shah 4 participants 15 messages Jun 12, 2020 – Jun 18, 2020

Subsystems (7)

v6 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
#0 lore raw

v6 cover Add support for DisplayPort driver on

These patches add support for Display-Port driver on SnapDragon hardware. It adds
DP driver and DP PLL driver files along with the needed device-tree bindings.

The block diagram of DP driver is shown below:

                 +-------------+
                 |DRM FRAMEWORK|
                 +------+------+
                        |
                   +----v----+
                   | DP DRM  |
                   +----+----+
                        |
                   +----v----+
     +------------+|   DP    +----------++------+
     +        +---+| DISPLAY |+---+      |      |
     |        +    +-+-----+-+    |      |      |
     |        |      |     |      |      |      |
     |        |      |     |      |      |      |
     |        |      |     |      |      |      |
     v        v      v     v      v      v      v
 +------+ +------+ +---+ +----+ +----+ +---+ +-----+
 |  DP  | |  DP  | |DP | | DP | | DP | |DP | | DP  |
 |PARSER| | HPD  | |AUX| |LINK| |CTRL| |PHY| |POWER|
 +--+---+ +---+--+ +---+ +----+ +--+-+ +-+-+ +-----+
    |                              |     |
 +--v---+                         +v-----v+
 |DEVICE|                         |  DP   |
 | TREE |                         |CATALOG|
 +------+                         +---+---+
                                      |
                                  +---v----+
                                  |CTRL/PHY|
                                  |   HW   |
                                  +--------+

These patches have dependency on clock driver changes mentioned below:
https://patchwork.kernel.org/patch/11245895/
https://patchwork.kernel.org/cover/11069083/

Chandan Uddaraju (4):
dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon
drm: add constant N value in helper file
drm/msm/dp: add displayPort driver support
drm/msm/dp: add support for DP PLL driver

Jeykumar Sankaran (1):
drm/msm/dpu: add display port support in DPU

 .../bindings/display/msm/dp-sc7180.yaml       |  142 ++
 .../devicetree/bindings/display/msm/dpu.txt   |    8 +
 drivers/gpu/drm/i915/display/intel_display.c  |    2 +-
 drivers/gpu/drm/msm/Kconfig                   |   21 +
 drivers/gpu/drm/msm/Makefile                  |   15 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c   |   29 +-
 .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c  |    8 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c       |   65 +-
 drivers/gpu/drm/msm/dp/dp_aux.c               |  530 +++++
 drivers/gpu/drm/msm/dp/dp_aux.h               |   35 +
 drivers/gpu/drm/msm/dp/dp_catalog.c           | 1025 ++++++++++
 drivers/gpu/drm/msm/dp/dp_catalog.h           |   86 +
 drivers/gpu/drm/msm/dp/dp_ctrl.c              | 1709 +++++++++++++++++
 drivers/gpu/drm/msm/dp/dp_ctrl.h              |   35 +
 drivers/gpu/drm/msm/dp/dp_display.c           |  912 +++++++++
 drivers/gpu/drm/msm/dp/dp_display.h           |   31 +
 drivers/gpu/drm/msm/dp/dp_drm.c               |  170 ++
 drivers/gpu/drm/msm/dp/dp_drm.h               |   18 +
 drivers/gpu/drm/msm/dp/dp_hpd.c               |   69 +
 drivers/gpu/drm/msm/dp/dp_hpd.h               |   79 +
 drivers/gpu/drm/msm/dp/dp_link.c              | 1216 ++++++++++++
 drivers/gpu/drm/msm/dp/dp_link.h              |  132 ++
 drivers/gpu/drm/msm/dp/dp_panel.c             |  490 +++++
 drivers/gpu/drm/msm/dp/dp_panel.h             |   95 +
 drivers/gpu/drm/msm/dp/dp_parser.c            |  390 ++++
 drivers/gpu/drm/msm/dp/dp_parser.h            |  204 ++
 drivers/gpu/drm/msm/dp/dp_pll.c               |   93 +
 drivers/gpu/drm/msm/dp/dp_pll.h               |   59 +
 drivers/gpu/drm/msm/dp/dp_pll_10nm.c          |  903 +++++++++
 drivers/gpu/drm/msm/dp/dp_pll_private.h       |  103 +
 drivers/gpu/drm/msm/dp/dp_power.c             |  422 ++++
 drivers/gpu/drm/msm/dp/dp_power.h             |  115 ++
 drivers/gpu/drm/msm/dp/dp_reg.h               |  505 +++++
 drivers/gpu/drm/msm/msm_drv.c                 |    2 +
 drivers/gpu/drm/msm/msm_drv.h                 |   53 +-
 include/drm/drm_dp_helper.h                   |    1 +
 36 files changed, 9753 insertions(+), 19 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml
 create mode 100644 drivers/gpu/drm/msm/dp/dp_aux.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_aux.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_display.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_display.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_drm.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_drm.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_hpd.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_hpd.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_link.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_link.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_panel.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_panel.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_parser.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_parser.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_pll.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_pll.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_pll_10nm.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_pll_private.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_power.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_power.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_reg.h

base-commit: 48f99181fc118d82dc8bf6c7221ad1c654cb8bc2

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw

PATCH v6 1/5 dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon

From: Chandan Uddaraju <[email protected]>

Add bindings for Snapdragon DisplayPort controller driver.

Changes in V2:
Provide details about sel-gpio

Changes in V4:
Provide details about max dp lanes
Change the commit text

Changes in V5:
moved dp.txt to yaml file

Changes in v6:
- Squash all AUX LUT properties into one pattern Property
- Make aux-cfg[0-9]-settings properties optional
- Remove PLL/PHY bindings from DP controller dts
- Add DP clocks description
- Remove _clk suffix from clock names
- Rename pixel clock to stream_pixel
- Remove redundant bindings (GPIO, PHY, HDCP clock, etc..)
- Fix indentation
- Add Display Port as interface of DPU in DPU bindings and add port mapping accordingly.

---
 .../bindings/display/msm/dp-sc7180.yaml       | 142 ++++++++++++++++++
 .../devicetree/bindings/display/msm/dpu.txt   |   8 +
 2 files changed, 150 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +142 -0
new file mode 100644
index 000000000000..5fdb9153df00
@@ -0,0 +1,142 @@
+# SPDX-License-Identifier: (GPL-2.0-only  OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/msm/dp-sc7180.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Display Port Controller.
+
+maintainers:
+  - Chandan Uddaraju <[email protected]>
+  - Vara Reddy <[email protected]>
+  - Tanmay Shah <[email protected]>
+
+description: |
+  Device tree bindings for MSM Display Port which supports DP host controllers
+  that are compatible with VESA Display Port interface specification.
+
+properties:
+  compatible:
+    items:
+      - const: qcom,dp-display
+
+  cell-index:
+    description: Specifies the controller instance.
+
+  reg:
+    items:
+      - description: DP controller registers
+
+  interrupts:
+    description: The interrupt signal from the DP block.
+
+  clocks:
+    description: List of clock specifiers for clocks needed by the device.
+    items:
+      - description: Display Port AUX clock
+      - description: Display Port Link clock
+      - description: Link interface clock between DP and PHY
+      - description: Display Port Pixel clock
+      - description: Root clock generator for pixel clock
+
+  clock-names:
+    description: |
+      Device clock names in the same order as mentioned in clocks property.
+      The required clocks are mentioned below.
+    items:
+      - const: core_aux
+      - const: ctrl_link
+      - const: ctrl_link_iface
+      - const: stream_pixel
+      - const: pixel_rcg
+  "#clock-cells":
+    const: 1
+
+  vdda-1p2-supply:
+    description: phandle to vdda 1.2V regulator node.
+
+  vdda-0p9-supply:
+    description: phandle to vdda 0.9V regulator node.
+
+  data-lanes = <0 1>:
+    type: object
+    description: Maximum number of lanes that can be used for Display port.
+
+  ports:
+    description: |
+       Contains display port controller endpoint subnode.
+       remote-endpoint: |
+         For port@0, set to phandle of the connected panel/bridge's
+         input endpoint. For port@1, set to the DPU interface output.
+         Documentation/devicetree/bindings/graph.txt and
+         Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+patternProperties:
+  "^aux-cfg([0-9])-settings$":
+    type: object
+    description: |
+      Specifies the DP AUX configuration [0-9] settings.
+      The first entry in this array corresponds to the register offset
+      within DP AUX, while the remaining entries indicate the
+      programmable values.
+
+required:
+  - compatible
+  - cell-index
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - vdda-1p2-supply
+  - vdda-0p9-supply
+  - data-lanes
+  - ports
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
+    #include <dt-bindings/clock/qcom,gcc-sdm845.h>
+    msm_dp: displayport-controller@ae90000{
+        compatible = "qcom,dp-display";
+        cell-index = <0>;
+        reg = <0 0xae90000 0 0x1400>;
+        reg-names = "dp_controller";
+
+        interrupt-parent = <&display_subsystem>;
+        interrupts = <12 0>;
+
+        clocks = <&dispcc DISP_CC_MDSS_DP_AUX_CLK>,
+                 <&dispcc DISP_CC_MDSS_DP_LINK_CLK>,
+                 <&dispcc DISP_CC_MDSS_DP_LINK_INTF_CLK>,
+                 <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK>,
+                 <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK_SRC>;
+        clock-names = "core_aux",
+                      "ctrl_link",
+                      "ctrl_link_iface", "stream_pixel",
+                      "pixel_rcg";
+        #clock-cells = <1>;
+
+        vdda-1p2-supply = <&vreg_l3c_1p2>;
+        vdda-0p9-supply = <&vreg_l4a_0p8>;
+
+        data-lanes = <0 1>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+                dp_in: endpoint {
+                    remote-endpoint = <&dpu_intf0_out>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                dp_out: endpoint {
+                };
+            };
+        };
+    };
Documentation/devicetree/bindings/display/msm/dpu.txt +8 -0
index 551ae26f60da..30c8ab479b02 100644
@@ -65,6 +65,7 @@ Required properties:
 
 	Port 0 -> DPU_INTF1 (DSI1)
 	Port 1 -> DPU_INTF2 (DSI2)
+	Port 2 -> DPU_INTF0 (DP)
 
 Optional properties:
 - assigned-clocks: list of clock specifiers for clocks needing rate assignment
@@ -136,6 +137,13 @@ Example:
 						remote-endpoint = <&dsi1_in>;
 					};
 				};
+
+				port@2 {
+					reg = <2>;
+					dpu_intf0_out: endpoint {
+						remote-endpoint = <&dp_in>;
+					};
+				};
 			};
 		};
 	};
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#2 lore raw

Re: [PATCH v6 1/5] dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon

Quoted 27 lines · Tanmay Shah

From: Chandan Uddaraju <[email protected]>

Add bindings for Snapdragon DisplayPort controller driver.

Changes in V2:
Provide details about sel-gpio

Changes in V4:
Provide details about max dp lanes
Change the commit text

Changes in V5:
moved dp.txt to yaml file

Changes in v6:
- Squash all AUX LUT properties into one pattern Property
- Make aux-cfg[0-9]-settings properties optional
- Remove PLL/PHY bindings from DP controller dts
- Add DP clocks description
- Remove _clk suffix from clock names
- Rename pixel clock to stream_pixel
- Remove redundant bindings (GPIO, PHY, HDCP clock, etc..)
- Fix indentation
- Add Display Port as interface of DPU in DPU bindings and add port mapping accordingly.

Quoted 8 lines
---
 .../bindings/display/msm/dp-sc7180.yaml       | 142 ++++++++++++++++++
 .../devicetree/bindings/display/msm/dpu.txt   |   8 +
 2 files changed, 150 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml

Is it too much to ask for Qualcomm to coordinate your work? I'm not going to do that for you. This conflicts with "[v4] dt-bindings: msm:
disp: add yaml schemas for DPU and DSI bindings".

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 1

Quoted 7 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +1 -0
new file mode 100644
index 000000000000..5fdb9153df00
@@ -0,0 +1,142 @@
+# SPDX-License-Identifier: (GPL-2.0-only  OR BSD-2-Clause)

Extra space.

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/msm/dp-sc7180.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Display Port Controller.
+
+maintainers:
+  - Chandan Uddaraju <[email protected]>
+  - Vara Reddy <[email protected]>

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 21

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+  - Tanmay Shah <[email protected]>
+
+description: |
+  Device tree bindings for MSM Display Port which supports DP host controllers
+  that are compatible with VESA Display Port interface specification.
+
+properties:
+  compatible:
+    items:
+      - const: qcom,dp-display

That's what the h/w reference manual calls this? It should be SoC specific.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 24

Quoted 3 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +3 -0
+
+  cell-index:
+    description: Specifies the controller instance.

Pretty sure I already said no to this.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 28

Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+
+  reg:
+    items:
+      - description: DP controller registers

Just: 'maxItems: 1'

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 31

Quoted 3 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +3 -0
+
+  interrupts:
+    description: The interrupt signal from the DP block.

How many?

The description is useless. That's every 'interrupts'.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 34

Quoted 3 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +3 -0
+
+  clocks:
+    description: List of clock specifiers for clocks needed by the device.

That's every 'clocks' property. Drop.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 45

Quoted 11 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +11 -0
+    items:
+      - description: Display Port AUX clock
+      - description: Display Port Link clock
+      - description: Link interface clock between DP and PHY
+      - description: Display Port Pixel clock
+      - description: Root clock generator for pixel clock
+
+  clock-names:
+    description: |
+      Device clock names in the same order as mentioned in clocks property.
+      The required clocks are mentioned below.

Drop.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 51

Quoted 6 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +6 -0
+    items:
+      - const: core_aux
+      - const: ctrl_link
+      - const: ctrl_link_iface
+      - const: stream_pixel
+      - const: pixel_rcg

blank line

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 61

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+  "#clock-cells":
+    const: 1
+
+  vdda-1p2-supply:
+    description: phandle to vdda 1.2V regulator node.
+
+  vdda-0p9-supply:
+    description: phandle to vdda 0.9V regulator node.
+
+  data-lanes = <0 1>:

Err, what?!

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 62

Quoted 1 line
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +1 -0
+    type: object

This is a DT node?

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 70

Quoted 8 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +8 -0
+    description: Maximum number of lanes that can be used for Display port.
+
+  ports:
+    description: |
+       Contains display port controller endpoint subnode.
+       remote-endpoint: |
+         For port@0, set to phandle of the connected panel/bridge's
+         input endpoint. For port@1, set to the DPU interface output.

Look at other schemas and see how they are done.

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 76

Quoted 6 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +6 -0
+         Documentation/devicetree/bindings/graph.txt and
+         Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+patternProperties:
+  "^aux-cfg([0-9])-settings$":
+    type: object

This is a DT node?

Quoted 7 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +7 -0
+    description: |
+      Specifies the DP AUX configuration [0-9] settings.
+      The first entry in this array corresponds to the register offset
+      within DP AUX, while the remaining entries indicate the
+      programmable values.
+
+required:

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 93

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+  - compatible
+  - cell-index
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - vdda-1p2-supply
+  - vdda-0p9-supply
+  - data-lanes
+  - ports

Add:
additionalProperties: false

Quoted 76 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +49 -0
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/qcom,dispcc-sdm845.h>
+    #include <dt-bindings/clock/qcom,gcc-sdm845.h>
+    msm_dp: displayport-controller@ae90000{
+        compatible = "qcom,dp-display";
+        cell-index = <0>;
+        reg = <0 0xae90000 0 0x1400>;
+        reg-names = "dp_controller";
+
+        interrupt-parent = <&display_subsystem>;
+        interrupts = <12 0>;
+
+        clocks = <&dispcc DISP_CC_MDSS_DP_AUX_CLK>,
+                 <&dispcc DISP_CC_MDSS_DP_LINK_CLK>,
+                 <&dispcc DISP_CC_MDSS_DP_LINK_INTF_CLK>,
+                 <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK>,
+                 <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK_SRC>;
+        clock-names = "core_aux",
+                      "ctrl_link",
+                      "ctrl_link_iface", "stream_pixel",
+                      "pixel_rcg";
+        #clock-cells = <1>;
+
+        vdda-1p2-supply = <&vreg_l3c_1p2>;
+        vdda-0p9-supply = <&vreg_l4a_0p8>;
+
+        data-lanes = <0 1>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+                dp_in: endpoint {
+                    remote-endpoint = <&dpu_intf0_out>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                dp_out: endpoint {
+                };
+            };
+        };
+    };
Documentation/devicetree/bindings/display/msm/dpu.txt +8 -1
index 551ae26f60da..30c8ab479b02 100644
@@ -65,6 +65,7 @@ Required properties:
 
        Port 0 -> DPU_INTF1 (DSI1)
        Port 1 -> DPU_INTF2 (DSI2)
+       Port 2 -> DPU_INTF0 (DP)
 
 Optional properties:
 - assigned-clocks: list of clock specifiers for clocks needing rate assignment
@@ -136,6 +137,13 @@ Example:
                                                remote-endpoint = <&dsi1_in>;
                                        };
                                };
+
+                               port@2 {
+                                       reg = <2>;
+                                       dpu_intf0_out: endpoint {
+                                               remote-endpoint = <&dp_in>;
+                                       };
+                               };
                        };
                };
        };
--
Quoted 3 lines

The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

Re: [PATCH v6 1/5] dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon

In reply to Tanmay Shah

Quoting Tanmay Shah (2020-06-11 18:50:26)

Quoted 12 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +6 -0
new file mode 100644
index 000000000000..5fdb9153df00
@@ -0,0 +1,142 @@
+        data-lanes = <0 1>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 16

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+            port@0 {
+                reg = <0>;
+                dp_in: endpoint {
+                    remote-endpoint = <&dpu_intf0_out>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                dp_out: endpoint {

Just curious what is eventually connected here? This is possibly a question for Rob Herring, but I can't figure out how we're supposed to connect this to the USB type-c connector that is receiving the DP signal. Does the type-c connector binding support connecting to this end of the graph? Or should this connect to the DP phy and then the phy connects to the USB type-c connector node? Right now it is empty which seems wrong.

Quoted 4 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +4 -0
+                };
+            };
+        };
+    };
#4 lore raw

Re: [PATCH v6 1/5] dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon

Quoted 25 lines · Stephen Boyd

Quoting Tanmay Shah (2020-06-11 18:50:26)

Quoted 12 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +6 -0
new file mode 100644
index 000000000000..5fdb9153df00
@@ -0,0 +1,142 @@
+        data-lanes = <0 1>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 16

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+            port@0 {
+                reg = <0>;
+                dp_in: endpoint {
+                    remote-endpoint = <&dpu_intf0_out>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                dp_out: endpoint {
Quoted 7 lines

Just curious what is eventually connected here? This is possibly a question for Rob Herring, but I can't figure out how we're supposed to connect this to the USB type-c connector that is receiving the DP signal. Does the type-c connector binding support connecting to this end of the graph? Or should this connect to the DP phy and then the phy connects to the USB type-c connector node? Right now it is empty which seems wrong.

It should connect to the Type-C connector perhaps thru some sort of switching/muxing node, but that's not really flushed out though. See 'dt-bindings: chrome: Add cros-ec-typec mux props' discussion with your CrOS colleagues.

Rob
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

Re: [PATCH v6 1/5] dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon

Quoting Rob Herring (2020-06-17 08:38:20)

Quoted 34 lines · Stephen Boyd
Quoted 25 lines

Quoting Tanmay Shah (2020-06-11 18:50:26)

Quoted 12 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +6 -0
new file mode 100644
index 000000000000..5fdb9153df00
@@ -0,0 +1,142 @@
+        data-lanes = <0 1>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+

Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml line 16

Quoted 10 lines
Documentation/devicetree/bindings/display/msm/dp-sc7180.yaml new file +10 -0
+            port@0 {
+                reg = <0>;
+                dp_in: endpoint {
+                    remote-endpoint = <&dpu_intf0_out>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                dp_out: endpoint {
Quoted 7 lines

Just curious what is eventually connected here? This is possibly a question for Rob Herring, but I can't figure out how we're supposed to connect this to the USB type-c connector that is receiving the DP signal. Does the type-c connector binding support connecting to this end of the graph? Or should this connect to the DP phy and then the phy connects to the USB type-c connector node? Right now it is empty which seems wrong.

Quoted 5 lines

It should connect to the Type-C connector perhaps thru some sort of switching/muxing node, but that's not really flushed out though. See 'dt-bindings: chrome: Add cros-ec-typec mux props' discussion with your CrOS colleagues.

Ok. I see that we have an sbu endpoint for an aux channel but not a DP endpoint in the type-c connector. I guess it's an alternate mode of the connector too so maybe that complicates things. I'll talk to pmalani. Thanks.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

PATCH v6 2/5 drm: add constant N value in helper file

In reply to Tanmay Shah

From: Chandan Uddaraju <[email protected]>

The constant N value (0x8000) is used by i915 DP driver. Define this value in dp helper header file to use in multiple Display Port drivers. Change i915 driver accordingly.

Change in v6: Change commit message

---
 drivers/gpu/drm/i915/display/intel_display.c | 2 +-
 include/drm/drm_dp_helper.h                  | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_display.c +1 -1
index 9ea1a397d1b5..4b2cfff5b761 100644
@@ -8085,7 +8085,7 @@ static void compute_m_n(unsigned int m, unsigned int n,
 	 * which the devices expect also in synchronous clock mode.
 	 */
 	if (constant_n)
-		*ret_n = 0x8000;
+		*ret_n = DP_LINK_CONSTANT_N_VALUE;
 	else
 		*ret_n = min_t(unsigned int, roundup_pow_of_two(n), DATA_LINK_N_MAX);
 
include/drm/drm_dp_helper.h +1 -0
index 2035ac44afde..589132ab9ab6 100644
@@ -1134,6 +1134,7 @@
 #define DP_MST_PHYSICAL_PORT_0 0
 #define DP_MST_LOGICAL_PORT_0 8
 
+#define DP_LINK_CONSTANT_N_VALUE 0x8000
 #define DP_LINK_STATUS_SIZE	   6
 bool drm_dp_channel_eq_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
 			  int lane_count);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#7 lore raw

PATCH v6 3/5 drm/msm/dp: add displayPort driver support

In reply to Tanmay Shah

From: Chandan Uddaraju <[email protected]>

Add the needed displayPort files to enable DP driver on msm target.

"dp_display" module is the main module that calls into other sub-modules. "dp_drm" file represents the interface between DRM framework and DP driver.

changes in v2:
-- Update copyright markings on all relevant files.
-- Change pr_err() to DRM_ERROR()
-- Use APIs directly instead of function pointers.
-- Use drm_display_mode structure to store link parameters. -- Use macros for register definitions instead of hardcoded values. -- Replace writel_relaxed/readl_relaxed with writel/readl
and remove memory barriers.
-- Remove unnecessary NULL checks.
-- Use drm helper functions for dpcd read/write.
-- Use DRM_DEBUG_DP for debug msgs.

changes in V3:
-- Removed changes in dpu_io_util.[ch]
-- Added locking around "is_connected" flag and removed atomic_set() -- Removed the argument validation checks in all the static functions
except initialization functions and few API across msm/dp files.
-- Removed hardcoded values for register reads/writes
-- Removed vreg related generic structures.
-- Added return values where ever necessary.
-- Updated dp_ctrl_on function.
-- Calling the ctrl specific catalog functions directly instead of
function pointers.
-- Added separate change that adds standard value in drm_dp_helper file. -- Added separate change in this list that is used to initialize DP. -- Added change to use drm_dp_get_adjust_request_voltage() function.

changes in V4:
-- Fix mvid, nvid calculation.
-- Shift video timings to align to bottom right. -- Fix register offsets for pixel_m and pixel_n. -- Fix TPG programming sequence.
-- Update DP ack override register to recommended value. -- Added code to log displayport registers.
-- Update aux setup with recommended settings. -- Fix TU calculations for all resolutions.
-- Limit linkrate to HBR2 until HBR3 support is added. -- Update DPCD read sequence.
-- Update code comments in dp_power_init() of V3. -- Remove extcon dependencies.
-- Move drm helper functions locally.

changes in V5:
-- Addressed comments from Jordan.

Changes in v6

-- Access DP as one big register region.
Access DP modules using offsets from one base address derived from dts.
-- Use default value of pixel clock instead of reading from dts. -- Add default value of AUX LUT settings, however, override
them if relative property is defined in dts.
-- Access data-lane property as an array instead of integer
using "data-lanes" name.
-- Remove redundant IO and pinctrl code.
-- Access clock names without _clk suffix
-- Rename pixel clock to stream_pixel
-- Use new API for edid quirks and use new constant name
DP_PHY_TEST_PATTERN.
-- Remove pll references from base driver change

---
 drivers/gpu/drm/msm/Kconfig                   |    8 +
 drivers/gpu/drm/msm/Makefile                  |   12 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c   |   21 +
 .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c  |    8 +
 drivers/gpu/drm/msm/dp/dp_aux.c               |  530 +++++
 drivers/gpu/drm/msm/dp/dp_aux.h               |   35 +
 drivers/gpu/drm/msm/dp/dp_catalog.c           |  999 ++++++++++
 drivers/gpu/drm/msm/dp/dp_catalog.h           |   86 +
 drivers/gpu/drm/msm/dp/dp_ctrl.c              | 1709 +++++++++++++++++
 drivers/gpu/drm/msm/dp/dp_ctrl.h              |   35 +
 drivers/gpu/drm/msm/dp/dp_display.c           |  897 +++++++++
 drivers/gpu/drm/msm/dp/dp_display.h           |   28 +
 drivers/gpu/drm/msm/dp/dp_drm.c               |  170 ++
 drivers/gpu/drm/msm/dp/dp_drm.h               |   18 +
 drivers/gpu/drm/msm/dp/dp_hpd.c               |   69 +
 drivers/gpu/drm/msm/dp/dp_hpd.h               |   79 +
 drivers/gpu/drm/msm/dp/dp_link.c              | 1216 ++++++++++++
 drivers/gpu/drm/msm/dp/dp_link.h              |  132 ++
 drivers/gpu/drm/msm/dp/dp_panel.c             |  490 +++++
 drivers/gpu/drm/msm/dp/dp_panel.h             |   95 +
 drivers/gpu/drm/msm/dp/dp_parser.c            |  417 ++++
 drivers/gpu/drm/msm/dp/dp_parser.h            |  207 ++
 drivers/gpu/drm/msm/dp/dp_power.c             |  412 ++++
 drivers/gpu/drm/msm/dp/dp_power.h             |   46 +
 drivers/gpu/drm/msm/dp/dp_reg.h               |  489 +++++
 drivers/gpu/drm/msm/msm_drv.c                 |    2 +
 drivers/gpu/drm/msm/msm_drv.h                 |   53 +-
 27 files changed, 8260 insertions(+), 3 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/dp/dp_aux.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_aux.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_catalog.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_ctrl.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_display.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_display.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_drm.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_drm.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_hpd.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_hpd.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_link.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_link.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_panel.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_panel.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_parser.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_parser.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_power.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_power.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_reg.h
drivers/gpu/drm/msm/Kconfig +8 -0
index 6deaa7d01654..ea3c4d094d09 100644
@@ -57,6 +57,14 @@ config DRM_MSM_HDMI_HDCP
 	help
 	  Choose this option to enable HDCP state machine
 
+config DRM_MSM_DP
+	bool "Enable DP support in MSM DRM driver"
+	depends on DRM_MSM
+	help
+	  Compile in support for DP driver in msm drm driver. DP external
+	  display support is enabled through this config option. It can
+	  be primary or secondary display on device.
+
 config DRM_MSM_DSI
 	bool "Enable DSI support in MSM DRM driver"
 	depends on DRM_MSM
drivers/gpu/drm/msm/Makefile +12 -0
index 42f8aae28b31..af868e791210 100644
@@ -2,6 +2,7 @@
 ccflags-y := -I $(srctree)/$(src)
 ccflags-y += -I $(srctree)/$(src)/disp/dpu1
 ccflags-$(CONFIG_DRM_MSM_DSI) += -I $(srctree)/$(src)/dsi
+ccflags-$(CONFIG_DRM_MSM_DP) += -I $(srctree)/$(src)/dp
 
 msm-y := \
 	adreno/adreno_device.o \
@@ -99,6 +100,17 @@ msm-$(CONFIG_DEBUG_FS) += adreno/a5xx_debugfs.o
 
 msm-$(CONFIG_DRM_MSM_GPU_STATE)	+= adreno/a6xx_gpu_state.o
 
+msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \
+	dp/dp_catalog.o \
+	dp/dp_ctrl.o \
+	dp/dp_display.o \
+	dp/dp_drm.o \
+	dp/dp_hpd.o \
+	dp/dp_link.o \
+	dp/dp_panel.o \
+	dp/dp_parser.o \
+	dp/dp_power.o
+
 msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
 msm-$(CONFIG_COMMON_CLK) += disp/mdp4/mdp4_lvds_pll.o
 msm-$(CONFIG_COMMON_CLK) += hdmi/hdmi_pll_8960.o
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +21 -0
index 63976dcd2ac8..d796710ff4aa 100644
@@ -988,6 +988,9 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc,
 
 	trace_dpu_enc_mode_set(DRMID(drm_enc));
 
+	if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS && priv->dp)
+		msm_dp_display_mode_set(priv->dp, drm_enc, mode, adj_mode);
+
 	list_for_each_entry(conn_iter, connector_list, head)
 		if (conn_iter->encoder == drm_enc)
 			conn = conn_iter;
@@ -1130,6 +1133,7 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
 {
 	struct dpu_encoder_virt *dpu_enc = NULL;
 	int ret = 0;
+	struct msm_drm_private *priv;
 	struct drm_display_mode *cur_mode = NULL;
 
 	if (!drm_enc) {
@@ -1140,6 +1144,7 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
 
 	mutex_lock(&dpu_enc->enc_lock);
 	cur_mode = &dpu_enc->base.crtc->state->adjusted_mode;
+	priv = drm_enc->dev->dev_private;
 
 	trace_dpu_enc_enable(DRMID(drm_enc), cur_mode->hdisplay,
 			     cur_mode->vdisplay);
@@ -1160,6 +1165,15 @@ static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
 
 	_dpu_encoder_virt_enable_helper(drm_enc);
 
+	if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS && priv->dp) {
+		ret = msm_dp_display_enable(priv->dp,
+						drm_enc);
+		if (ret) {
+			DPU_ERROR_ENC(dpu_enc, "dp display enable failed: %d\n",
+				ret);
+			goto out;
+		}
+	}
 	dpu_enc->enabled = true;
 
 out:
@@ -1192,6 +1206,13 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc)
 	dpu_kms = to_dpu_kms(priv->kms);
 	global_state = dpu_kms_get_existing_global_state(dpu_kms);
 
+	if (drm_enc->encoder_type == DRM_MODE_ENCODER_TMDS && priv->dp) {
+		if (msm_dp_display_disable(priv->dp, drm_enc)) {
+			DPU_ERROR_ENC(dpu_enc, "dp display disable failed\n");
+			return;
+		}
+	}
+
 	trace_dpu_enc_disable(DRMID(drm_enc));
 
 	/* wait for idle */
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +8 -0
index b5a49050d131..be11a0c5e60c 100644
@@ -100,6 +100,14 @@ static void drm_mode_to_intf_timing_params(
 	 * display_v_end -= mode->hsync_start - mode->hdisplay;
 	 * }
 	 */
+	/* for DP/EDP, Shift timings to align it to bottom right */
+	if ((phys_enc->hw_intf->cap->type == INTF_DP) ||
+		(phys_enc->hw_intf->cap->type == INTF_EDP)) {
+		timing->h_back_porch += timing->h_front_porch;
+		timing->h_front_porch = 0;
+		timing->v_back_porch += timing->v_front_porch;
+		timing->v_front_porch = 0;
+	}
 }
 
 static u32 get_horizontal_total(const struct intf_timing_params *timing)
drivers/gpu/drm/msm/dp/dp_aux.c new file +530 -0

530 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_aux.h new file +35 -0
new file mode 100644
index 000000000000..18f560b1d29a
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
+ */
+
+#ifndef _DP_AUX_H_
+#define _DP_AUX_H_
+
+#include "dp_catalog.h"
+#include <drm/drm_dp_helper.h>
+
+#define DP_AUX_ERR_NONE		0
+#define DP_AUX_ERR_ADDR		-1
+#define DP_AUX_ERR_TOUT		-2
+#define DP_AUX_ERR_NACK		-3
+#define DP_AUX_ERR_DEFER	-4
+#define DP_AUX_ERR_NACK_DEFER	-5
+
+struct dp_aux {
+	struct drm_dp_aux *drm_aux;
+	struct dp_aux_cfg *cfg;
+};
+
+int dp_aux_register(struct dp_aux *aux);
+void dp_aux_unregister(struct dp_aux *aux);
+void dp_aux_isr(struct dp_aux *aux);
+void dp_aux_init(struct dp_aux *aux, struct dp_aux_cfg *aux_cfg);
+void dp_aux_deinit(struct dp_aux *aux);
+void dp_aux_reconfig(struct dp_aux *aux);
+
+struct dp_aux *dp_aux_get(struct device *dev, struct dp_catalog *catalog,
+			  struct dp_aux_cfg *aux_cfg);
+void dp_aux_put(struct dp_aux *aux);
+
+#endif /*__DP_AUX_H_*/
drivers/gpu/drm/msm/dp/dp_catalog.c new file +999 -0

999 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_catalog.h new file +86 -0

86 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_ctrl.c new file +1709 -0

1,247 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_ctrl.h new file +35 -0
new file mode 100644
index 000000000000..63681e8203dc

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/msm/dp/dp_display.c new file +897 -0

897 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_display.h new file +28 -0
new file mode 100644
index 000000000000..dad8610685a6

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/msm/dp/dp_drm.c new file +170 -0

170 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_drm.h new file +18 -0
new file mode 100644
index 000000000000..c27bfceefdf0

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/msm/dp/dp_hpd.c new file +69 -0

69 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_hpd.h new file +79 -0

79 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_link.c new file +1216 -0

1,216 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_link.h new file +132 -0

132 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_panel.c new file +490 -0

490 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_panel.h new file +95 -0

95 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_parser.c new file +417 -0

417 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_parser.h new file +207 -0

207 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_power.c new file +412 -0

412 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_power.h new file +46 -0

46 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_reg.h new file +489 -0

489 lines not on this page · raw message

drivers/gpu/drm/msm/msm_drv.c +2 -0
index f6ce40bf3699..266de1d081eb 100644

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/msm/msm_drv.h +50 -3

53 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

Part of the diff is not shown here. View the raw message.

#8 lore raw

PATCH v6 4/5 drm/msm/dp: add support for DP PLL driver

In reply to Tanmay Shah

From: Chandan Uddaraju <[email protected]>

Add the needed DP PLL specific files to support
display port interface on msm targets.

The DP driver calls the DP PLL driver registration. The DP driver sets the link and pixel clock sources.

Changes in v2:
-- Update copyright markings on all relevant files. -- Use DRM_DEBUG_DP for debug msgs.

Changes in v4:
-- Update the DP link clock provider names

Changes in V5:
-- Addressed comments from Stephen Boyd, Rob clark.

Changes in V6:
-- Remove PLL as separate driver and include PLL as DP module -- Remove redundant clock parsing from PLL module and make DP as
clock provider
-- Map USB3 DPCOM and PHY IO using hardcoded register address and
move mapping form parser to PLL module
-- Access DP PHY modules from same base address using offsets instead of
deriving base address of individual module from device tree.
-- Remove dp_pll_10nm_util.c and include its functionality in
dp_pll_10nm.c
-- Introduce new data structures private to PLL module

---
 drivers/gpu/drm/msm/Kconfig             |  13 +
 drivers/gpu/drm/msm/Makefile            |   3 +
 drivers/gpu/drm/msm/dp/dp_catalog.c     |  64 +-
 drivers/gpu/drm/msm/dp/dp_display.c     |  17 +-
 drivers/gpu/drm/msm/dp/dp_display.h     |   3 +
 drivers/gpu/drm/msm/dp/dp_parser.c      |  51 +-
 drivers/gpu/drm/msm/dp/dp_parser.h      |   9 +-
 drivers/gpu/drm/msm/dp/dp_pll.c         |  93 +++
 drivers/gpu/drm/msm/dp/dp_pll.h         |  59 ++
 drivers/gpu/drm/msm/dp/dp_pll_10nm.c    | 903 ++++++++++++++++++++++++
 drivers/gpu/drm/msm/dp/dp_pll_private.h | 103 +++
 drivers/gpu/drm/msm/dp/dp_power.c       |  10 +
 drivers/gpu/drm/msm/dp/dp_power.h       |  71 +-
 drivers/gpu/drm/msm/dp/dp_reg.h         |  16 +
 14 files changed, 1349 insertions(+), 66 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/dp/dp_pll.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_pll.h
 create mode 100644 drivers/gpu/drm/msm/dp/dp_pll_10nm.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_pll_private.h
drivers/gpu/drm/msm/Kconfig +13 -0
index ea3c4d094d09..43544c18b4ee 100644
@@ -65,6 +65,19 @@ config DRM_MSM_DP
 	  display support is enabled through this config option. It can
 	  be primary or secondary display on device.
 
+config DRM_MSM_DP_PLL
+	bool "Enable DP PLL driver in MSM DRM"
+	depends on DRM_MSM_DP && COMMON_CLK
+	help
+	  Choose this option to enable DP PLL driver which provides DP
+	  source clocks under common clock framework.
+
+config DRM_MSM_DP_10NM_PLL
+	bool "Enable DP 10nm PLL driver in MSM DRM (used by SDM845)"
+	depends on DRM_MSM_DP_PLL
+	help
+	  Choose this option if DP PLL on SDM845 is used on the platform.
+
 config DRM_MSM_DSI
 	bool "Enable DSI support in MSM DRM driver"
 	depends on DRM_MSM
drivers/gpu/drm/msm/Makefile +3 -0
index af868e791210..af259c6a13da 100644
@@ -140,4 +140,7 @@ msm-$(CONFIG_DRM_MSM_DSI_14NM_PHY) += dsi/pll/dsi_pll_14nm.o
 msm-$(CONFIG_DRM_MSM_DSI_10NM_PHY) += dsi/pll/dsi_pll_10nm.o
 endif
 
+msm-$(CONFIG_DRM_MSM_DP_PLL)+= dp/dp_pll.o
+msm-$(CONFIG_DRM_MSM_DP_10NM_PLL)+= dp/dp_pll_10nm.o
+
 obj-$(CONFIG_DRM_MSM)	+= msm.o
drivers/gpu/drm/msm/dp/dp_catalog.c +45 -19

140 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_display.c +16 -1
index 58a3d86bc3f2..033d0e8246b0 100644
@@ -22,6 +22,7 @@
 #include "dp_ctrl.h"
 #include "dp_display.h"
 #include "dp_drm.h"
+#include "dp_pll.h"
 
 static struct msm_dp *g_dp_display;
 #define HPD_STRING_SIZE 30
@@ -42,6 +43,7 @@ struct dp_display_private {
 
 	struct dp_usbpd   *usbpd;
 	struct dp_parser  *parser;
+	struct msm_dp_pll *pll;
 	struct dp_power   *power;
 	struct dp_catalog *catalog;
 	struct dp_aux     *aux;
@@ -223,7 +225,6 @@ static int dp_display_process_hpd_high(struct dp_display_private *dp)
 	edid = dp->panel->edid;
 
 	dp->audio_supported = drm_detect_monitor_audio(edid);
-
 	dp_panel_handle_sink_request(dp->panel);
 
 	dp->dp_display.max_pclk_khz = DP_MAX_PIXEL_CLK_KHZ;
@@ -411,6 +412,9 @@ static int dp_init_sub_modules(struct dp_display_private *dp)
 	struct dp_panel_in panel_in = {
 		.dev = dev,
 	};
+	struct dp_pll_in pll_in = {
+		.pdev = dp->pdev,
+	};
 
 	/* Callback APIs used for cable status change event */
 	cb->configure  = dp_display_usbpd_configure_cb;
@@ -441,6 +445,17 @@ static int dp_init_sub_modules(struct dp_display_private *dp)
 		goto error;
 	}
 
+	pll_in.parser = dp->parser;
+	dp->pll = dp_pll_get(&pll_in);
+	if (IS_ERR_OR_NULL(dp->pll)) {
+		rc = -EINVAL;
+		DRM_ERROR("failed to initialize pll, rc = %d\n", rc);
+		dp->pll = NULL;
+		goto error;
+	}
+
+	dp->parser->pll = dp->pll;
+
 	dp->power = dp_power_get(dp->parser);
 	if (IS_ERR(dp->power)) {
 		rc = PTR_ERR(dp->power);
drivers/gpu/drm/msm/dp/dp_display.h +3 -0
index dad8610685a6..4c53ed55d1cc 100644
@@ -25,4 +25,7 @@ int dp_display_request_irq(struct msm_dp *dp_display);
 bool dp_display_check_video_test(struct msm_dp *dp_display);
 int dp_display_get_test_bpp(struct msm_dp *dp_display);
 
+void __init msm_dp_pll_driver_register(void);
+void __exit msm_dp_pll_driver_unregister(void);
+
 #endif /* _DP_DISPLAY_H_ */
drivers/gpu/drm/msm/dp/dp_parser.c +12 -39

84 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_parser.h +3 -6
index b99677f32469..dc24acf8bb86 100644
@@ -12,6 +12,7 @@
 
 #include "dpu_io_util.h"
 #include "msm_drv.h"
+#include "dp_pll.h"
 
 #define DP_LABEL "MDSS DP DISPLAY"
 #define AUX_CFG_LEN	10
@@ -64,17 +65,12 @@ struct dp_display_data {
  * @phy_io: phy's mapped memory address
  * @ln_tx0_io: USB-DP lane TX0's mapped memory address
  * @ln_tx1_io: USB-DP lane TX1's mapped memory address
- * @dp_cc_io: DP cc's mapped memory address
  * @dp_pll_io: DP PLL mapped memory address
  * @usb3_dp_com: USB3 DP PHY combo mapped memory address
  */
 struct dp_io {
 	struct dss_io_data dp_controller;
-	struct dss_io_data phy_io;
-	struct dss_io_data ln_tx0_io;
-	struct dss_io_data ln_tx1_io;
-	struct dss_io_data dp_cc_io;
-	struct dss_io_data dp_pll_io;
+	struct dss_io_data phy_reg;
 	struct dss_io_data usb3_dp_com;
 };
 
@@ -183,6 +179,7 @@ struct dp_parser {
 	struct dp_pinctrl pinctrl;
 	struct dp_io io;
 	struct dp_display_data disp_data;
+	struct msm_dp_pll *pll;
 	const struct dp_regulator_cfg *regulator_cfg;
 	u8 l_map[4];
 	struct dp_aux_cfg aux_cfg[AUX_CFG_LEN];
drivers/gpu/drm/msm/dp/dp_pll.c new file +93 -0

93 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_pll.h new file +59 -0

59 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_pll_10nm.c new file +903 -0

903 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_pll_private.h new file +103 -0

103 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_power.c +10 -0
index 19a1777a2374..427a4edcc1e9 100644
@@ -101,6 +101,16 @@ static int dp_power_clk_init(struct dp_power_private *power)
 	core = &power->parser->mp[DP_CORE_PM];
 	ctrl = &power->parser->mp[DP_CTRL_PM];
 
+	if (power->parser->pll && power->parser->pll->get_provider) {
+		rc = power->parser->pll->get_provider(power->parser->pll,
+			&power->link_provider, &power->pixel_provider);
+		if (rc) {
+			DRM_ERROR("%s:provider failed,don't set parent\n",
+								__func__);
+			return 0;
+		}
+	}
+
 	rc = msm_dss_get_clk(dev, core->clk_config, core->num_clk);
 	if (rc) {
 		DRM_ERROR("failed to get %s clk. err=%d\n",
drivers/gpu/drm/msm/dp/dp_power.h +70 -1

90 lines not on this page · raw message

drivers/gpu/drm/msm/dp/dp_reg.h +16 -0
index 28c16822bb73..ad6f1760f893 100644
@@ -6,6 +6,22 @@
 #ifndef _DP_REG_H_
 #define _DP_REG_H_
 
+/* DP PHY Register Regions */
+#define REG_DP_PHY_REGION_BASE			(0x088ea000)
+#define REG_DP_PHY_REGION_SIZE			(0x00000C00)
+
+#define REG_USB3_DP_COM_REGION_BASE		(0x088e8000)
+#define REG_USB3_DP_COM_REGION_SIZE		(0x00000020)
+
+#define DP_PHY_PLL_OFFSET			(0x00000000)
+#define DP_PHY_PLL_SIZE				(0x00000200)
+#define DP_PHY_REG_OFFSET			(0x00000A00)
+#define DP_PHY_REG_SIZE				(0x00000200)
+#define DP_PHY_LN_TX0_OFFSET			(0x00000200)
+#define DP_PHY_LN_TX0_SIZE			(0x00000200)
+#define DP_PHY_LN_TX1_OFFSET			(0x00000600)
+#define DP_PHY_LN_TX1_SIZE			(0x00000200)
+
 /* DP_TX Registers */
 #define REG_DP_HW_VERSION			(0x00000000)
 
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#9 lore raw

PATCH v6 5/5 drm/msm/dpu: add display port support in DPU

In reply to Tanmay Shah

From: Jeykumar Sankaran <[email protected]>

Add display port support in DPU by creating hooks
for DP encoder enumeration and encoder mode
initialization.

This change is based on the Snapdragon Display port driver changes[1].

changes in v2:
- rebase on [2] (Sean Paul)
- remove unwanted error checks and
switch cases (Jordan Crouse)

[1] https://lwn.net/Articles/768265/
[2] https://lkml.org/lkml/2018/11/17/87

changes in V3:
-- Moved this change as part of the DP driver changes. -- Addressed compilation issues on the latest code base.

Changes in v6:
-- Fix checkpatch.pl warning

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c |  8 +--
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c     | 65 +++++++++++++++++----
 2 files changed, 58 insertions(+), 15 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +4 -4
index d796710ff4aa..745d5ce7e821 100644
@@ -2017,7 +2017,7 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
 {
 	int ret = 0;
 	int i = 0;
-	enum dpu_intf_type intf_type;
+	enum dpu_intf_type intf_type = INTF_NONE;
 	struct dpu_enc_phys_init_params phys_params;
 
 	if (!dpu_enc) {
@@ -2039,9 +2039,9 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
 	case DRM_MODE_ENCODER_DSI:
 		intf_type = INTF_DSI;
 		break;
-	default:
-		DPU_ERROR_ENC(dpu_enc, "unsupported display interface type\n");
-		return -EINVAL;
+	case DRM_MODE_ENCODER_TMDS:
+		intf_type = INTF_DP;
+		break;
 	}
 
 	WARN_ON(disp_info->num_of_h_tiles < 1);
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +54 -11

85 lines not on this page · raw message

Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#10 lore raw
In reply to Tanmay Shah

Quoting Tanmay Shah (2020-06-11 18:50:25)

Quoted 30 lines

These patches add support for Display-Port driver on SnapDragon hardware. It adds
DP driver and DP PLL driver files along with the needed device-tree bindings.

The block diagram of DP driver is shown below:

                 +-------------+
                 |DRM FRAMEWORK|
                 +------+------+
                        |
                   +----v----+
                   | DP DRM  |
                   +----+----+
                        |
                   +----v----+
     +------------+|   DP    +----------++------+
     +        +---+| DISPLAY |+---+      |      |
     |        +    +-+-----+-+    |      |      |
     |        |      |     |      |      |      |
     |        |      |     |      |      |      |
     |        |      |     |      |      |      |
     v        v      v     v      v      v      v
 +------+ +------+ +---+ +----+ +----+ +---+ +-----+
 |  DP  | |  DP  | |DP | | DP | | DP | |DP | | DP  |
 |PARSER| | HPD  | |AUX| |LINK| |CTRL| |PHY| |POWER|
 +--+---+ +---+--+ +---+ +----+ +--+-+ +-+-+ +-----+
    |                              |     |
 +--v---+                         +v-----v+
Quoted 9 lines
 |DEVICE|                         |  DP   |
 | TREE |                         |CATALOG|
 +------+                         +---+---+
                                      |
                                  +---v----+
                                  |CTRL/PHY|
                                  |   HW   |
                                  +--------+

I've never seen a block diagram for a driver before...

Quoted 4 lines

These patches have dependency on clock driver changes mentioned below:
https://patchwork.kernel.org/patch/11245895/
https://patchwork.kernel.org/cover/11069083/

These are merged right? Don't need to include this if it's already merged.

Can you include a changelog in the cover letter too so we know what has changed between versions of the patchset?

Quoted 10 lines

Chandan Uddaraju (4):
dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon
drm: add constant N value in helper file
drm/msm/dp: add displayPort driver support
drm/msm/dp: add support for DP PLL driver

Jeykumar Sankaran (1):
drm/msm/dpu: add display port support in DPU

[...]

Quoted 3 lines

base-commit: 48f99181fc118d82dc8bf6c7221ad1c654cb8bc2

What is this commit? I don't see it in linux-next.

#11 lore raw

On 2020-06-12 16:26, Stephen Boyd wrote:

Thanks for reviews Stephen.

Quoted 41 lines

Quoting Tanmay Shah (2020-06-11 18:50:25)

Quoted 30 lines

These patches add support for Display-Port driver on SnapDragon hardware. It adds
DP driver and DP PLL driver files along with the needed device-tree bindings.

The block diagram of DP driver is shown below:

                 +-------------+
                 |DRM FRAMEWORK|
                 +------+------+
                        |
                   +----v----+
                   | DP DRM  |
                   +----+----+
                        |
                   +----v----+
     +------------+|   DP    +----------++------+
     +        +---+| DISPLAY |+---+      |      |
     |        +    +-+-----+-+    |      |      |
     |        |      |     |      |      |      |
     |        |      |     |      |      |      |
     |        |      |     |      |      |      |
     v        v      v     v      v      v      v
 +------+ +------+ +---+ +----+ +----+ +---+ +-----+
 |  DP  | |  DP  | |DP | | DP | | DP | |DP | | DP  |
 |PARSER| | HPD  | |AUX| |LINK| |CTRL| |PHY| |POWER|
 +--+---+ +---+--+ +---+ +----+ +--+-+ +-+-+ +-----+
    |                              |     |
 +--v---+                         +v-----v+
Quoted 9 lines
 |DEVICE|                         |  DP   |
 | TREE |                         |CATALOG|
 +------+                         +---+---+
                                      |
                                  +---v----+
                                  |CTRL/PHY|
                                  |   HW   |
                                  +--------+
Quoted 2 lines

I've never seen a block diagram for a driver before...

It is here for v5. https://patchwork.freedesktop.org/series/74312/

Quoted 8 lines
Quoted 4 lines

These patches have dependency on clock driver changes mentioned below:
https://patchwork.kernel.org/patch/11245895/
https://patchwork.kernel.org/cover/11069083/

These are merged right? Don't need to include this if it's already merged.

Ok Thanks.

Quoted 3 lines

Can you include a changelog in the cover letter too so we know what has changed between versions of the patchset?

Sure.

Quoted 10 lines
Quoted 10 lines

Chandan Uddaraju (4):
dt-bindings: msm/dp: add bindings of DP/DP-PLL driver for Snapdragon
drm: add constant N value in helper file
drm/msm/dp: add displayPort driver support
drm/msm/dp: add support for DP PLL driver

Jeykumar Sankaran (1):
drm/msm/dpu: add display port support in DPU

Quoted 6 lines

[...]

Quoted 3 lines

base-commit: 48f99181fc118d82dc8bf6c7221ad1c654cb8bc2

What is this commit? I don't see it in linux-next.

Here: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20200603&id=48f99181fc118d82dc8bf6c7221ad1c654cb8bc2
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw
Quoted 46 lines · On Mon, Jun 15, 2020 at 4:51 PM <[email protected]> wrote:

On 2020-06-12 16:26, Stephen Boyd wrote:

Thanks for reviews Stephen.

Quoted 41 lines

Quoting Tanmay Shah (2020-06-11 18:50:25)

Quoted 39 lines

These patches add support for Display-Port driver on SnapDragon hardware. It adds
DP driver and DP PLL driver files along with the needed device-tree bindings.

The block diagram of DP driver is shown below:

                 +-------------+
                 |DRM FRAMEWORK|
                 +------+------+
                        |
                   +----v----+
                   | DP DRM  |
                   +----+----+
                        |
                   +----v----+
     +------------+|   DP    +----------++------+
     +        +---+| DISPLAY |+---+      |      |
     |        +    +-+-----+-+    |      |      |
     |        |      |     |      |      |      |
     |        |      |     |      |      |      |
     |        |      |     |      |      |      |
     v        v      v     v      v      v      v
 +------+ +------+ +---+ +----+ +----+ +---+ +-----+
 |  DP  | |  DP  | |DP | | DP | | DP | |DP | | DP  |
 |PARSER| | HPD  | |AUX| |LINK| |CTRL| |PHY| |POWER|
 +--+---+ +---+--+ +---+ +----+ +--+-+ +-+-+ +-----+
    |                              |     |
 +--v---+                         +v-----v+
 |DEVICE|                         |  DP   |
 | TREE |                         |CATALOG|
 +------+                         +---+---+
                                      |
                                  +---v----+
                                  |CTRL/PHY|
                                  |   HW   |
                                  +--------+
Quoted 3 lines
Quoted 2 lines

I've never seen a block diagram for a driver before...

It is here for v5. https://patchwork.freedesktop.org/series/74312/

I think Stephen is nitpicking your wording, and you seem to not be understanding his comment. I'm sorry if I am mistaken.

The "DP driver" would seem to refer to the linux software driver you are proposing patches for, however this diagram looks like a hardware diagram of the various hardware blocks that the Linux driver code (the "DP driver") is expected to interact with. I believe you should re-word "The block diagram of DP driver is shown below:" to be more specific of what you are describing with your figure. IE your words say this is a block diagram of the software, when it looks like it is a block diagram of the hardware.

#13 lore raw
Quoted 54 lines · Jeffrey Hugo
Quoted 46 lines · On Mon, Jun 15, 2020 at 4:51 PM <[email protected]> wrote:

On 2020-06-12 16:26, Stephen Boyd wrote:

Thanks for reviews Stephen.

Quoted 41 lines

Quoting Tanmay Shah (2020-06-11 18:50:25)

Quoted 39 lines

These patches add support for Display-Port driver on SnapDragon hardware. It adds
DP driver and DP PLL driver files along with the needed device-tree bindings.

The block diagram of DP driver is shown below:

                 +-------------+
                 |DRM FRAMEWORK|
                 +------+------+
                        |
                   +----v----+
                   | DP DRM  |
                   +----+----+
                        |
                   +----v----+
     +------------+|   DP    +----------++------+
     +        +---+| DISPLAY |+---+      |      |
     |        +    +-+-----+-+    |      |      |
     |        |      |     |      |      |      |
     |        |      |     |      |      |      |
     |        |      |     |      |      |      |
     v        v      v     v      v      v      v
 +------+ +------+ +---+ +----+ +----+ +---+ +-----+
 |  DP  | |  DP  | |DP | | DP | | DP | |DP | | DP  |
 |PARSER| | HPD  | |AUX| |LINK| |CTRL| |PHY| |POWER|
 +--+---+ +---+--+ +---+ +----+ +--+-+ +-+-+ +-----+
    |                              |     |
 +--v---+                         +v-----v+
 |DEVICE|                         |  DP   |
 | TREE |                         |CATALOG|
 +------+                         +---+---+
                                      |
                                  +---v----+
                                  |CTRL/PHY|
                                  |   HW   |
                                  +--------+
Quoted 3 lines
Quoted 2 lines

I've never seen a block diagram for a driver before...

It is here for v5. https://patchwork.freedesktop.org/series/74312/

I think Stephen is nitpicking your wording, and you seem to not be understanding his comment. I'm sorry if I am mistaken.

Quoted 8 lines

The "DP driver" would seem to refer to the linux software driver you are proposing patches for, however this diagram looks like a hardware diagram of the various hardware blocks that the Linux driver code (the "DP driver") is expected to interact with. I believe you should re-word "The block diagram of DP driver is shown below:" to be more specific of what you are describing with your figure. IE your words say this is a block diagram of the software, when it looks like it is a block diagram of the hardware.

Thanks for reviews.

I am not sure what Stephen meant, but this diagram was available before.

Just for clarification this is not hardware diagram at all.
This is modeling of DP driver for msm.
Each box name above except "DRM framework", is file name in driver i.e. software module. Each line and arrow shows how modules interact with each other.

For example, "DP PARSER" Box is pointing towards "DEVICE TREE" Box, that means dp_parser.c file contains functions which are parsing device tree properties and so on...

#14 lore raw

Quoting [email protected] (2020-06-15 16:36:52)

Quoted 28 lines · Jeffrey Hugo
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

I've never seen a block diagram for a driver before...

It is here for v5. https://patchwork.freedesktop.org/series/74312/

I think Stephen is nitpicking your wording, and you seem to not be understanding his comment. I'm sorry if I am mistaken.

Quoted 8 lines

The "DP driver" would seem to refer to the linux software driver you are proposing patches for, however this diagram looks like a hardware diagram of the various hardware blocks that the Linux driver code (the "DP driver") is expected to interact with. I believe you should re-word "The block diagram of DP driver is shown below:" to be more specific of what you are describing with your figure. IE your words say this is a block diagram of the software, when it looks like it is a block diagram of the hardware.

Thanks for reviews.

I am not sure what Stephen meant, but this diagram was available before.

Just for clarification this is not hardware diagram at all. This is modeling of DP driver for msm.
Each box name above except "DRM framework", is file name in driver i.e. software module.
Each line and arrow shows how modules interact with each other.

Quoted 4 lines

For example, "DP PARSER" Box is pointing towards "DEVICE TREE" Box, that means
dp_parser.c file contains functions which are parsing device tree properties and so on...

Yes sorry for being obtuse. To be more direct I'll just say that needing to have a block diagram for a device driver is not a great start. Device drivers shouldn't be as complicated to need a block diagram to guide the reviewer. If we need them then we've failed to consolidate enough logic into the core device driver frameworks.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel