Skip to contentSkip to conversation

drm/cix: add Sky1 DisplayPort transmitter

PATCH In review Luo Liu 4 participants 9 messages Nov 9 – Nov 14

Subsystems (3)
lore
Share & tools
lore

Luo Liu

author
#0 lore raw

cover drm/cix: add Sky1 DisplayPort transmitter

Add the binding and the DRM bridge driver for the CIX Sky1 DisplayPort transmitter.

The devicetree nodes are left out of this series. They depend on the DisplayPort PHY binding and driver, which are not yet upstream. The SoC and board nodes will be sent once that PHY series is accepted.

Luo Liu (2):
dt-bindings: display: add CIX Sky1 DisplayPort transmitter drm/cix: add Sky1 DisplayPort transmitter driver

 .../bindings/display/cix,sky1-dptx.yaml       |  108 +
 MAINTAINERS                                   |    9 +
 drivers/gpu/drm/Kconfig                       |    1 +
 drivers/gpu/drm/Makefile                      |    1 +
 drivers/gpu/drm/cix/Kconfig                   |    3 +
 drivers/gpu/drm/cix/Makefile                  |    3 +
 drivers/gpu/drm/cix/dptx/Kconfig              |   16 +
 drivers/gpu/drm/cix/dptx/Makefile             |    4 +
 drivers/gpu/drm/cix/dptx/cix_dptx.c           | 2086 +++++++++++++++++
 drivers/gpu/drm/cix/dptx/cix_dptx.h           |  370 +++
 drivers/gpu/drm/cix/dptx/cix_dptx_drm.c       |  653 ++++++
 drivers/gpu/drm/cix/dptx/cix_dptx_drm.h       |   16 +
 12 files changed, 3270 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml
 create mode 100644 drivers/gpu/drm/cix/Kconfig
 create mode 100644 drivers/gpu/drm/cix/Makefile
 create mode 100644 drivers/gpu/drm/cix/dptx/Kconfig
 create mode 100644 drivers/gpu/drm/cix/dptx/Makefile
 create mode 100644 drivers/gpu/drm/cix/dptx/cix_dptx.c
 create mode 100644 drivers/gpu/drm/cix/dptx/cix_dptx.h
 create mode 100644 drivers/gpu/drm/cix/dptx/cix_dptx_drm.c
 create mode 100644 drivers/gpu/drm/cix/dptx/cix_dptx_drm.h

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4

Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 1/2 dt-bindings: display: add CIX Sky1 DisplayPort transmitter

Document the CIX Sky1 DisplayPort transmitter. Each instance sits between one of the SoC display pipelines and a DisplayPort PHY, and exposes the DP register block together with the RCSU block used for the link setup.

The controller is described as a DRM bridge whose video input is linked through the OF graph, and the DisplayPort PHY is referenced through the generic PHY framework. The RCSU adapter port, the video stream and the maximum link rate are described by "cix,adapter-port", "cix,stream-id" and "cix,dp-max-rate".

---
 .../bindings/display/cix,sky1-dptx.yaml       | 108 ++++++++++++++++++
 MAINTAINERS                                   |   8 ++
 2 files changed, 116 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml
Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml new file +108 -0
new file mode 100644
index 000000000000..9087b5edd9f0
@@ -0,0 +1,108 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/cix,sky1-dptx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: CIX Sky1 Trilinear DisplayPort Transmitter
+
+maintainers:
+  - Luo Liu <[email protected]>
+
+description:
+  DisplayPort transmitter controller based on the Trilinear DP IP on CIX Sky1.
+
+properties:
+  compatible:
+    const: cix,sky1-dptx
+
+  reg:
+    items:
+      - description: DisplayPort transmitter registers.
+      - description: RCSU video adapter registers used for link setup.
+
+  reg-names:
+    items:
+      - const: dp
+      - const: rcsu
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: APB clock of the controller.
+      - description: Video clock of stream 0.
+      - description: Video clock of stream 1.
+
+  clock-names:
+    items:
+      - const: apb
+      - const: vid0
+      - const: vid1
+
+  resets:
+    maxItems: 1
+    description: DisplayPort controller reset.
+
+  phys:
+    maxItems: 1
+    description: DisplayPort PHY the controller transmits through.
+
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+    description:
+      Video input from the display pipeline that drives this controller.
+
+  cix,adapter-port:
+    description:
+      RCSU video adapter port of this transmitter. Sky1 numbers its five
+      transmitters from 1 to 5. Port 3 is the native DP/eDP output.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 1
+    maximum: 5
+
+  cix,dp-max-rate:
+    description:
+      Maximum link rate the board is wired for, in units of 10 kbit/s.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [162000, 270000, 540000, 810000]
+    default: 810000
+
+  cix,stream-id:
+    description:
+      Index of the video stream this controller uses. Sky1 has two streams,
+      numbered 0 and 1.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 1
+    default: 0
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - interrupts
+  - clocks
+  - clock-names
+  - resets
+  - cix,adapter-port
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    dp0: dp@14064000 {
+        compatible = "cix,sky1-dptx";
+        reg = <0x14064000 0x4000>,
+              <0x14050000 0x400>;
+        reg-names = "dp", "rcsu";
+        interrupts = <GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&clk 0>, <&clk 1>, <&clk 2>;
+        clock-names = "apb", "vid0", "vid1";
+        resets = <&rst 0>;
+        cix,adapter-port = <1>;
+    };
MAINTAINERS +8 -0
index 93abbb315065..7d5283d83022 100644
@@ -6522,6 +6522,14 @@ M:	Satish Kharat <[email protected]>
 S:	Supported
 F:	drivers/infiniband/hw/usnic/
 
+CIX SKY1 DISPLAYPORT TRANSMITTER DRIVER
+M:	Luo Liu <[email protected]>
+M:	Wuyi Shen <[email protected]>
+R:	CIX Linux Kernel Upstream Group <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml
+
 CLANG CONTEXT ANALYSIS
 M:	Marco Elver <[email protected]>
 R:	Bart Van Assche <[email protected]>
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 1/2] dt-bindings: display: add CIX Sky1 DisplayPort transmitter

Thank you for your contribution! Sashiko AI review found 4 potential issues to consider: - [Medium] dt-bindings: display: cix,sky1-dptx: missing output port and required phys - [Low] dt-bindings…

Thank you for your contribution! Sashiko AI review found 4 potential issues to consider:
- [Medium] dt-bindings: display: cix,sky1-dptx: missing output port and required phys
- [Low] dt-bindings: display: cix,sky1-dptx: non-standard cix,dp-max-rate property
- [Low] dt-bindings: display: cix,sky1-dptx: instance index properties in binding
- [Low] dt-bindings: display: cix,sky1-dptx: unused dp0 label in DTS example
--

commit 8c60d6c22ca4c6d5157c09f9c5eab3f993001d1b
Author: Luo Liu <[email protected]>

dt-bindings: display: add CIX Sky1 DisplayPort transmitter

This commit adds the Devicetree binding schema and MAINTAINERS entry for the CIX Sky1 DisplayPort transmitter controller.

Quoted 6 lines
Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml new file +0 -0
new file mode 100644
index 0000000000000..9087b5edd9f02
@@ -0,0 +1,108 @@

[ ... ]

Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml line 56

Quoted 8 lines
Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml new file +8 -0
+  phys:
+    maxItems: 1
+    description: DisplayPort PHY the controller transmits through.
+
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+    description:
+      Video input from the display pipeline that drives this controller.

[Severity: Medium]
Should this binding define ports with both an input port from the display pipeline and an output port to the downstream DisplayPort connector, eDP panel, or Type-C bridge, and mark phys and ports as required?

With only a single input port and additionalProperties: false, board DTS files that connect the transmitter output to a connector or panel via ports will fail dtbs_check validation. In addition, cix_dp_parse_dt() unconditionally calls devm_phy_get(dev, NULL) and fails probe if phys is absent, yet phys and the OF graph port are omitted from both required and the example.

Quoted 5 lines
Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml new file +5 -0
+
+  cix,adapter-port:
+    description:
+      RCSU video adapter port of this transmitter. Sky1 numbers its five
+      transmitters from 1 to 5. Port 3 is the native DP/eDP output.

Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml line 71

Quoted 10 lines
Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml new file +10 -0
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 1
+    maximum: 5
+
+  cix,dp-max-rate:
+    description:
+      Maximum link rate the board is wired for, in units of 10 kbit/s.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [162000, 270000, 540000, 810000]
+    default: 810000

[Severity: Low]
Could this use the standard link-frequencies property from video-interfaces.yaml on the output endpoint instead of a custom cix,dp-max-rate property?

