Skip to contentSkip to conversation

Add Chameleon v3 video support

PATCH Superseded Paweł Anikiel 4 participants 19 messages Feb 12, 2024 – Feb 21, 2024

Subsystems (7)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover Add Chameleon v3 video support

Google Chameleon v3 is a testing device capable of emulating multiple DisplayPort monitors, used for testing purposes. It is based on an Arria 10 SoCFPGA. This patchset adds V4L2 drivers for two IP blocks used in the device's FPGA: the Chameleon v3 framebuffer, and the Intel DisplayPort RX IP. The former is a video capture device that takes video signal and writes frames into memory, which can be later processed by userspace. The latter is a DisplayPort receiver IP from Intel, its datasheet can be found at:
https://www.intel.com/programmable/technical-pdfs/683273.pdf

The framebuffer driver is a regular v4l2 capture device driver, while the DP RX driver is a v4l2 subdevice driver. In order to avoid code duplication, some parts of the DisplayPort code from the DRM subsystem were put into headers usable by the DP RX driver. Apart from that, the patchset adds a new callback to the internal v4l2 subdevice API to allow querying the dv timings of individual video streams of the DP receiver.

Paweł Anikiel (9):
media: v4l2-subdev: Add a pad variant of .query_dv_timings()
media: Add Chameleon v3 framebuffer driver
drm/dp_mst: Move DRM-independent structures to separate header
lib: Move DisplayPort CRC functions to common lib drm/display: Add mask definitions for DP_PAYLOAD_ALLOCATE_* registers
media: intel: Add Displayport RX IP driver
media: dt-bindings: Add Chameleon v3 framebuffer
media: dt-bindings: Add Intel Displayport RX IP
ARM: dts: chameleonv3: Add video device nodes

 .../bindings/media/google,chv3-fb.yaml        |   77 +
 .../devicetree/bindings/media/intel,dprx.yaml |  125 +
 .../socfpga/socfpga_arria10_chameleonv3.dts   |  130 +
 drivers/gpu/drm/display/Kconfig               |    1 +
 drivers/gpu/drm/display/drm_dp_mst_topology.c |   76 +-
 drivers/media/platform/Kconfig                |    1 +
 drivers/media/platform/Makefile               |    1 +
 drivers/media/platform/google/Kconfig         |    3 +
 drivers/media/platform/google/Makefile        |    2 +
 .../media/platform/google/chameleonv3/Kconfig |   13 +
 .../platform/google/chameleonv3/Makefile      |    3 +
 .../platform/google/chameleonv3/chv3-fb.c     |  897 +++++++
 drivers/media/platform/intel/Kconfig          |   12 +
 drivers/media/platform/intel/Makefile         |    1 +
 drivers/media/platform/intel/intel-dprx.c     | 2171 +++++++++++++++++
 drivers/media/v4l2-core/v4l2-subdev.c         |   11 +
 include/drm/display/drm_dp.h                  |    9 +-
 include/drm/display/drm_dp_mst.h              |  238 ++
 include/drm/display/drm_dp_mst_helper.h       |  232 +-
 include/linux/crc-dp.h                        |   10 +
 include/media/v4l2-subdev.h                   |    5 +
 lib/Kconfig                                   |    8 +
 lib/Makefile                                  |    1 +
 lib/crc-dp.c                                  |   78 +
 24 files changed, 3801 insertions(+), 304 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/google,chv3-fb.yaml
 create mode 100644 Documentation/devicetree/bindings/media/intel,dprx.yaml
 create mode 100644 drivers/media/platform/google/Kconfig
 create mode 100644 drivers/media/platform/google/Makefile
 create mode 100644 drivers/media/platform/google/chameleonv3/Kconfig
 create mode 100644 drivers/media/platform/google/chameleonv3/Makefile
 create mode 100644 drivers/media/platform/google/chameleonv3/chv3-fb.c
 create mode 100644 drivers/media/platform/intel/intel-dprx.c
 create mode 100644 include/drm/display/drm_dp_mst.h
 create mode 100644 include/linux/crc-dp.h
 create mode 100644 lib/crc-dp.c
Signature · 1 line
2.43.0.687.g38aa6559b0-goog
#1 lore raw

PATCH 1/9 media: v4l2-subdev: Add a pad variant of .query_dv_timings()

Currently, .query_dv_timings() is defined as a video callback without a pad argument. This is a problem if the subdevice can have different dv timings for each pad (e.g. a DisplayPort receiver with multiple virtual channels).

To solve this, add a pad variant of this callback which includes the pad number as an argument.

---
 drivers/media/v4l2-core/v4l2-subdev.c | 11 +++++++++++
 include/media/v4l2-subdev.h           |  5 +++++
 2 files changed, 16 insertions(+)
drivers/media/v4l2-core/v4l2-subdev.c +11 -0
index 4c6198c48dd6..11f865dd19b4 100644
@@ -389,6 +389,16 @@ static int call_enum_dv_timings(struct v4l2_subdev *sd,
 	       sd->ops->pad->enum_dv_timings(sd, dvt);
 }
 
