Skip to contentSkip to conversation

video: bridge-uclass: add get_display_timing ops

PATCH Superseded Svyatoslav Ryhel 2 participants 9 messages Feb 15, 2025 – Feb 16, 2025 Framebuffer layer

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover video: bridge-uclass: add get_display_timing ops

Add get_display_timing ops for internal bridges linked to panels that do not support EDID (MIPI-DSI panels for example) or have EDID not routed.

Svyatoslav Ryhel (1):
video: bridge-uclass: add get_display_timing ops

 drivers/video/bridge/video-bridge-uclass.c | 11 +++++++++++
 include/video_bridge.h                     | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/1 video: bridge-uclass: add get_display_timing ops

Add get_display_timing ops for internal bridges linked to panels that do not support EDID (MIPI-DSI panels for example) or have EDID not routed.

---
 drivers/video/bridge/video-bridge-uclass.c | 11 +++++++++++
 include/video_bridge.h                     | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)
drivers/video/bridge/video-bridge-uclass.c +11 -0
index 2084a2e03ee..1b8aa12b9e8 100644
@@ -33,6 +33,17 @@ int video_bridge_attach(struct udevice *dev)
 	return ops->attach(dev);
 }
 
+int video_bridge_get_display_timing(struct udevice *dev,
+				    struct display_timing *timings)
+{
+	struct video_bridge_ops *ops = video_bridge_get_ops(dev);
+
+	if (!ops->get_display_timing)
+		return -ENOSYS;
+
+	return ops->get_display_timing(dev, timings);
+}
+
 int video_bridge_check_attached(struct udevice *dev)
 {
 	struct video_bridge_priv *uc_priv = dev_get_uclass_priv(dev);
include/video_bridge.h +18 -0
index 3b429eac578..3860bf2cfee 100644
@@ -53,6 +53,16 @@ struct video_bridge_ops {
 	 */
 	int (*set_backlight)(struct udevice *dev, int percent);
 
+	/**
+	 * get_display_timing() - Get display timings from bridge.
+	 *
+	 * @dev:	Bridge device containing the linked display timings
+	 * @tim:	Place to put timings
+	 * @return 0 if OK, -ve on error
+	 */
+	int (*get_display_timing)(struct udevice *dev,
+				  struct display_timing *timing);
+
 	/**
 	 * read_edid() - Read information from EDID
 	 *
@@ -98,6 +108,14 @@ int video_bridge_set_active(struct udevice *dev, bool active);
  */
 int video_bridge_check_attached(struct udevice *dev);
 
+/**
+ * video_bridge_get_display_timing() - Get display timings from bridge.
+ *
+ * @dev:	Bridge device containing the linked display timings
+ * Return: 0 if OK, -ve on error
+ */
+int video_bridge_get_display_timing(struct udevice *dev,
+				    struct display_timing *timing);
 /**
  * video_bridge_read_edid() - Read information from EDID
  *
Signature · 1 line
2.43.0
#2 lore raw

Hi Svyatoslav,

Quoted 10 lines · Svyatoslav Ryhel

Add get_display_timing ops for internal bridges linked to panels that do not support EDID (MIPI-DSI panels for example) or have EDID not routed.

---
 drivers/video/bridge/video-bridge-uclass.c | 11 +++++++++++
 include/video_bridge.h                     | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)

This should have a test, e.g. in test/dm/video.c or similar.

Quoted 60 lines
drivers/video/bridge/video-bridge-uclass.c +11 -0
index 2084a2e03ee..1b8aa12b9e8 100644
@@ -33,6 +33,17 @@ int video_bridge_attach(struct udevice *dev)
        return ops->attach(dev);
 }
 
+int video_bridge_get_display_timing(struct udevice *dev,
+                                   struct display_timing *timings)
+{
+       struct video_bridge_ops *ops = video_bridge_get_ops(dev);
+
+       if (!ops->get_display_timing)
+               return -ENOSYS;
+
+       return ops->get_display_timing(dev, timings);
+}
+
 int video_bridge_check_attached(struct udevice *dev)
 {
        struct video_bridge_priv *uc_priv = dev_get_uclass_priv(dev);
include/video_bridge.h +18 -1
index 3b429eac578..3860bf2cfee 100644
@@ -53,6 +53,16 @@ struct video_bridge_ops {
         */
        int (*set_backlight)(struct udevice *dev, int percent);
 
+       /**
+        * get_display_timing() - Get display timings from bridge.
+        *
+        * @dev:        Bridge device containing the linked display timings
+        * @tim:        Place to put timings
+        * @return 0 if OK, -ve on error
+        */
+       int (*get_display_timing)(struct udevice *dev,
+                                 struct display_timing *timing);
+
        /**
         * read_edid() - Read information from EDID
         *
@@ -98,6 +108,14 @@ int video_bridge_set_active(struct udevice *dev, bool active);
  */
 int video_bridge_check_attached(struct udevice *dev);
 
+/**
+ * video_bridge_get_display_timing() - Get display timings from bridge.
+ *
+ * @dev:       Bridge device containing the linked display timings
+ * Return: 0 if OK, -ve on error
+ */
+int video_bridge_get_display_timing(struct udevice *dev,
+                                   struct display_timing *timing);
 /**
  * video_bridge_read_edid() - Read information from EDID
  *
--
Quoted 2 lines

2.43.0

Regards,
Simon

#3 lore raw

сб, 15 лют. 2025 р. о 19:24 Simon Glass <[email protected]> пише:

Quoted 9 lines

Hi Svyatoslav,

Quoted 5 lines · Svyatoslav Ryhel

Add get_display_timing ops for internal bridges linked to panels that do not support EDID (MIPI-DSI panels for example) or have EDID not routed.

Quoted 8 lines
Quoted 5 lines
---
 drivers/video/bridge/video-bridge-uclass.c | 11 +++++++++++
 include/video_bridge.h                     | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)

This should have a test, e.g. in test/dm/video.c or similar.

I totally agree, but it seems that there is no tests for UCLASS_VIDEO_BRIDGE unless I am missing smth. May you pls point me to it? Maybe I can add simple bridge analog of linux driver as sandbox test case?

Quoted 65 lines
Quoted 60 lines
drivers/video/bridge/video-bridge-uclass.c +11 -0
index 2084a2e03ee..1b8aa12b9e8 100644
@@ -33,6 +33,17 @@ int video_bridge_attach(struct udevice *dev)
        return ops->attach(dev);
 }
 
+int video_bridge_get_display_timing(struct udevice *dev,
+                                   struct display_timing *timings)
+{
+       struct video_bridge_ops *ops = video_bridge_get_ops(dev);
+
+       if (!ops->get_display_timing)
+               return -ENOSYS;
+
+       return ops->get_display_timing(dev, timings);
+}
+
 int video_bridge_check_attached(struct udevice *dev)
 {
        struct video_bridge_priv *uc_priv = dev_get_uclass_priv(dev);
include/video_bridge.h +18 -1
index 3b429eac578..3860bf2cfee 100644
@@ -53,6 +53,16 @@ struct video_bridge_ops {
         */
        int (*set_backlight)(struct udevice *dev, int percent);
 
+       /**
+        * get_display_timing() - Get display timings from bridge.
+        *
+        * @dev:        Bridge device containing the linked display timings
+        * @tim:        Place to put timings
+        * @return 0 if OK, -ve on error
+        */
+       int (*get_display_timing)(struct udevice *dev,
+                                 struct display_timing *timing);
+
        /**
         * read_edid() - Read information from EDID
         *
@@ -98,6 +108,14 @@ int video_bridge_set_active(struct udevice *dev, bool active);
  */
 int video_bridge_check_attached(struct udevice *dev);
 
+/**
+ * video_bridge_get_display_timing() - Get display timings from bridge.
+ *
+ * @dev:       Bridge device containing the linked display timings
+ * Return: 0 if OK, -ve on error
+ */
+int video_bridge_get_display_timing(struct udevice *dev,
+                                   struct display_timing *timing);
 /**
  * video_bridge_read_edid() - Read information from EDID
  *
--
Quoted 2 lines

2.43.0

Regards,
Simon

#4 lore raw

Hi Svyatoslav,

Quoted 17 lines · Svyatoslav Ryhel

сб, 15 лют. 2025 р. о 19:24 Simon Glass <[email protected]> пише:

Quoted 15 lines

Hi Svyatoslav,

Quoted 10 lines · Svyatoslav Ryhel

Add get_display_timing ops for internal bridges linked to panels that do not support EDID (MIPI-DSI panels for example) or have EDID not routed.

---
 drivers/video/bridge/video-bridge-uclass.c | 11 +++++++++++
 include/video_bridge.h                     | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)
Quoted 7 lines
Quoted 2 lines

This should have a test, e.g. in test/dm/video.c or similar.

I totally agree, but it seems that there is no tests for UCLASS_VIDEO_BRIDGE unless I am missing smth. May you pls point me to it? Maybe I can add simple bridge analog of linux driver as sandbox test case?

Oh dear, that's my fault. Yes, please add something simple.

Quoted 58 lines
Quoted 58 lines
Quoted 58 lines
drivers/video/bridge/video-bridge-uclass.c +11 -0
index 2084a2e03ee..1b8aa12b9e8 100644
@@ -33,6 +33,17 @@ int video_bridge_attach(struct udevice *dev)
        return ops->attach(dev);
 }
 
+int video_bridge_get_display_timing(struct udevice *dev,
+                                   struct display_timing *timings)
+{
+       struct video_bridge_ops *ops = video_bridge_get_ops(dev);
+
+       if (!ops->get_display_timing)
+               return -ENOSYS;
+
+       return ops->get_display_timing(dev, timings);
+}
+
 int video_bridge_check_attached(struct udevice *dev)
 {
        struct video_bridge_priv *uc_priv = dev_get_uclass_priv(dev);
include/video_bridge.h +18 -0
index 3b429eac578..3860bf2cfee 100644
@@ -53,6 +53,16 @@ struct video_bridge_ops {
         */
        int (*set_backlight)(struct udevice *dev, int percent);
 
+       /**
+        * get_display_timing() - Get display timings from bridge.
+        *
+        * @dev:        Bridge device containing the linked display timings
+        * @tim:        Place to put timings
+        * @return 0 if OK, -ve on error
+        */
+       int (*get_display_timing)(struct udevice *dev,
+                                 struct display_timing *timing);
+
        /**
         * read_edid() - Read information from EDID
         *
@@ -98,6 +108,14 @@ int video_bridge_set_active(struct udevice *dev, bool active);
  */
 int video_bridge_check_attached(struct udevice *dev);
 
+/**
+ * video_bridge_get_display_timing() - Get display timings from bridge.
+ *
+ * @dev:       Bridge device containing the linked display timings
+ * Return: 0 if OK, -ve on error
+ */
+int video_bridge_get_display_timing(struct udevice *dev,
+                                   struct display_timing *timing);
 /**
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
include/video_bridge.h +0 -1
  * video_bridge_read_edid() - Read information from EDID
  *
--

2.43.0

Regards,
Simon

Regards,
Simon

#5 lore raw

сб, 15 лют. 2025 р. о 20:07 Simon Glass <[email protected]> пише:

Quoted 24 lines

Hi Svyatoslav,

Quoted 20 lines · Svyatoslav Ryhel

сб, 15 лют. 2025 р. о 19:24 Simon Glass <[email protected]> пише:

Quoted 17 lines

Hi Svyatoslav,

Quoted 10 lines · Svyatoslav Ryhel

Add get_display_timing ops for internal bridges linked to panels that do not support EDID (MIPI-DSI panels for example) or have EDID not routed.

---
 drivers/video/bridge/video-bridge-uclass.c | 11 +++++++++++
 include/video_bridge.h                     | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)

This should have a test, e.g. in test/dm/video.c or similar.

Quoted 7 lines
Quoted 4 lines

I totally agree, but it seems that there is no tests for UCLASS_VIDEO_BRIDGE unless I am missing smth. May you pls point me to it? Maybe I can add simple bridge analog of linux driver as sandbox test case?

Oh dear, that's my fault. Yes, please add something simple.

Surely, but I would need ofnode graph merged in first. Then I can add simple bridge and lvds encoder in linux style. And convert simple panel to be able to work with graph. I assume that would be correct course.

Quoted 69 lines
Quoted 58 lines
Quoted 58 lines
Quoted 58 lines
drivers/video/bridge/video-bridge-uclass.c +11 -0
index 2084a2e03ee..1b8aa12b9e8 100644
@@ -33,6 +33,17 @@ int video_bridge_attach(struct udevice *dev)
        return ops->attach(dev);
 }
 
+int video_bridge_get_display_timing(struct udevice *dev,
+                                   struct display_timing *timings)
+{
+       struct video_bridge_ops *ops = video_bridge_get_ops(dev);
+
+       if (!ops->get_display_timing)
+               return -ENOSYS;
+
+       return ops->get_display_timing(dev, timings);
+}
+
 int video_bridge_check_attached(struct udevice *dev)
 {
        struct video_bridge_priv *uc_priv = dev_get_uclass_priv(dev);
include/video_bridge.h +18 -0
index 3b429eac578..3860bf2cfee 100644
@@ -53,6 +53,16 @@ struct video_bridge_ops {
         */
        int (*set_backlight)(struct udevice *dev, int percent);
 
+       /**
+        * get_display_timing() - Get display timings from bridge.
+        *
+        * @dev:        Bridge device containing the linked display timings
+        * @tim:        Place to put timings
+        * @return 0 if OK, -ve on error
+        */
+       int (*get_display_timing)(struct udevice *dev,
+                                 struct display_timing *timing);
+
        /**
         * read_edid() - Read information from EDID
         *
@@ -98,6 +108,14 @@ int video_bridge_set_active(struct udevice *dev, bool active);
  */
 int video_bridge_check_attached(struct udevice *dev);
 
+/**
+ * video_bridge_get_display_timing() - Get display timings from bridge.
+ *
+ * @dev:       Bridge device containing the linked display timings
+ * Return: 0 if OK, -ve on error
+ */
+int video_bridge_get_display_timing(struct udevice *dev,
+                                   struct display_timing *timing);
 /**
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
include/video_bridge.h +0 -1
  * video_bridge_read_edid() - Read information from EDID
  *
--

2.43.0

Regards,
Simon

Regards,
Simon

#6 lore raw

Hi Svyatoslav,

Quoted 31 lines · Svyatoslav Ryhel

сб, 15 лют. 2025 р. о 20:07 Simon Glass <[email protected]> пише:

Quoted 29 lines

Hi Svyatoslav,

Quoted 24 lines · Svyatoslav Ryhel

сб, 15 лют. 2025 р. о 19:24 Simon Glass <[email protected]> пише:

Quoted 9 lines

Hi Svyatoslav,

Quoted 5 lines · Svyatoslav Ryhel

Add get_display_timing ops for internal bridges linked to panels that do not support EDID (MIPI-DSI panels for example) or have EDID not routed.

Quoted 8 lines
Quoted 5 lines
---
 drivers/video/bridge/video-bridge-uclass.c | 11 +++++++++++
 include/video_bridge.h                     | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)

This should have a test, e.g. in test/dm/video.c or similar.

I totally agree, but it seems that there is no tests for UCLASS_VIDEO_BRIDGE unless I am missing smth. May you pls point me to it? Maybe I can add simple bridge analog of linux driver as sandbox test case?

Quoted 7 lines
Quoted 2 lines

Oh dear, that's my fault. Yes, please add something simple.

Surely, but I would need ofnode graph merged in first. Then I can add simple bridge and lvds encoder in linux style. And convert simple panel to be able to work with graph. I assume that would be correct course.

Ultimately yes, but you could add a very simple video-bridge test to start, that just gets a device and calls a driver method?

Regards,
Simon

#7 lore raw

нд, 16 лют. 2025 р. о 14:56 Simon Glass <[email protected]> пише:

Quoted 38 lines

Hi Svyatoslav,

Quoted 34 lines · Svyatoslav Ryhel

сб, 15 лют. 2025 р. о 20:07 Simon Glass <[email protected]> пише:

Quoted 31 lines

Hi Svyatoslav,

Quoted 17 lines · Svyatoslav Ryhel

сб, 15 лют. 2025 р. о 19:24 Simon Glass <[email protected]> пише:

Quoted 15 lines

Hi Svyatoslav,

Quoted 10 lines · Svyatoslav Ryhel

Add get_display_timing ops for internal bridges linked to panels that do not support EDID (MIPI-DSI panels for example) or have EDID not routed.

---
 drivers/video/bridge/video-bridge-uclass.c | 11 +++++++++++
 include/video_bridge.h                     | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)
Quoted 7 lines
Quoted 2 lines

This should have a test, e.g. in test/dm/video.c or similar.

I totally agree, but it seems that there is no tests for UCLASS_VIDEO_BRIDGE unless I am missing smth. May you pls point me to it? Maybe I can add simple bridge analog of linux driver as sandbox test case?

Oh dear, that's my fault. Yes, please add something simple.

Quoted 8 lines
Quoted 4 lines

Surely, but I would need ofnode graph merged in first. Then I can add simple bridge and lvds encoder in linux style. And convert simple panel to be able to work with graph. I assume that would be correct course.

Ultimately yes, but you could add a very simple video-bridge test to start, that just gets a device and calls a driver method?

That would be double job. I was thinking about adding lvds-encoder and/or simple bridge, which I can use in sandbox to make a test and then it can be used on actual devices. For example transformers are modeled with lvds-encoder.

Quoted 2 lines

Regards,
Simon

#8 lore raw

Hi Svyatoslav,

Quoted 45 lines · Svyatoslav Ryhel

нд, 16 лют. 2025 р. о 14:56 Simon Glass <[email protected]> пише:

Quoted 43 lines

Hi Svyatoslav,

Quoted 38 lines · Svyatoslav Ryhel

сб, 15 лют. 2025 р. о 20:07 Simon Glass <[email protected]> пише:

Quoted 24 lines

Hi Svyatoslav,

Quoted 20 lines · Svyatoslav Ryhel

сб, 15 лют. 2025 р. о 19:24 Simon Glass <[email protected]> пише:

Quoted 17 lines

Hi Svyatoslav,

Quoted 10 lines · Svyatoslav Ryhel

Add get_display_timing ops for internal bridges linked to panels that do not support EDID (MIPI-DSI panels for example) or have EDID not routed.

---
 drivers/video/bridge/video-bridge-uclass.c | 11 +++++++++++
 include/video_bridge.h                     | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)

This should have a test, e.g. in test/dm/video.c or similar.

Quoted 7 lines
Quoted 4 lines

I totally agree, but it seems that there is no tests for UCLASS_VIDEO_BRIDGE unless I am missing smth. May you pls point me to it? Maybe I can add simple bridge analog of linux driver as sandbox test case?

Oh dear, that's my fault. Yes, please add something simple.

Surely, but I would need ofnode graph merged in first. Then I can add simple bridge and lvds encoder in linux style. And convert simple panel to be able to work with graph. I assume that would be correct course.

Quoted 8 lines
Quoted 3 lines

Ultimately yes, but you could add a very simple video-bridge test to start, that just gets a device and calls a driver method?

That would be double job. I was thinking about adding lvds-encoder and/or simple bridge, which I can use in sandbox to make a test and then it can be used on actual devices. For example transformers are modeled with lvds-encoder.

That sounds great to me.

Regards,
Simon