The values 162000, 270000, 540000, and 810000 in 10 kbit/s units come from Linux DRM's internal drm_dp_bw_code_to_link_rate() representation and lack a standard unit suffix, whereas DisplayPort bindings normally specify board-supported link rates in Hz via link-frequencies on the output endpoint.

Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml line 80

Quoted 9 lines
Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml new file +9 -0
+
+  cix,stream-id:
+    description:
+      Index of the video stream this controller uses. Sky1 has two streams,
+      numbered 0 and 1.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 1
+    default: 0

[Severity: Low]
Should cix,adapter-port and cix,stream-id be avoided in favor of describing hardware differences via compatible strings or OF graph endpoints?

In cix_dp_cfg_adapter(), each instance already maps its own rcsu region from reg, and cix,adapter-port is only checked against port 3 because the native DP/eDP port uses a different RCSU register layout (offset 0x320) than the USB-C DP ports (offsets 0x300 and 0x304). Similarly, cix,stream-id encodes the display pipeline stream index as a custom vendor property rather than representing the stream routing through OF graph ports or endpoints.

[ ... ]

Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml line 98

Quoted 5 lines
Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml new file +5 -0
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    dp0: dp@14064000 {

[Severity: Low]
Can the unreferenced dp0 label be dropped from the example? It is never referenced within the example and triggers an unused-labels warning from scripts/dtc/dt-check-style in strict mode.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#3 lore raw

Re: [PATCH 1/2] dt-bindings: display: add CIX Sky1 DisplayPort transmitter

In reply to Luo Liu
Quoted 11 lines · Luo Liu

Document the CIX Sky1 DisplayPort transmitter. Each instance sits between one of the SoC display pipelines and a DisplayPort PHY, and exposes the DP register block together with the RCSU block used for the link setup.

The controller is described as a DRM bridge whose video input is linked through the OF graph, and the DisplayPort PHY is referenced through the generic PHY framework. The RCSU adapter port, the video stream and the maximum link rate are described by "cix,adapter-port", "cix,stream-id" and "cix,dp-max-rate".

Quoted 7 lines
---
 .../bindings/display/cix,sky1-dptx.yaml       | 108 ++++++++++++++++++
 MAINTAINERS                                   |   8 ++
 2 files changed, 116 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml

Feedback from Sashiko looks reasonable and I do not see it being responded to. Dropping from DT Patchwork.

Best regards,
Krzysztof

author
#4 lore raw

PATCH 2/2 drm/cix: add Sky1 DisplayPort transmitter driver

In reply to Luo Liu

Add a DRM bridge driver for the CIX Sky1 DisplayPort transmitter. The controller implements the DP link training and the source side of the DisplayPort protocol, and is fed by one of the SoC display pipelines.

The transmitter is exposed as a DRM bridge. The CIX display pipeline attaches bridges without DRM_BRIDGE_ATTACH_NO_CONNECTOR, so the driver creates the connector from .attach. When that flag is set, connector creation is left to the display controller. The connector reads the EDID, validates modes against the link bandwidth, supports YCbCr 4:2:0 and signals hotplug through drm_helper_hpd_irq_event().

The DisplayPort PHY is driven through the generic PHY API: link-rate and voltage-swing updates are forwarded to the PHY and the link is retrained when the sink requests it. Audio and DSC are not supported yet.

---
 MAINTAINERS                             |    1 +
 drivers/gpu/drm/Kconfig                 |    1 +
 drivers/gpu/drm/Makefile                |    1 +
 drivers/gpu/drm/cix/Kconfig             |    3 +
 drivers/gpu/drm/cix/Makefile            |    3 +
 drivers/gpu/drm/cix/dptx/Kconfig        |   16 +
 drivers/gpu/drm/cix/dptx/Makefile       |    4 +
 drivers/gpu/drm/cix/dptx/cix_dptx.c     | 2086 +++++++++++++++++++++++
 drivers/gpu/drm/cix/dptx/cix_dptx.h     |  370 ++++
 drivers/gpu/drm/cix/dptx/cix_dptx_drm.c |  653 +++++++
 drivers/gpu/drm/cix/dptx/cix_dptx_drm.h |   16 +
 11 files changed, 3154 insertions(+)
 create mode 100644 drivers/gpu/drm/cix/Kconfig
 create mode 100644 drivers/gpu/drm/cix/Makefile
 create mode 100644 drivers/gpu/drm/cix/dptx/Kconfig
 create mode 100644 drivers/gpu/drm/cix/dptx/Makefile
 create mode 100644 drivers/gpu/drm/cix/dptx/cix_dptx.c
 create mode 100644 drivers/gpu/drm/cix/dptx/cix_dptx.h
 create mode 100644 drivers/gpu/drm/cix/dptx/cix_dptx_drm.c
 create mode 100644 drivers/gpu/drm/cix/dptx/cix_dptx_drm.h
MAINTAINERS +1 -0
index 7d5283d83022..18ee884ae158 100644
@@ -6529,6 +6529,7 @@ R:	CIX Linux Kernel Upstream Group <[email protected]>
 L:	[email protected]
 S:	Maintained
 F:	Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml
+F:	drivers/gpu/drm/cix/dptx/
 
 CLANG CONTEXT ANALYSIS
 M:	Marco Elver <[email protected]>
drivers/gpu/drm/Kconfig +1 -0
index 61111d50b1c6..a1808db8b9c8 100644
@@ -311,6 +311,7 @@ source "drivers/gpu/drm/aspeed/Kconfig"
 source "drivers/gpu/drm/ast/Kconfig"
 source "drivers/gpu/drm/atmel-hlcdc/Kconfig"
 source "drivers/gpu/drm/bridge/Kconfig"
+source "drivers/gpu/drm/cix/Kconfig"
 source "drivers/gpu/drm/etnaviv/Kconfig"
 source "drivers/gpu/drm/exynos/Kconfig"
 source "drivers/gpu/drm/fsl-dcu/Kconfig"
drivers/gpu/drm/Makefile +1 -0
index 2c6bc093a923..6ed7456bb993 100644
@@ -169,6 +169,7 @@ obj-y			+= tests/
 obj-$(CONFIG_DRM_MIPI_DBI) += drm_mipi_dbi.o
 obj-$(CONFIG_DRM_MIPI_DSI) += drm_mipi_dsi.o
 obj-y			+= arm/
+obj-y			+= cix/
 obj-y			+= clients/
 obj-y			+= display/
 obj-$(CONFIG_DRM_TTM)	+= ttm/
drivers/gpu/drm/cix/Kconfig new file +3 -0
new file mode 100644
index 000000000000..6cbaa5bf9fe9
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+source "drivers/gpu/drm/cix/dptx/Kconfig"
drivers/gpu/drm/cix/Makefile new file +3 -0
new file mode 100644
index 000000000000..a93591fc49e8
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-$(CONFIG_DRM_CIX_DP) += dptx/
drivers/gpu/drm/cix/dptx/Kconfig new file +16 -0
new file mode 100644
index 000000000000..0b099f7d2ed5
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config DRM_CIX_DP
+	tristate "Cix DisplayPort Controller Driver"
+	depends on COMMON_CLK && DRM && OF
+	depends on GENERIC_PHY
+	select DRM_KMS_HELPER
+	select DRM_DISPLAY_HELPER
+	select DRM_DISPLAY_DP_HELPER
+	help
+	  DRM/KMS driver for the Cix DisplayPort controller. It implements
+	  the standard DRM bridge interface and drives an external
+	  DisplayPort PHY through the generic PHY framework.
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called cix-dptx.
drivers/gpu/drm/cix/dptx/Makefile new file +4 -0
new file mode 100644
index 000000000000..d156178d9a34
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+cix-dptx-y := cix_dptx.o cix_dptx_drm.o
+obj-$(CONFIG_DRM_CIX_DP) += cix-dptx.o
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +2086 -0

2,086 lines not on this page · raw message

drivers/gpu/drm/cix/dptx/cix_dptx.h new file +370 -0

370 lines not on this page · raw message

drivers/gpu/drm/cix/dptx/cix_dptx_drm.c new file +653 -0

497 lines not on this page · raw message

drivers/gpu/drm/cix/dptx/cix_dptx_drm.h new file +16 -0
new file mode 100644
index 000000000000..3ac57faa349e

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

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

Signature · 1 line
2.25.1

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

#5 lore raw

Re: [PATCH 2/2] drm/cix: add Sky1 DisplayPort transmitter driver

Thank you for your contribution! Sashiko AI review found 16 potential issues to consider: - [High] drm/cix: cix_dp_replay_deferred_hotplug() always fails with -ENODEV - [High] drm/cix: sink DPCD…

Thank you for your contribution! Sashiko AI review found 16 potential issues to consider:
- [High] drm/cix: cix_dp_replay_deferred_hotplug() always fails with -ENODEV
- [High] drm/cix: sink DPCD caps not read before detect, mode_valid, and mode_set
- [High] drm/cix: PHY ref leak and wedged state in cix_dp_encoder_enable() and prepare
- [High] drm/cix: HPD work cancellation and IRQ ordering races on teardown and suspend
- [High] drm/cix: unclocked MMIO reads in cix_dp_aux_transfer() and HPD workers
- [High] drm/cix/dptx: NULL dereference in cix_dp_panel_hw_cfg() with NO_CONNECTOR
- [High] drm/cix/dptx: double connector cleanup and UAF in cix_dp_bridge_detach()
- [High] drm/cix/dptx: broken sync flags and YCbCr 4:2:0 selection in atomic_check
- [Medium] drm/cix: unbalanced PHY and clock teardown in cix_dptx_shutdown() and remove
- [Medium] drm/cix: unbalanced disable_irq() and lost force_hpd state across suspend
- [Medium] drm/cix: broken VSC SDP payload and stream override in dptx_setup_vsc_sdp()
- [Medium] drm/cix: cix_dp_aux_cmd_submit() reads FIFO and continues on NACK or DEFER
- [Medium] drm/cix/dptx: unchecked state allocation in cix_dp_connector_create()
- [Medium] drm/cix/dptx: ignored mode_set failure causes divide-by-zero on enable
- [Medium] drm/cix/dptx: CIX_DPTX_ENHANCED_FRAMING_ENABLE not cleared when disabled
- [Medium] drm/cix/dptx: unlocked access to shared state in mode_set and oob_hotplug
--

commit a2a34412966dc5d33f9669af4c794727d4e8b1e4
Author: Luo Liu <[email protected]>

drm/cix: add Sky1 DisplayPort transmitter driver

This commit adds a DRM bridge driver for the CIX Sky1 DisplayPort transmitter, implementing DP link training, AUX transfers, hotplug handling, and connector management.

Quoted 5 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +0 -0
new file mode 100644
index 0000000000000..8915c50bc9db3

[ ... ]

drivers/gpu/drm/cix/dptx/cix_dptx.c line 12

Quoted 13 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +12 -0
@@ -0,0 +1,2086 @@
+static int cix_dp_link_configure(struct cix_dp *dp)
+{
+	u8 bw_code = dp->mode.bw_code;
+	u8 lane_cnt = dp->mode.lane_cnt;
+	int ret;
+
+	cix_dp_write(dp, CIX_DPTX_LANE_COUNT_SET, lane_cnt);
+
+	if (dp->caps.enhanced_framing) {
+		cix_dp_write(dp, CIX_DPTX_ENHANCED_FRAMING_ENABLE, 1);
+		lane_cnt |= DP_LANE_COUNT_ENHANCED_FRAME_EN;
+	}

[Severity: Medium]
Should CIX_DPTX_ENHANCED_FRAMING_ENABLE be cleared when dp->caps.enhanced_framing is false? If a sink without enhanced framing is connected after one that enabled it, the transmitter keeps sending enhanced framing while DP_LANE_COUNT_ENHANCED_FRAME_EN is cleared in the sink DPCD.

[ ... ]

Quoted 34 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +34 -0
+	value = cix_dp_read(dp, CIX_DPTX_AUX_REPLY_CODE);
+	if (reply)
+		*reply = value;
+
+	if (is_read) {
+		if (value == CIX_DPTX_AUX_REPLY_CODE_AUX_ACK ||
+		    value == CIX_DPTX_AUX_REPLY_CODE_I2C_ACK) {
+			value = cix_dp_read(dp, CIX_DPTX_AUX_REPLY_DATA_COUNT);
+			if ((value & CIX_DPTX_REPLY_DATA_COUNT_MASK) != bytes)
+				return -EIO;
+		}
+		for (i = 0; i < bytes; i++)
+			buf[i] = cix_dp_read(dp, CIX_DPTX_AUX_REPLY_DATA);
+	}
+
+	return 0;
+}
+
+static ssize_t cix_dp_aux_transfer(struct drm_dp_aux *aux,
+				   struct drm_dp_aux_msg *msg)
+{
+	struct cix_dp *dp = container_of(aux, struct cix_dp, aux);
+	size_t to_access = 0;
+	size_t accessed_bytes = 0;
+	int ret;
+
+	if (!cix_dp_get_hpd_state(dp))
+		return -ENODEV;
+
+	do {
+		to_access = min_t(size_t, DP_AUX_MAX_PAYLOAD_BYTES,
+				  msg->size - accessed_bytes);
+		ret = cix_dp_aux_cmd_submit(dp, msg->request,
+					    msg->address + accessed_bytes,

drivers/gpu/drm/cix/dptx/cix_dptx.c line 547

Quoted 10 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +10 -0
+					    msg->buffer + accessed_bytes,
+					    to_access, &msg->reply);
+		if (ret)
+			return accessed_bytes ? (ssize_t)accessed_bytes : ret;
+
+		accessed_bytes += to_access;
+	} while (accessed_bytes < msg->size);
+
+	return msg->size;
+}

[Severity: Medium]
Does cix_dp_aux_cmd_submit() read from an empty CIX_DPTX_AUX_REPLY_DATA FIFO when the sink replies with NACK or DEFER?

When value is non-zero (NACK or DEFER), the reply data count check is skipped, but the loop still reads bytes entries from CIX_DPTX_AUX_REPLY_DATA into buf and returns 0. In cix_dp_aux_transfer(), multi-chunk transfers also keep submitting subsequent chunks after a NACK or DEFER instead of stopping and returning the reply code to the DRM AUX helper.

[ ... ]

Quoted 25 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +25 -0
+static int dptx_setup_vsc_sdp(struct dp_sdp *sdp,
+			      struct cix_dp_config *config)
+{
+	sdp->sdp_header.HB0 = 0;
+	sdp->sdp_header.HB1 = 0x7;
+	sdp->sdp_header.HB2 = 0x5;
+	sdp->sdp_header.HB3 = 0x13;
+
+	switch (config->format) {
+	case CIX_DP_FORMAT_YCBCR444:
+		sdp->db[16] = 0x1 << 4;
+		break;
+	case CIX_DP_FORMAT_YCBCR422:
+		sdp->db[16] = 0x1 << 4;
+		break;
+	case CIX_DP_FORMAT_YCBCR420:
+		sdp->db[16] = 0x3 << 4;
+		break;
+	default:
+		break;
+	}
+
+	switch (config->colorspace) {
+	case DRM_MODE_COLORIMETRY_BT709_YCC:
+		sdp->db[16] |= 0x1;

[ ... ]

Quoted 14 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +14 -0
+	switch (config->bpc) {
+	case 16:
+		sdp->db[17] = 0x4;
+		break;
+	case 12:
+		sdp->db[17] = 0x3;
+		break;
+	case 10:
+		sdp->db[17] = 0x2;
+		break;
+	case 8:
+	default:
+		sdp->db[17] = 0x1;
+		break;

drivers/gpu/drm/cix/dptx/cix_dptx.c line 1066

Quoted 10 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +10 -0
+	}
+
+	/* Dynamic Range and Component Bit Depth */
+	if (config->dynamic_range == DP_DYNAMIC_RANGE_CTA)
+		sdp->db[17] |= 0x80; /* DB17[7] */
+
+	sdp->db[18] = config->content_type & 0x7;
+
+	return 0;
+}

[Severity: Medium]
Does dptx_setup_vsc_sdp() program the wrong pixel encoding and bit depth in the VSC SDP payload?

CIX_DP_FORMAT_YCBCR422 sets sdp->db[16] to 0x1 << 4 (YCbCr 4:4:4) instead of 0x2 << 4 (YCbCr 4:2:2). On the default (RGB) path, sdp->db[16] is not cleared before ORing the colorimetry bits, leaving stale format and colorimetry values from earlier modesets. In addition, 6 bpc falls into the default branch and encodes sdp->db[17] as 0x1 (8 bpc) instead of 0x0.

In cix_dp_set_misc(), the VSC SDP path also only sets the pixel format override for CIX_DP_FORMAT_YCBCR420 (leaving override format bits as RGB for YCbCr 4:2:2 and 4:4:4) and hardcodes config->content_type to DP_CONTENT_TYPE_NOT_DEFINED instead of using the connector's content_type property.

Quoted 14 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +14 -0
+
+static int cix_dp_panel_setup_colorimetry_sdp(struct cix_dp *dp,
+					      struct cix_dp_panel *dp_panel)
+{
+	struct cix_connector *conn = dp_panel->connector;
+
+	if (conn->config.override & CIX_DPTX_STREAM_OVERRIDE_ENABLE) {
+		dptx_setup_vsc_sdp(&conn->sdp[CIX_VSC_SDP], &conn->config);
+		infoframe_write_packet(dp, dp_panel->source_id, CIX_VSC_SDP,
+				       &conn->sdp[CIX_VSC_SDP], 1);
+	}
+
+	return 0;
+}

[ ... ]

Quoted 11 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +11 -0
+static int cix_dp_panel_hw_cfg(struct cix_dp *dp, int stream_id)
+{
+	struct cix_dp_panel *dp_panel = dp->active_panels[stream_id];
+	struct drm_display_mode *mode = cix_dp_get_mode(dp, stream_id);
+	struct cix_connector *conn;
+
+	if (!mode)
+		return -EINVAL;
+
+	conn = dp_panel->connector;
+

drivers/gpu/drm/cix/dptx/cix_dptx.c line 1144

Quoted 10 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +10 -0
+	cix_dp_cfg_adapter(dp, stream_id);
+
+	cix_dp_set_misc(dp, dp_panel);
+	cix_dp_panel_setup_colorimetry_sdp(dp, dp_panel);
+
+	cix_dp_mode_set_transfer_unit(dp, dp_panel->source_id, mode,
+				      conn->config.bpp);
+	cix_dp_mode_set_timing(dp, dp_panel->source_id, mode, conn->config.bpp);
+	return 0;
+}

[Severity: High]
Can cix_dp_panel_hw_cfg() and cix_dp_panel_setup_colorimetry_sdp() dereference a NULL dp_panel->connector when the bridge is attached with DRM_BRIDGE_ATTACH_NO_CONNECTOR?

When DRM_BRIDGE_ATTACH_NO_CONNECTOR is passed to cix_dp_bridge_attach(), cix_dp_connector_create() is skipped and dp->dp_panel.connector remains NULL. Enabling the bridge then calls cix_dp_panel_hw_cfg(), which ignores the -EINVAL return from cix_dp_set_misc() and dereferences conn in cix_dp_panel_setup_colorimetry_sdp() and cix_dp_mode_set_transfer_unit(). In addition, cix_dp_hpd_event_work_func() returns early when dp->dp_panel.connector is NULL, and cix_dp_bridge_funcs does not implement the bridge detection or EDID callbacks needed when connector creation is delegated to the display controller.

[ ... ]

Quoted 19 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +19 -0
+static void cix_dp_replay_deferred_hotplug(struct cix_dp *dp)
+{
+	struct phy *phy = dp->phy;
+	union phy_configure_opts opts = { 0 };
+	u8 dpcd_rev;
+
+	if (!(dp->state & DPTX_STATE_INITIALIZED))
+		return;
+	if (dp->force_hpd != connector_status_unknown)
+		return;
+	if (cix_dp_get_hpd_state(dp))
+		return;
+
+	phy_validate(phy, PHY_MODE_DP, 0, &opts);
+	if (phy_get_mode(phy) != PHY_MODE_DP)
+		return;
+
+	/*
+	 * The combo PHY is already muxed to DP, so the sink may have been

drivers/gpu/drm/cix/dptx/cix_dptx.c line 1546

Quoted 10 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +10 -0
+	 * plugged in before the connector existed. Probe the AUX channel to
+	 * make sure one is really there before forcing a hotplug event.
+	 */
+	if (drm_dp_dpcd_readb(&dp->aux, DP_DPCD_REV, &dpcd_rev) < 0)
+		return;
+
+	dp->force_hpd = connector_status_connected;
+	dp->status = connector_status_unknown;
+	schedule_delayed_work(&dp->hpd_event_work, 0);
+}

[Severity: High]
Does drm_dp_dpcd_readb() in cix_dp_replay_deferred_hotplug() always fail with -ENODEV?

cix_dp_replay_deferred_hotplug() returns early if cix_dp_get_hpd_state(dp) is true, so reaching drm_dp_dpcd_readb() guarantees cix_dp_get_hpd_state(dp) is false. Because dp->force_hpd is only set to connector_status_connected after drm_dp_dpcd_readb(), cix_dp_aux_transfer() sees !cix_dp_get_hpd_state(dp) and rejects the AUX read with -ENODEV, preventing deferred hotplug from ever triggering.

Quoted 32 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +32 -0
+
+static void cix_dp_hpd_event_work_func(struct work_struct *work)
+{
+	struct cix_dp *dp = container_of(work, struct cix_dp,
+					 hpd_event_work.work);
+	struct phy *phy = dp->phy;
+	union phy_configure_opts opts = { 0 };
+	enum drm_connector_status old_status;
+	enum phy_mode mode;
+	int i;
+
+	if (!dp->dp_panel.connector)
+		return;
+
+	/*
+	 * On a USB-C DP alt-mode PHY the hotplug only becomes valid once the
+	 * PHY has been switched to DP mode, so wait for the mode change.
+	 * A native DP PHY has no ->set_mode() operation, which leaves the
+	 * mode at PHY_MODE_INVALID forever; there is nothing to wait for.
+	 */
+	if (cix_dp_get_hpd_state(dp) &&
+	    phy_get_mode(phy) != PHY_MODE_INVALID) {
+		for (i = 0; i < DP_HPD_MAX_TRIES; i++) {
+			phy_validate(phy, PHY_MODE_DP, 0, &opts);
+			mode = phy_get_mode(phy);
+			if (mode == PHY_MODE_DP)
+				break;
+			msleep(100);
+		}
+	}
+
+	old_status = dp->status;

drivers/gpu/drm/cix/dptx/cix_dptx.c line 1588

Quoted 10 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +10 -0
+	drm_helper_probe_detect(&dp->connector.base, NULL, false);
+
+	if (dp->status == connector_status_connected)
+		cix_dp_handle_connect(dp);
+	else
+		cix_dp_handle_disconnect(dp);
+
+	if (old_status != dp->status && dp->drm)
+		drm_helper_hpd_irq_event(dp->drm);
+}

[Severity: High]
Does probing the connector before cix_dp_handle_connect() leave dp->dpcd, dp->link_config, and dp->caps uninitialized during detection and mode validation?

cix_dp_detect() only checks the HPD pin level and never reads DPCD. In cix_dp_hpd_event_work_func(), drm_helper_probe_detect() runs before cix_dp_handle_connect(), so cix_dp_connector_detect() passes zeroed or stale dp->dpcd and dp->downstream_ports to drm_dp_set_subconnector_property(). Likewise, when a native DP monitor is connected before cix_dp_bridge_attach() creates the connector, or after system resume, DRM probes the connector and validates modes before cix_dp_handle_connect() ever runs, and cix_dp_bridge_atomic_enable() calls cix_dp_bridge_mode_set() before encoder_enable() reads the sink's DPCD capabilities.

Also, in cix_dp_handle_connect(), DPTX_STATE_CONNECTED is only cleared when cix_dp_panel_read_sink_caps() fails with -ETIMEDOUT or -ENOTCONN; if it fails with -EIO or -EBUSY, DPTX_STATE_CONNECTED remains set with zeroed caps and blocks later retries.

Quoted 6 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +6 -0
+
+static void cix_dp_hpd_irq_work_func(struct work_struct *work)
+{
+	struct cix_dp *dp = container_of(work, struct cix_dp,
+					 hpd_irq_work.work);
+	u8 status[DP_LINK_STATUS_SIZE + 2];

drivers/gpu/drm/cix/dptx/cix_dptx.c line 1604

Quoted 10 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +10 -0
+	int ret;
+
+	if (!cix_dp_get_hpd_state(dp))
+		return;
+
+	mutex_lock(&dp->session_lock);
+
+	if (!(dp->state & DPTX_STATE_INITIALIZED) ||
+	    !(dp->state & DPTX_STATE_ENABLED))
+		goto end;

[Severity: High]
Can cix_dp_get_hpd_state() and cix_dp_aux_transfer() read DPTX registers while dp->apb_clk is gated?

As noted above cix_dp_detect(), cix_dp_read() hangs the bus if called when DPTX_STATE_INITIALIZED is clear and dp->apb_clk is disabled. cix_dp_hpd_irq_work_func() calls cix_dp_get_hpd_state() before locking dp->session_lock and checking DPTX_STATE_INITIALIZED, and cix_dp_aux_transfer() (reachable via /dev/drm_dp_aux*) and cix_dp_hpd_event_work_func() access DPTX registers without checking DPTX_STATE_INITIALIZED under dp->session_lock.

[ ... ]

Quoted 12 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +12 -0
+static int cix_dp_pm_complete(struct cix_dp *dp)
+{
+	int ret = 0;
+
+	mutex_lock(&dp->session_lock);
+
+	if (!(dp->state & DPTX_STATE_SUSPENDED))
+		goto end;
+
+	ret = cix_dp_host_init(dp);
+	if (ret)
+		goto end;

drivers/gpu/drm/cix/dptx/cix_dptx.c line 1693

Quoted 10 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +10 -0
+
+	enable_irq(dp->irq);
+	dp->state &= ~DPTX_STATE_SUSPENDED;
+
+	if (dp->drm && dp->drm->mode_config.poll_enabled)
+		drm_kms_helper_poll_enable(dp->drm);
+end:
+	mutex_unlock(&dp->session_lock);
+	return ret;
+}

[Severity: Medium]
If cix_dp_host_init() fails in cix_dp_pm_complete(), does dp->irq stay disabled while a later cix_dp_pm_prepare() or cix_dp_deinit() calls disable_irq() a second time?

Because cix_dp_pm_prepare() and cix_dp_deinit() call disable_irq(dp->irq) unconditionally without checking whether DPTX_STATE_SUSPENDED is already set, a failed resume nests the IRQ disable depth. Additionally, when DPTX_STATE_SUSPENDED is set, cix_dp_oob_hotplug_event() overwrites dp->force_hpd with connector_status_disconnected instead of recording hpd_state, losing Type-C plug events that arrive during suspend.

Quoted 39 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +39 -0
+
+static int cix_dp_prepare(struct cix_dp *dp)
+{
+	int ret;
+
+	mutex_lock(&dp->session_lock);
+
+	if (dp->state & (DPTX_STATE_ENABLED)) {
+		ret = 0;
+		goto end;
+	}
+
+	if (!(dp->state & DPTX_STATE_INITIALIZED)) {
+		ret = cix_dp_host_init(dp);
+		if (ret)
+			goto end;
+	} else if (dp->state & DPTX_STATE_INIT_TRAIN) {
+		reset_dp_and_reinit(dp);
+		usleep_range(100, 200);
+	}
+
+	if (cix_dp_get_hpd_state(dp) &&
+	    !(dp->state & DPTX_STATE_CONNECTED)) {
+		mutex_unlock(&dp->session_lock);
+		cix_dp_handle_connect(dp);
+		mutex_lock(&dp->session_lock);
+	}
+
+	if (!(cix_dp_get_hpd_state(dp) && (dp->state & DPTX_STATE_CONNECTED))) {
+		ret = 0;
+		goto end;
+	}
+
+	ret = cix_dp_core_on(dp, true);
+
+end:
+	mutex_unlock(&dp->session_lock);
+	return ret;
+}

[ ... ]

Quoted 13 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +13 -0
+static int cix_dp_encoder_enable(struct cix_dp *dp, int stream_id, int enable)
+{
+	int ret;
+
+	if (enable) {
+		ret = cix_dp_prepare(dp);
+		if (ret)
+			return ret;
+
+		ret = cix_dp_enable(dp, stream_id);
+	} else {
+		if (!(dp->state & DPTX_STATE_INITIALIZED))
+			return 0;

drivers/gpu/drm/cix/dptx/cix_dptx.c line 1843

Quoted 10 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +10 -0
+
+		ret = cix_dp_disable(dp, stream_id);
+		if (ret)
+			return ret;
+
+		ret = cix_dp_unprepare(dp);
+	}
+
+	return ret;
+}

[Severity: High]
Does a failure in cix_dp_enable() leak PHY references and leave the transmitter wedged with DPTX_STATE_READY set?

In cix_dp_encoder_enable(), cix_dp_prepare() calls cix_dp_core_on(), which calls phy_init() and phy_power_on() and sets DPTX_STATE_READY | DPTX_STATE_INIT_TRAIN. If cix_dp_enable() then fails, DPTX_STATE_ENABLED is not set and cix_dp_core_off() is not called. A subsequent disable will return early in cix_dp_unprepare() because DPTX_STATE_ENABLED is clear, while a subsequent enable will call reset_dp_and_reinit() (leaking another phy_init() call) and then return early in cix_dp_core_on() because DPTX_STATE_READY is still set, skipping link training after the reset.

Also, if the display controller resumes and calls cix_dp_prepare() before cix_dptx_pm_resume() clears DPTX_STATE_SUSPENDED, cix_dp_handle_connect() will bail out on DPTX_STATE_SUSPENDED and leave the display disabled.

[ ... ]

Quoted 4 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +4 -0
+static void cix_dp_deinit(struct cix_dp *dp)
+{
+	cancel_delayed_work_sync(&dp->sw_hpd_irq_work);
+	cancel_delayed_work_sync(&dp->hpd_irq_work);

drivers/gpu/drm/cix/dptx/cix_dptx.c line 1892

Quoted 10 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +10 -0
+	cancel_delayed_work_sync(&dp->hpd_event_work);
+	disable_irq(dp->irq);
+
+	mutex_lock(&dp->session_lock);
+	cix_dp_host_deinit(dp);
+	dp->state &= ~(DPTX_STATE_CONFIGURED);
+	mutex_unlock(&dp->session_lock);
+
+	mutex_destroy(&dp->session_lock);
+}

[Severity: High]
Can HPD delayed work items be re-queued after cancel_delayed_work_sync() during teardown, bridge detach, or suspend?

CPU0 CPU1
cix_dp_deinit()
cancel_delayed_work_sync(...)

                                  cix_dp_irq_handler()
                                    queue_delayed_work(...,
                                      &dp->hpd_event_work, 0)

disable_irq(dp->irq)
cix_dp_host_deinit(dp) mutex_destroy(&dp->session_lock)
cix_dp_hpd_event_work_func()
<-- unclocked MMIO / UAF

In cix_dp_deinit(), disable_irq(dp->irq) is called after cancel_delayed_work_sync(). In cix_dp_bridge_detach(), hpd_irq_work is cancelled before sw_hpd_irq_work (which queues hpd_irq_work), while dp->irq remains enabled and dp->dp_panel.connector is only cleared after drm_connector_cleanup(). In cix_dp_pm_prepare(), the works are cancelled before DPTX_STATE_SUSPENDED is set, allowing a concurrent cix_dp_oob_hotplug_event() to schedule them right before cix_dp_host_deinit() gates dp->apb_clk.

[ ... ]

drivers/gpu/drm/cix/dptx/cix_dptx.c line 2061

Quoted 11 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +11 -0
+static void cix_dptx_shutdown(struct platform_device *pdev)
+{
+	struct cix_dp *dp = platform_get_drvdata(pdev);
+
+	if (dp) {
+		mutex_lock(&dp->session_lock);
+		dp->active_stream_cnt = 0;
+		mutex_unlock(&dp->session_lock);
+		cix_dp_pm_prepare(dp);
+	}
+}

[Severity: Medium]
Does zeroing dp->active_stream_cnt in cix_dptx_shutdown() cause cix_dp_host_deinit() to call phy_exit() while the PHY is still powered on?

When a stream is active at shutdown, forcing dp->active_stream_cnt = 0 without calling cix_dp_ctrl_stream_off() and cix_dp_core_off() leaves stream_clk enabled and the PHY powered on when cix_dp_pm_prepare() -> cix_dp_host_deinit() calls phy_exit() and disables dp->apb_clk. Conversely, in cix_dptx_remove() -> cix_dp_deinit(), if dp->active_stream_cnt is non-zero, cix_dp_host_deinit() returns early and leaks the clocks and PHY references.

Quoted 5 lines
drivers/gpu/drm/cix/dptx/cix_dptx_drm.c new file +0 -0
new file mode 100644
index 0000000000000..0ddcd76691e03

[ ... ]

Quoted 31 lines
drivers/gpu/drm/cix/dptx/cix_dptx_drm.c new file +30 -0
@@ -0,0 +1,653 @@
+static void cix_dp_adjust_mode(struct drm_display_mode *mode,
+			       struct drm_display_mode *adjusted_mode)
+{
+	int diff = mode->htotal - mode->hsync_end;
+
+	/*
+	 * Cix DP requires horizontal backporch to be greater than 12.
+	 * This limitation may not be compatible with the sink device.
+	 *
+	 * Everything below is derived from @mode instead of accumulating on
+	 * @adjusted_mode, so that repeated atomic checks of the same state
+	 * produce the same result.
+	 */
+	if (diff < CIX_DPTX_MIN_H_BACKPORCH) {
+		adjusted_mode->htotal = mode->htotal +
+					CIX_DPTX_MIN_H_BACKPORCH - diff;
+		adjusted_mode->clock = (int64_t)mode->clock *
+				       adjusted_mode->htotal / mode->htotal;
+	}
+
+	/* The sync polarities are inverted with respect to the source mode. */\n> +	if (mode->flags & DRM_MODE_FLAG_PVSYNC)
+		adjusted_mode->flags &= ~DRM_MODE_FLAG_PVSYNC;
+	else
+		adjusted_mode->flags |= DRM_MODE_FLAG_PVSYNC;
+
+	if (mode->flags & DRM_MODE_FLAG_PHSYNC)
+		adjusted_mode->flags &= ~DRM_MODE_FLAG_PHSYNC;
+	else
+		adjusted_mode->flags |= DRM_MODE_FLAG_PHSYNC;
+}

[ ... ]

Quoted 11 lines
drivers/gpu/drm/cix/dptx/cix_dptx_drm.c new file +11 -0
+static int cix_dp_pick_format_bpc(struct cix_dp *dp,
+				  struct drm_connector_state *conn_state,
+				  struct drm_display_mode *adjusted_mode,
+				  int info_formats, int suggest_bpc,
+				  int *color_format, int *bpc, int *bpp)
+{
+	struct drm_display_info *info =
+		&conn_state->connector->display_info;
+	int curr_bpc;
+	int format;
+	int i;

drivers/gpu/drm/cix/dptx/cix_dptx_drm.c line 280

Quoted 10 lines
drivers/gpu/drm/cix/dptx/cix_dptx_drm.c new file +10 -0
+
+	for (i = 0; i < ARRAY_SIZE(fmt_prio); i++) {
+		format = fmt_prio[i].format;
+		curr_bpc = fmt_prio[i].bpc ? fmt_prio[i].bpc : suggest_bpc;
+
+		/* Only use 420_only flag for YUV420 format */
+		if (!(info_formats & BIT(format)) &&
+		    !(format == DRM_OUTPUT_COLOR_FORMAT_YCBCR420 &&
+		      drm_mode_is_420_only(info, adjusted_mode)))
+			continue;

[Severity: High]
Does mutating adjusted_mode->flags in cix_dp_adjust_mode() break CEA mode matching and YCbCr 4:2:0 format selection in cix_dp_pick_format_bpc()?

cix_dp_adjust_mode() toggles DRM_MODE_FLAG_PVSYNC and DRM_MODE_FLAG_PHSYNC without updating DRM_MODE_FLAG_NVSYNC and DRM_MODE_FLAG_NHSYNC, leaving adjusted_mode->flags with either both positive and negative sync flags set or neither set. When cix_dp_pick_format_bpc() then passes adjusted_mode to drm_mode_is_420_only(), drm_match_cea_mode() fails to match the mutated flags (and any adjusted htotal/clock) and always returns false.

Furthermore, cix_dp_pick_format_bpc() does not skip non-4:2:0 formats when a mode is 4:2:0-only (so RGB444 or YCbCr 4:2:2 is picked whenever link bandwidth allows), and it does not check drm_mode_is_420() or dp->caps.vsc_supported before picking DRM_OUTPUT_COLOR_FORMAT_YCBCR420 (nor does cix_dp_bridge_atomic_check() validate adjusted_mode->clock against CIX_DP_MAX_FREQ).

[ ... ]

Quoted 14 lines
drivers/gpu/drm/cix/dptx/cix_dptx_drm.c new file +14 -0
+static void cix_dp_bridge_mode_set(struct cix_dp *dp,
+				   struct drm_crtc_state *crtc_state,
+				   struct drm_connector_state *conn_state)
+{
+	struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode;
+	struct cix_connector *cix_conn = &dp->connector;
+	int color_format;
+	int link_rate;
+	int bw_code;
+	int bpc;
+	int bpp;
+	int ret;
+
+	ret = cix_dp_pick_config(dp, conn_state, adjusted_mode,

drivers/gpu/drm/cix/dptx/cix_dptx_drm.c line 410

Quoted 10 lines
drivers/gpu/drm/cix/dptx/cix_dptx_drm.c new file +10 -0
+				 &color_format, &bpc, &bpp);
+	if (ret) {
+		dev_err(dp->dev, "no usable DP link configuration: %d\n", ret);
+		return;
+	}
+
+	cix_conn->config.format = cix_dp_drm_format_to_dp(color_format);
+	cix_conn->config.colorspace = conn_state->colorspace;
+	cix_conn->config.bpc = bpc;
+	cix_conn->config.bpp = bpp;

[Severity: Medium]
Can cix_dp_bridge_mode_set() race with cix_dp_hpd_irq_work_func() and cix_dp_handle_connect() on dp->mode, dp->connector.config, and dp->link_config?

cix_dp_hpd_irq_work_func() holds dp->session_lock while cix_dp_train_loop() reads dp->connector.config.bpp and updates dp->mode, and cix_dp_handle_connect() holds dp->session_lock while updating dp->link_config, but cix_dp_bridge_mode_set() reads dp->link_config and writes dp->connector.config and dp->mode without holding dp->session_lock. Similarly, cix_dp_oob_hotplug_event() reads dp->state and updates dp->force_hpd without holding dp->session_lock.

drivers/gpu/drm/cix/dptx/cix_dptx_drm.c line 417

Quoted 7 lines
drivers/gpu/drm/cix/dptx/cix_dptx_drm.c new file +7 -0
+	dp->pixel_per_cycle = cix_dp_pick_ppc(adjusted_mode,
+					      cix_conn->config.format);
+
+	link_rate = cix_dp_pick_link_rate(dp, adjusted_mode, bpp);
+	bw_code = drm_dp_link_rate_to_bw_code(link_rate);
+
+	dp->ops->mode_configure(dp, adjusted_mode->clock, bw_code, bpp, false);

[Severity: Medium]
If cix_dp_pick_config() or dp->ops->mode_configure() fails in cix_dp_bridge_mode_set(), can cix_dp_bridge_atomic_enable() divide by zero?

When cix_dp_bridge_mode_set() fails before dp->mode is populated, cix_dp_bridge_atomic_enable() still calls dp->ops->encoder_enable() with dp->mode.lane_cnt == 0 and dp->mode.bw_code == 0. Link training succeeds vacuously for 0 lanes, and cix_dp_mode_set_transfer_unit() and cix_dp_mode_set_timing() then divide by dp->mode.lane_cnt.

[ ... ]

Quoted 18 lines
drivers/gpu/drm/cix/dptx/cix_dptx_drm.c new file +18 -0
+static int cix_dp_connector_create(struct cix_dp *dp,
+				   struct drm_encoder *encoder)
+{
+	struct cix_connector *conn = &dp->connector;
+	struct drm_connector *connector = &conn->base;
+	int ret;
+
+	conn->dp = dp;
+
+	connector->polled = DRM_CONNECTOR_POLL_HPD;
+	connector->ycbcr_420_allowed = true;
+
+	ret = drm_connector_init_with_ddc(encoder->dev, connector,
+					  &cix_dp_connector_funcs,
+					  DRM_MODE_CONNECTOR_DisplayPort,
+					  &dp->aux.ddc);
+	if (ret)
+		return ret;

drivers/gpu/drm/cix/dptx/cix_dptx_drm.c line 576

Quoted 10 lines
drivers/gpu/drm/cix/dptx/cix_dptx_drm.c new file +10 -0
+
+	drm_connector_helper_add(connector, &cix_dp_connector_helper_funcs);
+
+	drm_atomic_helper_connector_reset(connector);
+
+	ret = drm_connector_attach_encoder(connector, encoder);
+	if (ret)
+		goto err_cleanup;
+
+	cix_dp_add_properties(connector);

[Severity: Medium]
Can cix_dp_add_properties() dereference a NULL connector->state if the allocation inside drm_atomic_helper_connector_reset() fails? drm_connector_attach_max_bpc_property() unconditionally writes to connector->state->max_requested_bpc and connector->state->max_bpc.

[ ... ]

drivers/gpu/drm/cix/dptx/cix_dptx_drm.c line 629

Quoted 11 lines
drivers/gpu/drm/cix/dptx/cix_dptx_drm.c new file +11 -0
+static void cix_dp_bridge_detach(struct drm_bridge *bridge)
+{
+	struct cix_dp *dp = bridge_to_dp(bridge);
+
+	/* The hotplug workers reach the connector, stop them first. */
+	cancel_delayed_work_sync(&dp->hpd_event_work);
+	cancel_delayed_work_sync(&dp->hpd_irq_work);
+	cancel_delayed_work_sync(&dp->sw_hpd_irq_work);
+
+	if (dp->connector.base.dev)
+		drm_connector_cleanup(&dp->connector.base);

[Severity: High]
Does calling drm_connector_cleanup() in cix_dp_bridge_detach() cause a double cleanup when the DRM mode_config or an atomic state still holds a reference to the connector?

cix_dp_connector_funcs sets .destroy = drm_connector_cleanup, so the connector is reference-counted and cleaned up when its last reference is dropped (such as during drm_mode_config_cleanup()). Calling drm_connector_cleanup() directly in cix_dp_bridge_detach() zeroes the embedded struct drm_connector while references remain, leading to a refcount underflow and a NULL connector->funcs->destroy dereference in drm_connector_put().

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#6 lore raw

Re: [PATCH 2/2] drm/cix: add Sky1 DisplayPort transmitter driver

In reply to Luo Liu

drivers/gpu/drm/cix/dptx/Kconfig line 4

Quoted 10 lines · Luo Liu
drivers/gpu/drm/cix/dptx/Kconfig new file +4 -0
new file mode 100644
index 000000000000..0b099f7d2ed5
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config DRM_CIX_DP
+	tristate "Cix DisplayPort Controller Driver"

Missing ARCH dependency, look at other examples.

Quoted 12 lines
drivers/gpu/drm/cix/dptx/Kconfig new file +12 -0
+	depends on COMMON_CLK && DRM && OF
+	depends on GENERIC_PHY
+	select DRM_KMS_HELPER
+	select DRM_DISPLAY_HELPER
+	select DRM_DISPLAY_DP_HELPER
+	help
+	  DRM/KMS driver for the Cix DisplayPort controller. It implements
+	  the standard DRM bridge interface and drives an external
+	  DisplayPort PHY through the generic PHY framework.
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called cix-dptx.

...

Quoted 8 lines
drivers/gpu/drm/cix/dptx/Kconfig new file +8 -0
+static struct platform_driver cix_dp_driver = {
+	.probe  = cix_dptx_probe,
+	.remove = cix_dptx_remove,
+	.shutdown = cix_dptx_shutdown,
+	.driver = {
+		.name = "cix-dptx",
+		.of_match_table = cix_dptx_dt_ids,
+		.pm = pm_sleep_ptr(&cix_dptx_pm_ops),

drivers/gpu/drm/cix/dptx/Kconfig

Quoted 10 lines
drivers/gpu/drm/cix/dptx/Kconfig new file +10 -0
+	},
+};
+
+module_platform_driver(cix_dp_driver);
+
+MODULE_AUTHOR("Luo Liu <[email protected]>");
+MODULE_AUTHOR("Wuyi Shen <[email protected]>");
+MODULE_DESCRIPTION("Cix DisplayPort Controller Driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:cix-dptx");

Drop alias, it's not a substitute for incomplete ID tables.

Best regards,
Krzysztof

author
#7 lore raw

回复: [PATCH 2/2] drm/cix: add Sky1 DisplayPort transmitter driver

Quoted 16 lines

-----邮件原件-----
发件人: Krzysztof Kozlowski <[email protected]>
发送时间: 2026年11月13日 18:39
收件人: Luo Liu <[email protected]>
抄送: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Wuyi Shen (沈武义) <[email protected]>; cix-kernel-upstream <[email protected]>
主题: Re: [PATCH 2/2] drm/cix: add Sky1 DisplayPort transmitter driver

EXTERNAL EMAIL

On Mon, Nov 09, 2026 at 06:30:10PM +0800, Luo Liu wrote:

Quoted 13 lines

drivers/gpu/drm/cix/dptx/Kconfig line 4

Quoted 11 lines
drivers/gpu/drm/cix/dptx/Kconfig new file +4 -0
new file mode 100644
index 000000000000..0b099f7d2ed5
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config DRM_CIX_DP
+     tristate "Cix DisplayPort Controller Driver"

Missing ARCH dependency, look at other examples.

I will add depends on ARCH_CIX || COMPILE_TEST at next version

Quoted 31 lines
Quoted 13 lines
drivers/gpu/drm/cix/dptx/Kconfig new file +12 -0
+     depends on COMMON_CLK && DRM && OF
+     depends on GENERIC_PHY
+     select DRM_KMS_HELPER
+     select DRM_DISPLAY_HELPER
+     select DRM_DISPLAY_DP_HELPER
+     help
+       DRM/KMS driver for the Cix DisplayPort controller. It implements
+       the standard DRM bridge interface and drives an external
+       DisplayPort PHY through the generic PHY framework.
+
+       To compile this driver as a module, choose M here: the module will
+       be called cix-dptx.

...

Quoted 4 lines
drivers/gpu/drm/cix/dptx/Kconfig new file +4 -0
+static struct platform_driver cix_dp_driver = {
+     .probe  = cix_dptx_probe,
+     .remove = cix_dptx_remove,
+     .shutdown = cix_dptx_shutdown,

drivers/gpu/drm/cix/dptx/Kconfig

Quoted 10 lines
drivers/gpu/drm/cix/dptx/Kconfig new file +10 -0
+     .driver = {
+             .name = "cix-dptx",
+             .of_match_table = cix_dptx_dt_ids,
+             .pm = pm_sleep_ptr(&cix_dptx_pm_ops),
+     },
+};
+
+module_platform_driver(cix_dp_driver);
+
+MODULE_AUTHOR("Luo Liu <[email protected]>");

MODULE_AUTHOR("Wuyi

Quoted 5 lines

drivers/gpu/drm/cix/dptx/Kconfig

Quoted 3 lines
drivers/gpu/drm/cix/dptx/Kconfig new file +3 -0
+Shen <[email protected]>"); MODULE_DESCRIPTION("Cix DisplayPort
+Controller Driver"); MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:cix-dptx");

Drop alias, it's not a substitute for incomplete ID tables.

OK , I will remove it at next version

Thank you very much again

Best regards,

Luo

Quoted 3 lines

Best regards,
Krzysztof

#8 lore raw

Re:[PATCH 2/2] drm/cix: add Sky1 DisplayPort transmitter driver

In reply to Luo Liu

Hello Luo,

Quoted 130 lines · Luo Liu

Add a DRM bridge driver for the CIX Sky1 DisplayPort transmitter. The controller implements the DP link training and the source side of the DisplayPort protocol, and is fed by one of the SoC display pipelines.

The transmitter is exposed as a DRM bridge. The CIX display pipeline attaches bridges without DRM_BRIDGE_ATTACH_NO_CONNECTOR, so the driver creates the connector from .attach. When that flag is set, connector creation is left to the display controller. The connector reads the EDID, validates modes against the link bandwidth, supports YCbCr 4:2:0 and signals hotplug through drm_helper_hpd_irq_event().

The DisplayPort PHY is driven through the generic PHY API: link-rate and voltage-swing updates are forwarded to the PHY and the link is retrained when the sink requests it. Audio and DSC are not supported yet.

---

MAINTAINERS                             |    1 +
drivers/gpu/drm/Kconfig                 |    1 +
drivers/gpu/drm/Makefile                |    1 +
drivers/gpu/drm/cix/Kconfig             |    3 +
drivers/gpu/drm/cix/Makefile            |    3 +
drivers/gpu/drm/cix/dptx/Kconfig        |   16 +
drivers/gpu/drm/cix/dptx/Makefile       |    4 +
drivers/gpu/drm/cix/dptx/cix_dptx.c     | 2086 +++++++++++++++++++++++
drivers/gpu/drm/cix/dptx/cix_dptx.h     |  370 ++++
drivers/gpu/drm/cix/dptx/cix_dptx_drm.c |  653 +++++++
drivers/gpu/drm/cix/dptx/cix_dptx_drm.h |   16 +
11 files changed, 3154 insertions(+)

create mode 100644 drivers/gpu/drm/cix/Kconfig create mode 100644 drivers/gpu/drm/cix/Makefile create mode 100644 drivers/gpu/drm/cix/dptx/Kconfig create mode 100644 drivers/gpu/drm/cix/dptx/Makefile create mode 100644 drivers/gpu/drm/cix/dptx/cix_dptx.c create mode 100644 drivers/gpu/drm/cix/dptx/cix_dptx.h create mode 100644 drivers/gpu/drm/cix/dptx/cix_dptx_drm.c create mode 100644 drivers/gpu/drm/cix/dptx/cix_dptx_drm.h

MAINTAINERS +0 -0
index 7d5283d83022..18ee884ae158 100644
@@ -6529,6 +6529,7 @@ R:	CIX Linux Kernel Upstream Group <[email protected]>

L: [email protected]
S: Maintained
F: Documentation/devicetree/bindings/display/cix,sky1-dptx.yaml
+F: drivers/gpu/drm/cix/dptx/

CLANG CONTEXT ANALYSIS
M: Marco Elver <[email protected]>

drivers/gpu/drm/Kconfig +0 -0
index 61111d50b1c6..a1808db8b9c8 100644
@@ -311,6 +311,7 @@ source "drivers/gpu/drm/aspeed/Kconfig"

source "drivers/gpu/drm/ast/Kconfig"
source "drivers/gpu/drm/atmel-hlcdc/Kconfig"
source "drivers/gpu/drm/bridge/Kconfig"
+source "drivers/gpu/drm/cix/Kconfig"
source "drivers/gpu/drm/etnaviv/Kconfig"
source "drivers/gpu/drm/exynos/Kconfig"
source "drivers/gpu/drm/fsl-dcu/Kconfig"

drivers/gpu/drm/Makefile +0 -0
index 2c6bc093a923..6ed7456bb993 100644
@@ -169,6 +169,7 @@ obj-y			+= tests/

obj-$(CONFIG_DRM_MIPI_DBI) += drm_mipi_dbi.o
obj-$(CONFIG_DRM_MIPI_DSI) += drm_mipi_dsi.o
obj-y += arm/
+obj-y += cix/
obj-y += clients/
obj-y += display/
obj-$(CONFIG_DRM_TTM) += ttm/

drivers/gpu/drm/cix/Kconfig new file +3 -0
new file mode 100644
index 000000000000..6cbaa5bf9fe9
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+source "drivers/gpu/drm/cix/dptx/Kconfig"
drivers/gpu/drm/cix/Makefile new file +3 -0
new file mode 100644
index 000000000000..a93591fc49e8
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-$(CONFIG_DRM_CIX_DP) += dptx/
drivers/gpu/drm/cix/dptx/Kconfig new file +16 -0
new file mode 100644
index 000000000000..0b099f7d2ed5
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config DRM_CIX_DP
+	tristate "Cix DisplayPort Controller Driver"
+	depends on COMMON_CLK && DRM && OF
+	depends on GENERIC_PHY
+	select DRM_KMS_HELPER
+	select DRM_DISPLAY_HELPER
+	select DRM_DISPLAY_DP_HELPER
+	help
+	  DRM/KMS driver for the Cix DisplayPort controller. It implements
+	  the standard DRM bridge interface and drives an external
+	  DisplayPort PHY through the generic PHY framework.
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called cix-dptx.
drivers/gpu/drm/cix/dptx/Makefile new file +4 -0
new file mode 100644
index 000000000000..d156178d9a34
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+cix-dptx-y := cix_dptx.o cix_dptx_drm.o
+obj-$(CONFIG_DRM_CIX_DP) += cix-dptx.o
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +0 -0
new file mode 100644
index 000000000000..8915c50bc9db

drivers/gpu/drm/cix/dptx/cix_dptx.c line 5

Quoted 5 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +5 -0
@@ -0,0 +1,2086 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * CIX Sky1 DisplayPort transmitter driver
+ *
+ * Copyright (C) 2026 Trilinear Technologies

This indicates that this is a third-party IP, which is typically also used by other SoC platforms.
To my knowledge, Allwinner's A733 also uses this IP. Therefore, I suggest following the practice of DesignWare HDMI and DP drivers, and implementing a common library for this driver under drivers/gpu/drm/bridge/trilinear, while implementing the Cix platform-specific glue layer under the cix directory. This would make it easier for other platforms to reuse this driver in the future.

.............

Quoted 17 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +17 -0
+ * Copyright 2026 Cix Technology Group Co., Ltd.
+ */
+
+#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/irq.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/reset.h>
+#include <linux/string.h>
+
+#include <drm/drm_probe_helper.h>
+
+#include "cix_dptx.h"
+#include "cix_dptx_drm.h"
+

........

Quoted 44 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +44 -0
+
+static int cix_dp_connector_create(struct cix_dp *dp,
+				   struct drm_encoder *encoder)
+{
+	struct cix_connector *conn = &dp->connector;
+	struct drm_connector *connector = &conn->base;
+	int ret;
+
+	conn->dp = dp;
+
+	connector->polled = DRM_CONNECTOR_POLL_HPD;
+	connector->ycbcr_420_allowed = true;
+
+	ret = drm_connector_init_with_ddc(encoder->dev, connector,
+					  &cix_dp_connector_funcs,
+					  DRM_MODE_CONNECTOR_DisplayPort,
+					  &dp->aux.ddc);
+	if (ret)
+		return ret;
+
+	drm_connector_helper_add(connector, &cix_dp_connector_helper_funcs);
+
+	drm_atomic_helper_connector_reset(connector);
+
+	ret = drm_connector_attach_encoder(connector, encoder);
+	if (ret)
+		goto err_cleanup;
+
+	cix_dp_add_properties(connector);
+
+	dp->dp_panel.connector = conn;
+
+	return 0;
+
+err_cleanup:
+	drm_connector_cleanup(connector);
+	return ret;
+}
+
+static int cix_dp_bridge_attach(struct drm_bridge *bridge,
+				struct drm_encoder *encoder,
+				enum drm_bridge_attach_flags flags)
+{
+	struct cix_dp *dp = bridge_to_dp(bridge);

drivers/gpu/drm/cix/dptx/cix_dptx.c

Quoted 10 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +10 -0
+	int ret;
+
+	dp->drm = bridge->dev;
+
+	ret = dp->ops->aux_register(dp);
+	if (ret)
+		goto err_clear_drm;
+
+	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
+		return 0;

As I understand it, any new bridge driver is required to support DRM_BRIDGE_ATTACH_NO_CONNECTOR

Quoted 76 lines
drivers/gpu/drm/cix/dptx/cix_dptx.c new file +52 -0
+
+	ret = cix_dp_connector_create(dp, encoder);
+	if (ret)
+		goto err_aux;
+
+	/* The bridge may have been attached long after the sink was plugged. */
+	dp->ops->replay_deferred_hotplug(dp);
+
+	return 0;
+
+err_aux:
+	dp->ops->aux_cleanup(dp);
+err_clear_drm:
+	dp->drm = NULL;
+	return ret;
+}
+
+static void cix_dp_bridge_detach(struct drm_bridge *bridge)
+{
+	struct cix_dp *dp = bridge_to_dp(bridge);
+
+	/* The hotplug workers reach the connector, stop them first. */
+	cancel_delayed_work_sync(&dp->hpd_event_work);
+	cancel_delayed_work_sync(&dp->hpd_irq_work);
+	cancel_delayed_work_sync(&dp->sw_hpd_irq_work);
+
+	if (dp->connector.base.dev)
+		drm_connector_cleanup(&dp->connector.base);
+
+	dp->dp_panel.connector = NULL;
+
+	dp->ops->aux_cleanup(dp);
+
+	dp->drm = NULL;
+}
+
+static const struct drm_bridge_funcs cix_dp_bridge_funcs = {
+	.attach = cix_dp_bridge_attach,
+	.detach = cix_dp_bridge_detach,
+	.atomic_check = cix_dp_bridge_atomic_check,
+	.atomic_enable = cix_dp_bridge_atomic_enable,
+	.atomic_disable = cix_dp_bridge_atomic_disable,
+	.atomic_create_state = drm_atomic_helper_bridge_create_state,
+	.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
+	.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
+};
+
+struct cix_dp *cix_dp_bridge_alloc(struct device *dev)
+{
+	return devm_drm_bridge_alloc(dev, struct cix_dp, bridge,
+				     &cix_dp_bridge_funcs);
+}
drivers/gpu/drm/cix/dptx/cix_dptx_drm.h new file +16 -0
new file mode 100644
index 000000000000..3ac57faa349e
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * CIX Sky1 DisplayPort DRM helpers
+ *
+ * Copyright 2026 Cix Technology Group Co., Ltd.
+ */
+
+#ifndef CIX_DPTX_DRM_H
+#define CIX_DPTX_DRM_H
+
+struct cix_dp;
+struct device;
+
+struct cix_dp *cix_dp_bridge_alloc(struct device *dev);
+
+#endif /* CIX_DPTX_DRM_H */
Signature · 1 line
2.25.1