+static int call_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
+				 struct v4l2_dv_timings *timings)
+{
+	if (!timings)
+		return -EINVAL;
+
+	return check_pad(sd, pad) ? :
+	       sd->ops->pad->query_dv_timings(sd, pad, timings);
+}
+
 static int call_get_mbus_config(struct v4l2_subdev *sd, unsigned int pad,
 				struct v4l2_mbus_config *config)
 {
@@ -489,6 +499,7 @@ static const struct v4l2_subdev_pad_ops v4l2_subdev_call_pad_wrappers = {
 	.set_edid		= call_set_edid,
 	.dv_timings_cap		= call_dv_timings_cap,
 	.enum_dv_timings	= call_enum_dv_timings,
+	.query_dv_timings	= call_query_dv_timings,
 	.get_frame_desc		= call_get_frame_desc,
 	.get_mbus_config	= call_get_mbus_config,
 };
include/media/v4l2-subdev.h +5 -0
index a9e6b8146279..dc8963fa5a06 100644
@@ -797,6 +797,9 @@ struct v4l2_subdev_state {
  * @enum_dv_timings: callback for VIDIOC_SUBDEV_ENUM_DV_TIMINGS() ioctl handler
  *		     code.
  *
+ * @query_dv_timings: same as query_dv_timings() from v4l2_subdev_video_ops,
+ *		      but with additional pad argument.
+ *
  * @link_validate: used by the media controller code to check if the links
  *		   that belongs to a pipeline can be used for stream.
  *
@@ -868,6 +871,8 @@ struct v4l2_subdev_pad_ops {
 			      struct v4l2_dv_timings_cap *cap);
 	int (*enum_dv_timings)(struct v4l2_subdev *sd,
 			       struct v4l2_enum_dv_timings *timings);
+	int (*query_dv_timings)(struct v4l2_subdev *sd, unsigned int pad,
+				struct v4l2_dv_timings *timings);
 #ifdef CONFIG_MEDIA_CONTROLLER
 	int (*link_validate)(struct v4l2_subdev *sd, struct media_link *link,
 			     struct v4l2_subdev_format *source_fmt,
Signature · 1 line
2.43.0.687.g38aa6559b0-goog
#2 lore raw

PATCH 2/9 media: Add Chameleon v3 framebuffer driver

In reply to Paweł Anikiel

Add v4l2 driver for the Google Chameleon v3 framebuffer device.

---
 drivers/media/platform/Kconfig                |   1 +
 drivers/media/platform/Makefile               |   1 +
 drivers/media/platform/google/Kconfig         |   3 +
 drivers/media/platform/google/Makefile        |   2 +
 .../media/platform/google/chameleonv3/Kconfig |  13 +
 .../platform/google/chameleonv3/Makefile      |   3 +
 .../platform/google/chameleonv3/chv3-fb.c     | 897 ++++++++++++++++++
 7 files changed, 920 insertions(+)
 create mode 100644 drivers/media/platform/google/Kconfig
 create mode 100644 drivers/media/platform/google/Makefile
 create mode 100644 drivers/media/platform/google/chameleonv3/Kconfig
 create mode 100644 drivers/media/platform/google/chameleonv3/Makefile
 create mode 100644 drivers/media/platform/google/chameleonv3/chv3-fb.c
drivers/media/platform/Kconfig +1 -0
index 91e54215de3a..b82f7b142b85 100644
@@ -69,6 +69,7 @@ source "drivers/media/platform/aspeed/Kconfig"
 source "drivers/media/platform/atmel/Kconfig"
 source "drivers/media/platform/cadence/Kconfig"
 source "drivers/media/platform/chips-media/Kconfig"
+source "drivers/media/platform/google/Kconfig"
 source "drivers/media/platform/intel/Kconfig"
 source "drivers/media/platform/marvell/Kconfig"
 source "drivers/media/platform/mediatek/Kconfig"
drivers/media/platform/Makefile +1 -0
index 3296ec1ebe16..f7067eb05f76 100644
@@ -12,6 +12,7 @@ obj-y += aspeed/
 obj-y += atmel/
 obj-y += cadence/
 obj-y += chips-media/
+obj-y += google/
 obj-y += intel/
 obj-y += marvell/
 obj-y += mediatek/
drivers/media/platform/google/Kconfig new file +3 -0
new file mode 100644
index 000000000000..2a5f01034c11
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+source "drivers/media/platform/google/chameleonv3/Kconfig"
drivers/media/platform/google/Makefile new file +2 -0
new file mode 100644
index 000000000000..c971a09faeb4
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+obj-y += chameleonv3/
drivers/media/platform/google/chameleonv3/Kconfig new file +13 -0
new file mode 100644
index 000000000000..76d0383a8589
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config VIDEO_CHV3_FB
+	tristate "Google Chameleon v3 framebuffer video driver"
+	depends on V4L_PLATFORM_DRIVERS
+	depends on VIDEO_DEV
+	select VIDEOBUF2_DMA_CONTIG
+	select V4L2_FWNODE
+	help
+	  v4l2 driver for the video interface present on the Google
+	  Chameleon v3. The Chameleon v3 uses the framebuffer IP core
+	  to take the video signal from different sources and directly
+	  write frames into memory.
drivers/media/platform/google/chameleonv3/Makefile new file +3 -0
new file mode 100644
index 000000000000..d63727148688
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+obj-$(CONFIG_VIDEO_CHV3_FB) += chv3-fb.o
drivers/media/platform/google/chameleonv3/chv3-fb.c new file +897 -0

897 lines not on this page · raw message

Signature · 1 line
2.43.0.687.g38aa6559b0-goog
#3 lore raw

PATCH 3/9 drm/dp_mst: Move DRM-independent structures to separate header

In reply to Paweł Anikiel

Move structures describing MST sideband messages into a separate header so that non-DRM code can use them.

---
 include/drm/display/drm_dp_mst.h        | 238 ++++++++++++++++++++++++
 include/drm/display/drm_dp_mst_helper.h | 232 +----------------------
 2 files changed, 239 insertions(+), 231 deletions(-)
 create mode 100644 include/drm/display/drm_dp_mst.h
include/drm/display/drm_dp_mst.h new file +238 -0
new file mode 100644
index 000000000000..4e398bfd3ee3
@@ -0,0 +1,238 @@
+/* SPDX-License-Identifier: MIT */
+
+#ifndef _DRM_DP_MST_H_
+#define _DRM_DP_MST_H_
+
+#include <linux/types.h>
+
+struct drm_dp_nak_reply {
+	u8 guid[16];
+	u8 reason;
+	u8 nak_data;
+};
+
+struct drm_dp_link_address_ack_reply {
+	u8 guid[16];
+	u8 nports;
+	struct drm_dp_link_addr_reply_port {
+		bool input_port;
+		u8 peer_device_type;
+		u8 port_number;
+		bool mcs;
+		bool ddps;
+		bool legacy_device_plug_status;
+		u8 dpcd_revision;
+		u8 peer_guid[16];
+		u8 num_sdp_streams;
+		u8 num_sdp_stream_sinks;
+	} ports[16];
+};
+
+struct drm_dp_remote_dpcd_read_ack_reply {
+	u8 port_number;
+	u8 num_bytes;
+	u8 bytes[255];
+};
+
+struct drm_dp_remote_dpcd_write_ack_reply {
+	u8 port_number;
+};
+
+struct drm_dp_remote_dpcd_write_nak_reply {
+	u8 port_number;
+	u8 reason;
+	u8 bytes_written_before_failure;
+};
+
+struct drm_dp_remote_i2c_read_ack_reply {
+	u8 port_number;
+	u8 num_bytes;
+	u8 bytes[255];
+};
+
+struct drm_dp_remote_i2c_read_nak_reply {
+	u8 port_number;
+	u8 nak_reason;
+	u8 i2c_nak_transaction;
+};
+
+struct drm_dp_remote_i2c_write_ack_reply {
+	u8 port_number;
+};
+
+struct drm_dp_query_stream_enc_status_ack_reply {
+	/* Bit[23:16]- Stream Id */
+	u8 stream_id;
+
+	/* Bit[15]- Signed */
+	bool reply_signed;
+
+	/* Bit[10:8]- Stream Output Sink Type */
+	bool unauthorizable_device_present;
+	bool legacy_device_present;
+	bool query_capable_device_present;
+
+	/* Bit[12:11]- Stream Output CP Type */
+	bool hdcp_1x_device_present;
+	bool hdcp_2x_device_present;
+
+	/* Bit[4]- Stream Authentication */
+	bool auth_completed;
+
+	/* Bit[3]- Stream Encryption */
+	bool encryption_enabled;
+
+	/* Bit[2]- Stream Repeater Function Present */
+	bool repeater_present;
+
+	/* Bit[1:0]- Stream State */
+	u8 state;
+};
+
+#define DRM_DP_MAX_SDP_STREAMS 16
+struct drm_dp_allocate_payload {
+	u8 port_number;
+	u8 number_sdp_streams;
+	u8 vcpi;
+	u16 pbn;
+	u8 sdp_stream_sink[DRM_DP_MAX_SDP_STREAMS];
+};
+
+struct drm_dp_allocate_payload_ack_reply {
+	u8 port_number;
+	u8 vcpi;
+	u16 allocated_pbn;
+};
+
+struct drm_dp_connection_status_notify {
+	u8 guid[16];
+	u8 port_number;
+	bool legacy_device_plug_status;
+	bool displayport_device_plug_status;
+	bool message_capability_status;
+	bool input_port;
+	u8 peer_device_type;
+};
+
+struct drm_dp_remote_dpcd_read {
+	u8 port_number;
+	u32 dpcd_address;
+	u8 num_bytes;
+};
+
+struct drm_dp_remote_dpcd_write {
+	u8 port_number;
+	u32 dpcd_address;
+	u8 num_bytes;
+	u8 *bytes;
+};
+
+#define DP_REMOTE_I2C_READ_MAX_TRANSACTIONS 4
+struct drm_dp_remote_i2c_read {
+	u8 num_transactions;
+	u8 port_number;
+	struct drm_dp_remote_i2c_read_tx {
+		u8 i2c_dev_id;
+		u8 num_bytes;
+		u8 *bytes;
+		u8 no_stop_bit;
+		u8 i2c_transaction_delay;
+	} transactions[DP_REMOTE_I2C_READ_MAX_TRANSACTIONS];
+	u8 read_i2c_device_id;
+	u8 num_bytes_read;
+};
+
+struct drm_dp_remote_i2c_write {
+	u8 port_number;
+	u8 write_i2c_device_id;
+	u8 num_bytes;
+	u8 *bytes;
+};
+
+struct drm_dp_query_stream_enc_status {
+	u8 stream_id;
+	u8 client_id[7];	/* 56-bit nonce */
+	u8 stream_event;
+	bool valid_stream_event;
+	u8 stream_behavior;
+	u8 valid_stream_behavior;
+};
+
+/* this covers ENUM_RESOURCES, POWER_DOWN_PHY, POWER_UP_PHY */
+struct drm_dp_port_number_req {
+	u8 port_number;
+};
+
+struct drm_dp_enum_path_resources_ack_reply {
+	u8 port_number;
+	bool fec_capable;
+	u16 full_payload_bw_number;
+	u16 avail_payload_bw_number;
+};
+
+/* covers POWER_DOWN_PHY, POWER_UP_PHY */
+struct drm_dp_port_number_rep {
+	u8 port_number;
+};
+
+struct drm_dp_query_payload {
+	u8 port_number;
+	u8 vcpi;
+};
+
+struct drm_dp_resource_status_notify {
+	u8 port_number;
+	u8 guid[16];
+	u16 available_pbn;
+};
+
+struct drm_dp_query_payload_ack_reply {
+	u8 port_number;
+	u16 allocated_pbn;
+};
+
+struct drm_dp_sideband_msg_req_body {
+	u8 req_type;
+	union ack_req {
+		struct drm_dp_connection_status_notify conn_stat;
+		struct drm_dp_port_number_req port_num;
+		struct drm_dp_resource_status_notify resource_stat;
+
+		struct drm_dp_query_payload query_payload;
+		struct drm_dp_allocate_payload allocate_payload;
+
+		struct drm_dp_remote_dpcd_read dpcd_read;
+		struct drm_dp_remote_dpcd_write dpcd_write;
+
+		struct drm_dp_remote_i2c_read i2c_read;
+		struct drm_dp_remote_i2c_write i2c_write;
+
+		struct drm_dp_query_stream_enc_status enc_status;
+	} u;
+};
+
+struct drm_dp_sideband_msg_reply_body {
+	u8 reply_type;
+	u8 req_type;
+	union ack_replies {
+		struct drm_dp_nak_reply nak;
+		struct drm_dp_link_address_ack_reply link_addr;
+		struct drm_dp_port_number_rep port_number;
+
+		struct drm_dp_enum_path_resources_ack_reply path_resources;
+		struct drm_dp_allocate_payload_ack_reply allocate_payload;
+		struct drm_dp_query_payload_ack_reply query_payload;
+
+		struct drm_dp_remote_dpcd_read_ack_reply remote_dpcd_read_ack;
+		struct drm_dp_remote_dpcd_write_ack_reply remote_dpcd_write_ack;
+		struct drm_dp_remote_dpcd_write_nak_reply remote_dpcd_write_nack;
+
+		struct drm_dp_remote_i2c_read_ack_reply remote_i2c_read_ack;
+		struct drm_dp_remote_i2c_read_nak_reply remote_i2c_read_nack;
+		struct drm_dp_remote_i2c_write_ack_reply remote_i2c_write_ack;
+
+		struct drm_dp_query_stream_enc_status_ack_reply enc_status;
+	} u;
+};
+
+#endif
include/drm/display/drm_dp_mst_helper.h +1 -231

244 lines not on this page · raw message

Signature · 1 line
2.43.0.687.g38aa6559b0-goog
#4 lore raw

PATCH 4/9 lib: Move DisplayPort CRC functions to common lib

In reply to Paweł Anikiel

The CRC functions found in drivers/gpu/drm/display/drm_dp_mst_topology.c may be useful for other non-DRM code that deals with DisplayPort, e.g. v4l2 drivers for DP receivers. Move these functions to /lib.

---
 drivers/gpu/drm/display/Kconfig               |  1 +
 drivers/gpu/drm/display/drm_dp_mst_topology.c | 76 ++----------------
 include/linux/crc-dp.h                        | 10 +++
 lib/Kconfig                                   |  8 ++
 lib/Makefile                                  |  1 +
 lib/crc-dp.c                                  | 78 +++++++++++++++++++
 6 files changed, 103 insertions(+), 71 deletions(-)
 create mode 100644 include/linux/crc-dp.h
 create mode 100644 lib/crc-dp.c
drivers/gpu/drm/display/Kconfig +1 -0
index 09712b88a5b8..c615f50152f2 100644
@@ -14,6 +14,7 @@ config DRM_DISPLAY_HELPER
 config DRM_DISPLAY_DP_HELPER
 	bool
 	depends on DRM_DISPLAY_HELPER
+	select CRC_DP
 	help
 	  DRM display helpers for DisplayPort.
 
drivers/gpu/drm/display/drm_dp_mst_topology.c +5 -71

112 lines not on this page · raw message

include/linux/crc-dp.h new file +10 -0
new file mode 100644
index 000000000000..b63435c82b96
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_CRC_DP_H
+#define _LINUX_CRC_DP_H
+
+#include <linux/types.h>
+
+u8 crc_dp_msg_header(const uint8_t *data, size_t num_nibbles);
+u8 crc_dp_msg_data(const uint8_t *data, u8 number_of_bytes);
+
+#endif /* _LINUX_CRC_DP_H */
lib/Kconfig +8 -0
index 5ddda7c2ed9b..28f9f6cfec9f 100644
@@ -171,6 +171,14 @@ config CRC_ITU_T
 	  the kernel tree does. Such modules that use library CRC ITU-T V.41
 	  functions require M here.
 
+config CRC_DP
+	tristate "CRC DisplayPort MST functions"
+	help
+	  This option is provided for the case where no in-kernel-tree
+	  modules require CRC DisplayPort MST functions, but a module built outside
+	  the kernel tree does. Such modules that use library CRC DisplayPort MST
+	  functions require M here.
+
 config CRC32
 	tristate "CRC32/CRC32c functions"
 	default y
lib/Makefile +1 -0
index 6b09731d8e61..e4d7ffa260b3 100644
@@ -188,6 +188,7 @@ obj-$(CONFIG_CRC7)	+= crc7.o
 obj-$(CONFIG_LIBCRC32C)	+= libcrc32c.o
 obj-$(CONFIG_CRC8)	+= crc8.o
 obj-$(CONFIG_CRC64_ROCKSOFT) += crc64-rocksoft.o
+obj-$(CONFIG_CRC_DP)	+= crc-dp.o
 obj-$(CONFIG_XXHASH)	+= xxhash.o
 obj-$(CONFIG_GENERIC_ALLOCATOR) += genalloc.o
 
lib/crc-dp.c new file +78 -0

78 lines not on this page · raw message

Signature · 1 line
2.43.0.687.g38aa6559b0-goog
#5 lore raw

PATCH 5/9 drm/display: Add mask definitions for DP_PAYLOAD_ALLOCATE_* registers

In reply to Paweł Anikiel

Each of these registers contains a single value, but not the entire 8 bits:

DP_PAYLOAD_ALLOCATE_SET - Bit 7 Reserved DP_PAYLOAD_ALLOCATE_START_TIME_SLOT - Bits 7:6 Reserved DP_PAYLOAD_ALLOCATE_TIME_SLOT_COUNT - Bits 7:6 Reserved

Add definitions to properly mask off values read from these registers.

---
 include/drm/display/drm_dp.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
include/drm/display/drm_dp.h +7 -2
index 3731828825bd..9dee30190f14 100644
@@ -733,8 +733,13 @@
 # define DP_PANEL_REPLAY_SU_ENABLE                      (1 << 6)
 
 #define DP_PAYLOAD_ALLOCATE_SET		    0x1c0
-#define DP_PAYLOAD_ALLOCATE_START_TIME_SLOT 0x1c1
-#define DP_PAYLOAD_ALLOCATE_TIME_SLOT_COUNT 0x1c2
+# define DP_PAYLOAD_ALLOCATE_SET_MASK	    0x7f
+
+#define DP_PAYLOAD_ALLOCATE_START_TIME_SLOT		0x1c1
+# define DP_PAYLOAD_ALLOCATE_START_TIME_SLOT_MASK	0x3f
+
+#define DP_PAYLOAD_ALLOCATE_TIME_SLOT_COUNT		0x1c2
+# define DP_PAYLOAD_ALLOCATE_TIME_SLOT_COUNT_MASK	0x3f
 
 /* Link/Sink Device Status */
 #define DP_SINK_COUNT			    0x200
Signature · 1 line
2.43.0.687.g38aa6559b0-goog
#6 lore raw

PATCH 6/9 media: intel: Add Displayport RX IP driver

In reply to Paweł Anikiel

Add driver for the Intel DisplayPort RX FPGA IP

---
 drivers/media/platform/intel/Kconfig      |   12 +
 drivers/media/platform/intel/Makefile     |    1 +
 drivers/media/platform/intel/intel-dprx.c | 2171 +++++++++++++++++++++
 3 files changed, 2184 insertions(+)
 create mode 100644 drivers/media/platform/intel/intel-dprx.c
drivers/media/platform/intel/Kconfig +12 -0
index 724e80a9086d..eafcd47cce68 100644
@@ -12,3 +12,15 @@ config VIDEO_PXA27x
 	select V4L2_FWNODE
 	help
 	  This is a v4l2 driver for the PXA27x Quick Capture Interface
+
+config VIDEO_INTEL_DPRX
+	tristate "Intel DisplayPort RX IP driver"
+	depends on V4L_PLATFORM_DRIVERS
+	depends on VIDEO_DEV
+	select V4L2_FWNODE
+	select CRC_DP
+	help
+	  v4l2 subdev driver for Intel Displayport receiver FPGA IP.
+	  It is a part of the DisplayPort Intel FPGA IP Core.
+	  It implements a DisplayPort 1.4 receiver capable of HBR3
+	  video capture and Multi-Stream Transport.
drivers/media/platform/intel/Makefile +1 -0
index 7e8889cbd2df..f571399f5aa8 100644
@@ -1,2 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-$(CONFIG_VIDEO_PXA27x) += pxa_camera.o
+obj-$(CONFIG_VIDEO_INTEL_DPRX) += intel-dprx.o
drivers/media/platform/intel/intel-dprx.c new file +2171 -0

2,171 lines not on this page · raw message

Signature · 1 line
2.43.0.687.g38aa6559b0-goog
#7 lore raw

PATCH 7/9 media: dt-bindings: Add Chameleon v3 framebuffer

In reply to Paweł Anikiel

The Chameleon v3 uses the framebuffer IP core to take the video signal from different sources and directly write frames into memory.

---
 .../bindings/media/google,chv3-fb.yaml        | 77 +++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/google,chv3-fb.yaml
Documentation/devicetree/bindings/media/google,chv3-fb.yaml new file +77 -0
new file mode 100644
index 000000000000..ba6643cc7232
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/google,chv3-fb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Google Chameleon v3 video framebuffer
+
+maintainers:
+  - Paweł Anikiel <[email protected]>
+
+properties:
+  compatible:
+    const: google,chv3-fb
+
+  reg:
+    items:
+      - description: core registers
+      - description: irq registers
+
+  interrupts:
+    maxItems: 1
+
+  google,legacy-format:
+    type: boolean
+    description: The incoming video stream is in 32-bit padded mode.
+
+  google,no-endpoint:
+    type: boolean
+    description:
+      The framebuffer isn't connected to a controllable endpoint.
+      The video interface still works, but EDID control is unavailable
+      and DV timing information only reports the active video width/height.
+
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+allOf:
+  - if:
+      not:
+        required:
+          - google,no-endpoint
+    then:
+      required:
+        - port
+
+additionalProperties: false
+
+examples:
+  - |
+    video@c0060500 {
+        compatible = "google,chv3-fb";
+        reg = <0xc0060500 0x100>,
+              <0xc0060f20 0x10>;
+        interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
+        google,legacy-format;
+        google,no-endpoint;
+    };
+
+  - |
+    video@c0060600 {
+        compatible = "google,chv3-fb";
+        reg = <0xc0060600 0x100>,
+              <0xc0060f30 0x10>;
+        interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
+
+        port {
+            fb_mst0_0: endpoint {
+                remote-endpoint = <&dprx_mst_0>;
+            };
+        };
+    };
Signature · 1 line
2.43.0.687.g38aa6559b0-goog
maintainer
#8 lore raw

Re: [PATCH 7/9] media: dt-bindings: Add Chameleon v3 framebuffer

Quoted 9 lines · Paweł Anikiel

The Chameleon v3 uses the framebuffer IP core to take the video signal from different sources and directly write frames into memory.

---
 .../bindings/media/google,chv3-fb.yaml        | 77 +++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/google,chv3-fb.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Error: Documentation/devicetree/bindings/media/google,chv3-fb.example.dts:28.27-28 syntax error FATAL ERROR: Unable to parse input tree
make[2]: *** [scripts/Makefile.lib:419: Documentation/devicetree/bindings/media/google,chv3-fb.example.dtb] Error 1 make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1428: dt_binding_check] Error 2
make: *** [Makefile:240: __sub-make] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

#9 lore raw

Re: [PATCH 7/9] media: dt-bindings: Add Chameleon v3 framebuffer

Quoted 37 lines · Rob Herring
Quoted 9 lines · Paweł Anikiel

The Chameleon v3 uses the framebuffer IP core to take the video signal from different sources and directly write frames into memory.

---
 .../bindings/media/google,chv3-fb.yaml        | 77 +++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/google,chv3-fb.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Error: Documentation/devicetree/bindings/media/google,chv3-fb.example.dts:28.27-28 syntax error FATAL ERROR: Unable to parse input tree
make[2]: *** [scripts/Makefile.lib:419: Documentation/devicetree/bindings/media/google,chv3-fb.example.dtb] Error 1 make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1428: dt_binding_check] Error 2
make: *** [Makefile:240: __sub-make] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

Quoted 6 lines

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

I was missing a '#include <dt-bindings/interrupt-controller/arm-gic.h>' in the dt binding example. I ran dt_binding_check after adding it and it reports no errors. I will include the fix in v2.

#10 lore raw

Re: [PATCH 7/9] media: dt-bindings: Add Chameleon v3 framebuffer

Quoted 12 lines · Paweł Anikiel
Quoted 11 lines

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

Quoted 4 lines

I was missing a '#include <dt-bindings/interrupt-controller/arm-gic.h>' in the dt binding example. I ran dt_binding_check after adding it and it reports no errors. I will include the fix in v2.

Please test the patch before sending...

Best regards,
Krzysztof

#11 lore raw

Re: [PATCH 7/9] media: dt-bindings: Add Chameleon v3 framebuffer

In reply to Paweł Anikiel
Quoted 38 lines · Paweł Anikiel

The Chameleon v3 uses the framebuffer IP core to take the video signal from different sources and directly write frames into memory.

---
 .../bindings/media/google,chv3-fb.yaml        | 77 +++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/google,chv3-fb.yaml
Documentation/devicetree/bindings/media/google,chv3-fb.yaml new file +23 -0
new file mode 100644
index 000000000000..ba6643cc7232
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/google,chv3-fb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Google Chameleon v3 video framebuffer
+
+maintainers:
+  - Paweł Anikiel <[email protected]>
+
+properties:
+  compatible:
+    const: google,chv3-fb
+
+  reg:
+    items:
+      - description: core registers
+      - description: irq registers
+
+  interrupts:
+    maxItems: 1
+

Documentation/devicetree/bindings/media/google,chv3-fb.yaml line 33

Quoted 10 lines
Documentation/devicetree/bindings/media/google,chv3-fb.yaml new file +10 -0
+  google,legacy-format:
+    type: boolean
+    description: The incoming video stream is in 32-bit padded mode.
+
+  google,no-endpoint:
+    type: boolean
+    description:
+      The framebuffer isn't connected to a controllable endpoint.
+      The video interface still works, but EDID control is unavailable
+      and DV timing information only reports the active video width/height.

Why does this need a dedicated property? Is it not sufficient to check that there are no endpoints in the devicetree?

Cheers,
Conor.

Quoted 47 lines
Documentation/devicetree/bindings/media/google,chv3-fb.yaml new file +44 -0
+
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+allOf:
+  - if:
+      not:
+        required:
+          - google,no-endpoint
+    then:
+      required:
+        - port
+
+additionalProperties: false
+
+examples:
+  - |
+    video@c0060500 {
+        compatible = "google,chv3-fb";
+        reg = <0xc0060500 0x100>,
+              <0xc0060f20 0x10>;
+        interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
+        google,legacy-format;
+        google,no-endpoint;
+    };
+
+  - |
+    video@c0060600 {
+        compatible = "google,chv3-fb";
+        reg = <0xc0060600 0x100>,
+              <0xc0060f30 0x10>;
+        interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
+
+        port {
+            fb_mst0_0: endpoint {
+                remote-endpoint = <&dprx_mst_0>;
+            };
+        };
+    };
Signature · 1 line
2.43.0.687.g38aa6559b0-goog
#12 lore raw

Re: [PATCH 7/9] media: dt-bindings: Add Chameleon v3 framebuffer

Quoted 45 lines · Conor Dooley
Quoted 43 lines · Paweł Anikiel

The Chameleon v3 uses the framebuffer IP core to take the video signal from different sources and directly write frames into memory.

---
 .../bindings/media/google,chv3-fb.yaml        | 77 +++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/google,chv3-fb.yaml
Documentation/devicetree/bindings/media/google,chv3-fb.yaml new file +28 -0
new file mode 100644
index 000000000000..ba6643cc7232
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/google,chv3-fb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Google Chameleon v3 video framebuffer
+
+maintainers:
+  - Paweł Anikiel <[email protected]>
+
+properties:
+  compatible:
+    const: google,chv3-fb
+
+  reg:
+    items:
+      - description: core registers
+      - description: irq registers
+
+  interrupts:
+    maxItems: 1
+
+  google,legacy-format:
+    type: boolean
+    description: The incoming video stream is in 32-bit padded mode.
+
+  google,no-endpoint:
Quoted 8 lines

Documentation/devicetree/bindings/media/google,chv3-fb.yaml line 33

Quoted 5 lines
Documentation/devicetree/bindings/media/google,chv3-fb.yaml new file +5 -0
+    type: boolean
+    description:
+      The framebuffer isn't connected to a controllable endpoint.
+      The video interface still works, but EDID control is unavailable
+      and DV timing information only reports the active video width/height.

Why does this need a dedicated property? Is it not sufficient to check that there are no endpoints in the devicetree?

Yes, I think it is sufficient. I removed the property and added a check in the driver in v2.

#13 lore raw

PATCH 8/9 media: dt-bindings: Add Intel Displayport RX IP

In reply to Paweł Anikiel

The Intel Displayport RX IP is a part of the DisplayPort Intel FPGA IP Core. It implements a DisplayPort 1.4 receiver capable of HBR3 video capture and Multi-Stream Transport. The user guide can be found here:

https://www.intel.com/programmable/technical-pdfs/683273.pdf

---
 .../devicetree/bindings/media/intel,dprx.yaml | 125 ++++++++++++++++++
 1 file changed, 125 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/intel,dprx.yaml
Documentation/devicetree/bindings/media/intel,dprx.yaml new file +125 -0
new file mode 100644
index 000000000000..3ed37e0a4a94
@@ -0,0 +1,125 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/intel,dprx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel DisplayPort RX IP
+
+maintainers:
+  - Paweł Anikiel <[email protected]>
+
+properties:
+  compatible:
+    const: intel,dprx
+
+  reg:
+    items:
+      - description: core registers
+      - description: irq registers
+
+  interrupts:
+    maxItems: 1
+
+  intel,has-mst:
+    type: boolean
+    description: The device supports Multi-Stream Transport
+
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+    description: SST main link
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: MST virtual channel 0 or SST main link
+
+      port@1:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: MST virtual channel 1
+
+      port@2:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: MST virtual channel 2
+
+      port@3:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: MST virtual channel 3
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+allOf:
+  - if:
+      required:
+        - intel,has-mst
+    then:
+      required:
+        - ports
+    else:
+      required:
+        - port
+
+additionalProperties: false
+
+examples:
+  - |
+    dprx@c0062000 {
+        compatible = "intel,dprx";
+        reg = <0xc0062000 0x800>,
+              <0xc0060f80 0x10>;
+        interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
+        intel,has-mst;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+                dprx_mst_0: endpoint {
+                    remote-endpoint = <&fb_mst0_0>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                dprx_mst_1: endpoint {
+                    remote-endpoint = <&fb_mst1_0>;
+                };
+            };
+
+            port@2 {
+                reg = <2>;
+                dprx_mst_2: endpoint {
+                    remote-endpoint = <&fb_mst2_0>;
+                };
+            };
+
+            port@3 {
+                reg = <3>;
+                dprx_mst_3: endpoint {
+                    remote-endpoint = <&fb_mst3_0>;
+                };
+            };
+        };
+    };
+
+  - |
+    dprx@c0064000 {
+        compatible = "intel,dprx";
+        reg = <0xc0064000 0x800>,
+              <0xc0060fe0 0x10>;
+        interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+
+        port {
+            dprx_sst_0: endpoint {
+                remote-endpoint = <&fb_sst_0>;
+            };
+        };
+    };
Signature · 1 line
2.43.0.687.g38aa6559b0-goog
maintainer
#14 lore raw

Re: [PATCH 8/9] media: dt-bindings: Add Intel Displayport RX IP

Quoted 4 lines · Paweł Anikiel

The Intel Displayport RX IP is a part of the DisplayPort Intel FPGA IP Core. It implements a DisplayPort 1.4 receiver capable of HBR3 video capture and Multi-Stream Transport. The user guide can be found here:

Quoted 8 lines

https://www.intel.com/programmable/technical-pdfs/683273.pdf

---
 .../devicetree/bindings/media/intel,dprx.yaml | 125 ++++++++++++++++++
 1 file changed, 125 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/intel,dprx.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Error: Documentation/devicetree/bindings/media/intel,dprx.example.dts:28.27-28 syntax error make[2]: *** [scripts/Makefile.lib:419: Documentation/devicetree/bindings/media/intel,dprx.example.dtb] Error 1

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

#15 lore raw

Re: [PATCH 8/9] media: dt-bindings: Add Intel Displayport RX IP

Quoted 36 lines · Rob Herring
Quoted 4 lines · Paweł Anikiel

The Intel Displayport RX IP is a part of the DisplayPort Intel FPGA IP Core. It implements a DisplayPort 1.4 receiver capable of HBR3 video capture and Multi-Stream Transport. The user guide can be found here:

Quoted 8 lines

https://www.intel.com/programmable/technical-pdfs/683273.pdf

---
 .../devicetree/bindings/media/intel,dprx.yaml | 125 ++++++++++++++++++
 1 file changed, 125 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/intel,dprx.yaml

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Error: Documentation/devicetree/bindings/media/intel,dprx.example.dts:28.27-28 syntax error make[2]: *** [scripts/Makefile.lib:419: Documentation/devicetree/bindings/media/intel,dprx.example.dtb] Error 1

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

Quoted 6 lines

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.

As with the previous patch, I was missing a #include in the example. I will include the fix in v2.

#16 lore raw

Re: [PATCH 8/9] media: dt-bindings: Add Intel Displayport RX IP

In reply to Paweł Anikiel

Yo,

Quoted 22 lines · Paweł Anikiel

The Intel Displayport RX IP is a part of the DisplayPort Intel FPGA IP Core. It implements a DisplayPort 1.4 receiver capable of HBR3 video capture and Multi-Stream Transport. The user guide can be found here:

https://www.intel.com/programmable/technical-pdfs/683273.pdf

---
 .../devicetree/bindings/media/intel,dprx.yaml | 125 ++++++++++++++++++
 1 file changed, 125 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/intel,dprx.yaml
Documentation/devicetree/bindings/media/intel,dprx.yaml new file +4 -0
new file mode 100644
index 000000000000..3ed37e0a4a94
@@ -0,0 +1,125 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/intel,dprx.yaml#

Documentation/devicetree/bindings/media/intel,dprx.yaml line 14

Quoted 10 lines
Documentation/devicetree/bindings/media/intel,dprx.yaml new file +10 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel DisplayPort RX IP
+
+maintainers:
+  - Paweł Anikiel <[email protected]>
+
+properties:
+  compatible:
+    const: intel,dprx

Please version this compatible, given that is it for an FPGA IP. I could not find an example of another intel IP that had versioning, but there's plenty of xilinx stuff you can get inspiration from.

Documentation/devicetree/bindings/media/intel,dprx.yaml line 24

Quoted 9 lines
Documentation/devicetree/bindings/media/intel,dprx.yaml new file +9 -0
+  reg:
+    items:
+      - description: core registers
+      - description: irq registers
+
+  interrupts:
+    maxItems: 1
+
+  intel,has-mst:

Mostly this looks fine, but this property drew my eye. Firstly, I'd probably call this "intel,multi-stream-support" rather than "intel,has-mst".

Documentation/devicetree/bindings/media/intel,dprx.yaml line 26

Quoted 2 lines
Documentation/devicetree/bindings/media/intel,dprx.yaml new file +2 -0
+    type: boolean
+    description: The device supports Multi-Stream Transport

Secondly, there are many many configuration parameters for this IP, but you have chosen to document just one.
Are all other configuration parameters currently in their default states or ignored by the driver? If not, please at least document all configuration settings that you rely on - for example the max stream count or audio packet encoding.

Quoted 36 lines
Documentation/devicetree/bindings/media/intel,dprx.yaml new file +36 -0
+
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+    description: SST main link
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: MST virtual channel 0 or SST main link
+
+      port@1:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: MST virtual channel 1
+
+      port@2:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: MST virtual channel 2
+
+      port@3:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: MST virtual channel 3
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+allOf:
+  - if:
+      required:
+        - intel,has-mst
+    then:
+      required:

Documentation/devicetree/bindings/media/intel,dprx.yaml line 72

Quoted 10 lines
Documentation/devicetree/bindings/media/intel,dprx.yaml new file +10 -0
+        - ports
+    else:
+      required:
+        - port
+
+additionalProperties: false
+
+examples:
+  - |
+    dprx@c0062000 {

"dprx" isn't a class of device, please try to use a generic node name here.

Thanks,
Conor.

Quoted 56 lines
Documentation/devicetree/bindings/media/intel,dprx.yaml new file +53 -0
+        compatible = "intel,dprx";
+        reg = <0xc0062000 0x800>,
+              <0xc0060f80 0x10>;
+        interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
+        intel,has-mst;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+                dprx_mst_0: endpoint {
+                    remote-endpoint = <&fb_mst0_0>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                dprx_mst_1: endpoint {
+                    remote-endpoint = <&fb_mst1_0>;
+                };
+            };
+
+            port@2 {
+                reg = <2>;
+                dprx_mst_2: endpoint {
+                    remote-endpoint = <&fb_mst2_0>;
+                };
+            };
+
+            port@3 {
+                reg = <3>;
+                dprx_mst_3: endpoint {
+                    remote-endpoint = <&fb_mst3_0>;
+                };
+            };
+        };
+    };
+
+  - |
+    dprx@c0064000 {
+        compatible = "intel,dprx";
+        reg = <0xc0064000 0x800>,
+              <0xc0060fe0 0x10>;
+        interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+
+        port {
+            dprx_sst_0: endpoint {
+                remote-endpoint = <&fb_sst_0>;
+            };
+        };
+    };
Signature · 1 line
2.43.0.687.g38aa6559b0-goog
#17 lore raw

Re: [PATCH 8/9] media: dt-bindings: Add Intel Displayport RX IP

Quoted 32 lines · Conor Dooley

Yo,

Quoted 28 lines · Paweł Anikiel

The Intel Displayport RX IP is a part of the DisplayPort Intel FPGA IP Core. It implements a DisplayPort 1.4 receiver capable of HBR3 video capture and Multi-Stream Transport. The user guide can be found here:

https://www.intel.com/programmable/technical-pdfs/683273.pdf

---
 .../devicetree/bindings/media/intel,dprx.yaml | 125 ++++++++++++++++++
 1 file changed, 125 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/intel,dprx.yaml
Documentation/devicetree/bindings/media/intel,dprx.yaml new file +10 -0
new file mode 100644
index 000000000000..3ed37e0a4a94
@@ -0,0 +1,125 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/intel,dprx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intel DisplayPort RX IP
+
+maintainers:
+  - Paweł Anikiel <[email protected]>
Quoted 8 lines

Documentation/devicetree/bindings/media/intel,dprx.yaml line 14

Quoted 4 lines
Documentation/devicetree/bindings/media/intel,dprx.yaml new file +4 -0
+
+properties:
+  compatible:
+    const: intel,dprx

Please version this compatible, given that is it for an FPGA IP. I could not find an example of another intel IP that had versioning, but there's plenty of xilinx stuff you can get inspiration from.

The IP has had a few different revisions, so I decided to just use the "IP version" which is 20.0.1 for the version this driver is targeting.

Quoted 14 lines

Documentation/devicetree/bindings/media/intel,dprx.yaml line 24

Quoted 10 lines
Documentation/devicetree/bindings/media/intel,dprx.yaml new file +9 -0
+  reg:
+    items:
+      - description: core registers
+      - description: irq registers
+
+  interrupts:
+    maxItems: 1
+
+  intel,has-mst:

Mostly this looks fine, but this property drew my eye. Firstly, I'd probably call this "intel,multi-stream-support" rather than "intel,has-mst".

Sure,

Quoted 10 lines

Documentation/devicetree/bindings/media/intel,dprx.yaml line 26

Quoted 3 lines
Documentation/devicetree/bindings/media/intel,dprx.yaml new file +2 -0
+    type: boolean
+    description: The device supports Multi-Stream Transport

Secondly, there are many many configuration parameters for this IP, but you have chosen to document just one.
Are all other configuration parameters currently in their default states or ignored by the driver? If not, please at least document all configuration settings that you rely on - for example the max stream count or audio packet encoding.

I looked at all the parameters listed in the user guide, and most of them don't affect the driver. I listed the ones which are required, and added support for the remaining ones in v2.

Quoted 42 lines
Quoted 42 lines
Documentation/devicetree/bindings/media/intel,dprx.yaml new file +41 -0
+
+  port:
+    $ref: /schemas/graph.yaml#/properties/port
+    description: SST main link
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: MST virtual channel 0 or SST main link
+
+      port@1:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: MST virtual channel 1
+
+      port@2:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: MST virtual channel 2
+
+      port@3:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: MST virtual channel 3
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+allOf:
+  - if:
+      required:
+        - intel,has-mst
+    then:
+      required:
+        - ports
+    else:
+      required:
+        - port
+
Quoted 8 lines

Documentation/devicetree/bindings/media/intel,dprx.yaml line 72

Quoted 5 lines
Documentation/devicetree/bindings/media/intel,dprx.yaml new file +5 -0
+additionalProperties: false
+
+examples:
+  - |
+    dprx@c0062000 {

"dprx" isn't a class of device, please try to use a generic node name here.

I couldn't find anything in the DT spec or any other similar examples, so I chose dp-receiver.

#18 lore raw

PATCH 9/9 ARM: dts: chameleonv3: Add video device nodes

In reply to Paweł Anikiel

Add device nodes for the video system present on the Chameleon v3. It consists of six framebuffers and two Intel Displayport receivers.

---
 .../socfpga/socfpga_arria10_chameleonv3.dts   | 130 ++++++++++++++++++
 1 file changed, 130 insertions(+)
arch/arm/boot/dts/intel/socfpga/socfpga_arria10_chameleonv3.dts +130 -0
index 422d00cd4c74..9bc0c1672b18 100644
@@ -10,6 +10,136 @@ / {
 	compatible = "google,chameleon-v3", "enclustra,mercury-aa1",
 		     "altr,socfpga-arria10", "altr,socfpga";
 
+	soc {
+		fb0: video@c0060500 {
+			compatible = "google,chv3-fb";
+			reg = <0xc0060500 0x100>,
+			      <0xc0060f20 0x10>;
+			interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
+			google,legacy-format;
+			google,no-endpoint;
+		};
+
+		fb_mst0: video@c0060600 {
+			compatible = "google,chv3-fb";
+			reg = <0xc0060600 0x100>,
+			      <0xc0060f30 0x10>;
+			interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
+
+			port {
+				fb_mst0_0: endpoint {
+					remote-endpoint = <&dprx_mst_0>;
+				};
+			};
+		};
+
+		fb_mst1: video@c0060700 {
+			compatible = "google,chv3-fb";
+			reg = <0xc0060700 0x100>,
+			      <0xc0060f40 0x10>;
+			interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
+
+			port {
+				fb_mst1_0: endpoint {
+					remote-endpoint = <&dprx_mst_1>;
+				};
+			};
+		};
+
+		fb_mst2: video@c0060800 {
+			compatible = "google,chv3-fb";
+			reg = <0xc0060800 0x100>,
+			      <0xc0060f50 0x10>;
+			interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
+
+			port {
+				fb_mst2_0: endpoint {
+					remote-endpoint = <&dprx_mst_2>;
+				};
+			};
+		};
+
+		fb_mst3: video@c0060900 {
+			compatible = "google,chv3-fb";
+			reg = <0xc0060900 0x100>,
+			      <0xc0060f60 0x10>;
+			interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+
+			port {
+				fb_mst3_0: endpoint {
+					remote-endpoint = <&dprx_mst_3>;
+				};
+			};
+		};
+
+		fb_sst: video@c0060a00 {
+			compatible = "google,chv3-fb";
+			reg = <0xc0060a00 0x100>,
+			      <0xc0060f70 0x10>;
+			interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
+
+			port {
+				fb_sst_0: endpoint {
+					remote-endpoint = <&dprx_sst_0>;
+				};
+			};
+		};
+
+		dprx_mst: dprx@c0062000 {
+			compatible = "intel,dprx";
+			reg = <0xc0062000 0x800>,
+			      <0xc0060f80 0x10>;
+			interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
+			intel,has-mst;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+					dprx_mst_0: endpoint {
+						remote-endpoint = <&fb_mst0_0>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+					dprx_mst_1: endpoint {
+						remote-endpoint = <&fb_mst1_0>;
+					};
+				};
+
+				port@2 {
+					reg = <2>;
+					dprx_mst_2: endpoint {
+						remote-endpoint = <&fb_mst2_0>;
+					};
+				};
+
+				port@3 {
+					reg = <3>;
+					dprx_mst_3: endpoint {
+						remote-endpoint = <&fb_mst3_0>;
+					};
+				};
+			};
+		};
+
+		dprx_sst: dprx@c0064000 {
+			compatible = "intel,dprx";
+			reg = <0xc0064000 0x800>,
+			      <0xc0060fe0 0x10>;
+			interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+
+			port {
+				dprx_sst_0: endpoint {
+					remote-endpoint = <&fb_sst_0>;
+				};
+			};
+		};
+	};
+
 	aliases {
 		serial0 = &uart0;
 		i2c0 = &i2c0;
Signature · 1 line
2.43.0.687.g38aa6559b0-goog