All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-01  9:46 ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

Panels usually call drm_connector_set_panel_orientation(), which is
later than drm/kms driver calling drm_dev_register(). This leads to a
WARN()[1].

The orientation property is known earlier. For example, some panels
parse the property through device tree during probe.

The series add a panel API drm_panel_get_orientation() for drm/kms
drivers. The drivers can use the API to get panel's orientation, so they
can call drm_connector_set_panel_orientation() before drm_dev_register().

Panel needs to implement .get_orientation callback to return the property.

[1] https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/

Hsin-Yi Wang (8):
  drm/panel: Add an API drm_panel_get_orientation() to return panel
    orientation
  drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
  drm/panel: panel-edp: Implement .get_orientation callback
  drm/panel: lvds: Implement .get_orientation callback
  drm/panel: panel-simple: Implement .get_orientation callback
  drm/panel: ili9881c: Implement .get_orientation callback
  drm/panel: elida-kd35t133: Implement .get_orientation callback
  drm/mediatek: Config orientation property if panel provides it

 drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
 drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
 drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
 drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
 drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
 drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
 drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
 include/drm/drm_panel.h                        | 10 ++++++++++
 9 files changed, 77 insertions(+)

-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply	[flat|nested] 60+ messages in thread

* [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-01  9:46 ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Rob Clark, Rob Herring, David Airlie, linux-kernel,
	Douglas Anderson, Stephen Boyd, Hans de Goede, Thierry Reding,
	linux-mediatek, dri-devel, Thomas Zimmermann, Matthias Brugger,
	Sam Ravnborg, linux-arm-kernel

Panels usually call drm_connector_set_panel_orientation(), which is
later than drm/kms driver calling drm_dev_register(). This leads to a
WARN()[1].

The orientation property is known earlier. For example, some panels
parse the property through device tree during probe.

The series add a panel API drm_panel_get_orientation() for drm/kms
drivers. The drivers can use the API to get panel's orientation, so they
can call drm_connector_set_panel_orientation() before drm_dev_register().

Panel needs to implement .get_orientation callback to return the property.

[1] https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/

Hsin-Yi Wang (8):
  drm/panel: Add an API drm_panel_get_orientation() to return panel
    orientation
  drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
  drm/panel: panel-edp: Implement .get_orientation callback
  drm/panel: lvds: Implement .get_orientation callback
  drm/panel: panel-simple: Implement .get_orientation callback
  drm/panel: ili9881c: Implement .get_orientation callback
  drm/panel: elida-kd35t133: Implement .get_orientation callback
  drm/mediatek: Config orientation property if panel provides it

 drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
 drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
 drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
 drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
 drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
 drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
 drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
 include/drm/drm_panel.h                        | 10 ++++++++++
 9 files changed, 77 insertions(+)

-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply	[flat|nested] 60+ messages in thread

* [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-01  9:46 ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

Panels usually call drm_connector_set_panel_orientation(), which is
later than drm/kms driver calling drm_dev_register(). This leads to a
WARN()[1].

The orientation property is known earlier. For example, some panels
parse the property through device tree during probe.

The series add a panel API drm_panel_get_orientation() for drm/kms
drivers. The drivers can use the API to get panel's orientation, so they
can call drm_connector_set_panel_orientation() before drm_dev_register().

Panel needs to implement .get_orientation callback to return the property.

[1] https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/

Hsin-Yi Wang (8):
  drm/panel: Add an API drm_panel_get_orientation() to return panel
    orientation
  drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
  drm/panel: panel-edp: Implement .get_orientation callback
  drm/panel: lvds: Implement .get_orientation callback
  drm/panel: panel-simple: Implement .get_orientation callback
  drm/panel: ili9881c: Implement .get_orientation callback
  drm/panel: elida-kd35t133: Implement .get_orientation callback
  drm/mediatek: Config orientation property if panel provides it

 drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
 drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
 drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
 drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
 drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
 drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
 drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
 include/drm/drm_panel.h                        | 10 ++++++++++
 9 files changed, 77 insertions(+)

-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 60+ messages in thread

* [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-01  9:46 ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

Panels usually call drm_connector_set_panel_orientation(), which is
later than drm/kms driver calling drm_dev_register(). This leads to a
WARN()[1].

The orientation property is known earlier. For example, some panels
parse the property through device tree during probe.

The series add a panel API drm_panel_get_orientation() for drm/kms
drivers. The drivers can use the API to get panel's orientation, so they
can call drm_connector_set_panel_orientation() before drm_dev_register().

Panel needs to implement .get_orientation callback to return the property.

[1] https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/

Hsin-Yi Wang (8):
  drm/panel: Add an API drm_panel_get_orientation() to return panel
    orientation
  drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
  drm/panel: panel-edp: Implement .get_orientation callback
  drm/panel: lvds: Implement .get_orientation callback
  drm/panel: panel-simple: Implement .get_orientation callback
  drm/panel: ili9881c: Implement .get_orientation callback
  drm/panel: elida-kd35t133: Implement .get_orientation callback
  drm/mediatek: Config orientation property if panel provides it

 drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
 drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
 drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
 drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
 drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
 drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
 drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
 include/drm/drm_panel.h                        | 10 ++++++++++
 9 files changed, 77 insertions(+)

-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 60+ messages in thread

* [PATCH v2 1/8] drm/panel: Add an API drm_panel_get_orientation() to return panel orientation
  2022-06-01  9:46 ` Hsin-Yi Wang
  (?)
  (?)
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  -1 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

Panels usually call drm_connector_set_panel_orientation(), which is
later than drm/kms driver calling drm_dev_register(). This leads to a
WARN().

The orientation property is known earlier. For example, some panels
parse the property through device tree during probe.

Add an API to return the property from panel to drm/kms driver, so the
drivers are able to call drm_connector_set_panel_orientation() before
drm_dev_register().

Suggested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/drm_panel.c |  8 ++++++++
 include/drm/drm_panel.h     | 10 ++++++++++
 2 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
index f634371c717a..4a512ca80673 100644
--- a/drivers/gpu/drm/drm_panel.c
+++ b/drivers/gpu/drm/drm_panel.c
@@ -223,6 +223,14 @@ int drm_panel_get_modes(struct drm_panel *panel,
 }
 EXPORT_SYMBOL(drm_panel_get_modes);
 
+enum drm_panel_orientation drm_panel_get_orientation(struct drm_panel *panel)
+{
+	if (panel && panel->funcs && panel->funcs->get_orientation)
+		return panel->funcs->get_orientation(panel);
+
+	return DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
+}
+EXPORT_SYMBOL(drm_panel_get_orientation);
 #ifdef CONFIG_OF
 /**
  * of_drm_find_panel - look up a panel using a device tree node
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
index 1ba2d424a53f..d1bd3be4bbdf 100644
--- a/include/drm/drm_panel.h
+++ b/include/drm/drm_panel.h
@@ -133,6 +133,15 @@ struct drm_panel_funcs {
 	 * Allows panels to create panels-specific debugfs files.
 	 */
 	void (*debugfs_init)(struct drm_panel *panel, struct dentry *root);
+
+	/**
+	 * @get_orientation:
+	 *
+	 * Return the panel orientation set by device tree or EDID.
+	 *
+	 * This function is optional.
+	 */
+	enum drm_panel_orientation (*get_orientation)(struct drm_panel *panel);
 };
 
 /**
@@ -195,6 +204,7 @@ int drm_panel_enable(struct drm_panel *panel);
 int drm_panel_disable(struct drm_panel *panel);
 
 int drm_panel_get_modes(struct drm_panel *panel, struct drm_connector *connector);
+enum drm_panel_orientation drm_panel_get_orientation(struct drm_panel *panel);
 
 #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL)
 struct drm_panel *of_drm_find_panel(const struct device_node *np);
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 1/8] drm/panel: Add an API drm_panel_get_orientation() to return panel orientation
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Rob Clark, Rob Herring, David Airlie, linux-kernel,
	Douglas Anderson, Stephen Boyd, Hans de Goede, Thierry Reding,
	linux-mediatek, dri-devel, Thomas Zimmermann, Matthias Brugger,
	Sam Ravnborg, linux-arm-kernel

Panels usually call drm_connector_set_panel_orientation(), which is
later than drm/kms driver calling drm_dev_register(). This leads to a
WARN().

The orientation property is known earlier. For example, some panels
parse the property through device tree during probe.

Add an API to return the property from panel to drm/kms driver, so the
drivers are able to call drm_connector_set_panel_orientation() before
drm_dev_register().

Suggested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/drm_panel.c |  8 ++++++++
 include/drm/drm_panel.h     | 10 ++++++++++
 2 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
index f634371c717a..4a512ca80673 100644
--- a/drivers/gpu/drm/drm_panel.c
+++ b/drivers/gpu/drm/drm_panel.c
@@ -223,6 +223,14 @@ int drm_panel_get_modes(struct drm_panel *panel,
 }
 EXPORT_SYMBOL(drm_panel_get_modes);
 
+enum drm_panel_orientation drm_panel_get_orientation(struct drm_panel *panel)
+{
+	if (panel && panel->funcs && panel->funcs->get_orientation)
+		return panel->funcs->get_orientation(panel);
+
+	return DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
+}
+EXPORT_SYMBOL(drm_panel_get_orientation);
 #ifdef CONFIG_OF
 /**
  * of_drm_find_panel - look up a panel using a device tree node
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
index 1ba2d424a53f..d1bd3be4bbdf 100644
--- a/include/drm/drm_panel.h
+++ b/include/drm/drm_panel.h
@@ -133,6 +133,15 @@ struct drm_panel_funcs {
 	 * Allows panels to create panels-specific debugfs files.
 	 */
 	void (*debugfs_init)(struct drm_panel *panel, struct dentry *root);
+
+	/**
+	 * @get_orientation:
+	 *
+	 * Return the panel orientation set by device tree or EDID.
+	 *
+	 * This function is optional.
+	 */
+	enum drm_panel_orientation (*get_orientation)(struct drm_panel *panel);
 };
 
 /**
@@ -195,6 +204,7 @@ int drm_panel_enable(struct drm_panel *panel);
 int drm_panel_disable(struct drm_panel *panel);
 
 int drm_panel_get_modes(struct drm_panel *panel, struct drm_connector *connector);
+enum drm_panel_orientation drm_panel_get_orientation(struct drm_panel *panel);
 
 #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL)
 struct drm_panel *of_drm_find_panel(const struct device_node *np);
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 1/8] drm/panel: Add an API drm_panel_get_orientation() to return panel orientation
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

Panels usually call drm_connector_set_panel_orientation(), which is
later than drm/kms driver calling drm_dev_register(). This leads to a
WARN().

The orientation property is known earlier. For example, some panels
parse the property through device tree during probe.

Add an API to return the property from panel to drm/kms driver, so the
drivers are able to call drm_connector_set_panel_orientation() before
drm_dev_register().

Suggested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/drm_panel.c |  8 ++++++++
 include/drm/drm_panel.h     | 10 ++++++++++
 2 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
index f634371c717a..4a512ca80673 100644
--- a/drivers/gpu/drm/drm_panel.c
+++ b/drivers/gpu/drm/drm_panel.c
@@ -223,6 +223,14 @@ int drm_panel_get_modes(struct drm_panel *panel,
 }
 EXPORT_SYMBOL(drm_panel_get_modes);
 
+enum drm_panel_orientation drm_panel_get_orientation(struct drm_panel *panel)
+{
+	if (panel && panel->funcs && panel->funcs->get_orientation)
+		return panel->funcs->get_orientation(panel);
+
+	return DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
+}
+EXPORT_SYMBOL(drm_panel_get_orientation);
 #ifdef CONFIG_OF
 /**
  * of_drm_find_panel - look up a panel using a device tree node
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
index 1ba2d424a53f..d1bd3be4bbdf 100644
--- a/include/drm/drm_panel.h
+++ b/include/drm/drm_panel.h
@@ -133,6 +133,15 @@ struct drm_panel_funcs {
 	 * Allows panels to create panels-specific debugfs files.
 	 */
 	void (*debugfs_init)(struct drm_panel *panel, struct dentry *root);
+
+	/**
+	 * @get_orientation:
+	 *
+	 * Return the panel orientation set by device tree or EDID.
+	 *
+	 * This function is optional.
+	 */
+	enum drm_panel_orientation (*get_orientation)(struct drm_panel *panel);
 };
 
 /**
@@ -195,6 +204,7 @@ int drm_panel_enable(struct drm_panel *panel);
 int drm_panel_disable(struct drm_panel *panel);
 
 int drm_panel_get_modes(struct drm_panel *panel, struct drm_connector *connector);
+enum drm_panel_orientation drm_panel_get_orientation(struct drm_panel *panel);
 
 #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL)
 struct drm_panel *of_drm_find_panel(const struct device_node *np);
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 1/8] drm/panel: Add an API drm_panel_get_orientation() to return panel orientation
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

Panels usually call drm_connector_set_panel_orientation(), which is
later than drm/kms driver calling drm_dev_register(). This leads to a
WARN().

The orientation property is known earlier. For example, some panels
parse the property through device tree during probe.

Add an API to return the property from panel to drm/kms driver, so the
drivers are able to call drm_connector_set_panel_orientation() before
drm_dev_register().

Suggested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/drm_panel.c |  8 ++++++++
 include/drm/drm_panel.h     | 10 ++++++++++
 2 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
index f634371c717a..4a512ca80673 100644
--- a/drivers/gpu/drm/drm_panel.c
+++ b/drivers/gpu/drm/drm_panel.c
@@ -223,6 +223,14 @@ int drm_panel_get_modes(struct drm_panel *panel,
 }
 EXPORT_SYMBOL(drm_panel_get_modes);
 
+enum drm_panel_orientation drm_panel_get_orientation(struct drm_panel *panel)
+{
+	if (panel && panel->funcs && panel->funcs->get_orientation)
+		return panel->funcs->get_orientation(panel);
+
+	return DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
+}
+EXPORT_SYMBOL(drm_panel_get_orientation);
 #ifdef CONFIG_OF
 /**
  * of_drm_find_panel - look up a panel using a device tree node
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
index 1ba2d424a53f..d1bd3be4bbdf 100644
--- a/include/drm/drm_panel.h
+++ b/include/drm/drm_panel.h
@@ -133,6 +133,15 @@ struct drm_panel_funcs {
 	 * Allows panels to create panels-specific debugfs files.
 	 */
 	void (*debugfs_init)(struct drm_panel *panel, struct dentry *root);
+
+	/**
+	 * @get_orientation:
+	 *
+	 * Return the panel orientation set by device tree or EDID.
+	 *
+	 * This function is optional.
+	 */
+	enum drm_panel_orientation (*get_orientation)(struct drm_panel *panel);
 };
 
 /**
@@ -195,6 +204,7 @@ int drm_panel_enable(struct drm_panel *panel);
 int drm_panel_disable(struct drm_panel *panel);
 
 int drm_panel_get_modes(struct drm_panel *panel, struct drm_connector *connector);
+enum drm_panel_orientation drm_panel_get_orientation(struct drm_panel *panel);
 
 #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL)
 struct drm_panel *of_drm_find_panel(const struct device_node *np);
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 2/8] drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
  2022-06-01  9:46 ` Hsin-Yi Wang
  (?)
  (?)
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  -1 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index 1be150ac758f..0f1c9b685da3 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -1516,11 +1516,19 @@ static int boe_panel_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation boe_panel_get_orientation(struct drm_panel *panel)
+{
+	struct boe_panel *boe = to_boe_panel(panel);
+
+	return boe->orientation;
+}
+
 static const struct drm_panel_funcs boe_panel_funcs = {
 	.unprepare = boe_panel_unprepare,
 	.prepare = boe_panel_prepare,
 	.enable = boe_panel_enable,
 	.get_modes = boe_panel_get_modes,
+	.get_orientation = boe_panel_get_orientation,
 };
 
 static int boe_panel_add(struct boe_panel *boe)
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 2/8] drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Rob Clark, Rob Herring, David Airlie, linux-kernel,
	Douglas Anderson, Stephen Boyd, Hans de Goede, Thierry Reding,
	linux-mediatek, dri-devel, Thomas Zimmermann, Matthias Brugger,
	Sam Ravnborg, linux-arm-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index 1be150ac758f..0f1c9b685da3 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -1516,11 +1516,19 @@ static int boe_panel_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation boe_panel_get_orientation(struct drm_panel *panel)
+{
+	struct boe_panel *boe = to_boe_panel(panel);
+
+	return boe->orientation;
+}
+
 static const struct drm_panel_funcs boe_panel_funcs = {
 	.unprepare = boe_panel_unprepare,
 	.prepare = boe_panel_prepare,
 	.enable = boe_panel_enable,
 	.get_modes = boe_panel_get_modes,
+	.get_orientation = boe_panel_get_orientation,
 };
 
 static int boe_panel_add(struct boe_panel *boe)
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 2/8] drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index 1be150ac758f..0f1c9b685da3 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -1516,11 +1516,19 @@ static int boe_panel_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation boe_panel_get_orientation(struct drm_panel *panel)
+{
+	struct boe_panel *boe = to_boe_panel(panel);
+
+	return boe->orientation;
+}
+
 static const struct drm_panel_funcs boe_panel_funcs = {
 	.unprepare = boe_panel_unprepare,
 	.prepare = boe_panel_prepare,
 	.enable = boe_panel_enable,
 	.get_modes = boe_panel_get_modes,
+	.get_orientation = boe_panel_get_orientation,
 };
 
 static int boe_panel_add(struct boe_panel *boe)
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 2/8] drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index 1be150ac758f..0f1c9b685da3 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -1516,11 +1516,19 @@ static int boe_panel_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation boe_panel_get_orientation(struct drm_panel *panel)
+{
+	struct boe_panel *boe = to_boe_panel(panel);
+
+	return boe->orientation;
+}
+
 static const struct drm_panel_funcs boe_panel_funcs = {
 	.unprepare = boe_panel_unprepare,
 	.prepare = boe_panel_prepare,
 	.enable = boe_panel_enable,
 	.get_modes = boe_panel_get_modes,
+	.get_orientation = boe_panel_get_orientation,
 };
 
 static int boe_panel_add(struct boe_panel *boe)
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 3/8] drm/panel: panel-edp: Implement .get_orientation callback
  2022-06-01  9:46 ` Hsin-Yi Wang
  (?)
  (?)
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  -1 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-edp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c
index 1732b4f56e38..a2133581a72d 100644
--- a/drivers/gpu/drm/panel/panel-edp.c
+++ b/drivers/gpu/drm/panel/panel-edp.c
@@ -609,6 +609,13 @@ static int panel_edp_get_timings(struct drm_panel *panel,
 	return p->desc->num_timings;
 }
 
+static enum drm_panel_orientation panel_edp_get_orientation(struct drm_panel *panel)
+{
+	struct panel_edp *p = to_panel_edp(panel);
+
+       return p->orientation;
+}
+
 static int detected_panel_show(struct seq_file *s, void *data)
 {
 	struct drm_panel *panel = s->private;
@@ -637,6 +644,7 @@ static const struct drm_panel_funcs panel_edp_funcs = {
 	.prepare = panel_edp_prepare,
 	.enable = panel_edp_enable,
 	.get_modes = panel_edp_get_modes,
+	.get_orientation = panel_edp_get_orientation,
 	.get_timings = panel_edp_get_timings,
 	.debugfs_init = panel_edp_debugfs_init,
 };
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 3/8] drm/panel: panel-edp: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Rob Clark, Rob Herring, David Airlie, linux-kernel,
	Douglas Anderson, Stephen Boyd, Hans de Goede, Thierry Reding,
	linux-mediatek, dri-devel, Thomas Zimmermann, Matthias Brugger,
	Sam Ravnborg, linux-arm-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-edp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c
index 1732b4f56e38..a2133581a72d 100644
--- a/drivers/gpu/drm/panel/panel-edp.c
+++ b/drivers/gpu/drm/panel/panel-edp.c
@@ -609,6 +609,13 @@ static int panel_edp_get_timings(struct drm_panel *panel,
 	return p->desc->num_timings;
 }
 
+static enum drm_panel_orientation panel_edp_get_orientation(struct drm_panel *panel)
+{
+	struct panel_edp *p = to_panel_edp(panel);
+
+       return p->orientation;
+}
+
 static int detected_panel_show(struct seq_file *s, void *data)
 {
 	struct drm_panel *panel = s->private;
@@ -637,6 +644,7 @@ static const struct drm_panel_funcs panel_edp_funcs = {
 	.prepare = panel_edp_prepare,
 	.enable = panel_edp_enable,
 	.get_modes = panel_edp_get_modes,
+	.get_orientation = panel_edp_get_orientation,
 	.get_timings = panel_edp_get_timings,
 	.debugfs_init = panel_edp_debugfs_init,
 };
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 3/8] drm/panel: panel-edp: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-edp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c
index 1732b4f56e38..a2133581a72d 100644
--- a/drivers/gpu/drm/panel/panel-edp.c
+++ b/drivers/gpu/drm/panel/panel-edp.c
@@ -609,6 +609,13 @@ static int panel_edp_get_timings(struct drm_panel *panel,
 	return p->desc->num_timings;
 }
 
+static enum drm_panel_orientation panel_edp_get_orientation(struct drm_panel *panel)
+{
+	struct panel_edp *p = to_panel_edp(panel);
+
+       return p->orientation;
+}
+
 static int detected_panel_show(struct seq_file *s, void *data)
 {
 	struct drm_panel *panel = s->private;
@@ -637,6 +644,7 @@ static const struct drm_panel_funcs panel_edp_funcs = {
 	.prepare = panel_edp_prepare,
 	.enable = panel_edp_enable,
 	.get_modes = panel_edp_get_modes,
+	.get_orientation = panel_edp_get_orientation,
 	.get_timings = panel_edp_get_timings,
 	.debugfs_init = panel_edp_debugfs_init,
 };
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 3/8] drm/panel: panel-edp: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-edp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c
index 1732b4f56e38..a2133581a72d 100644
--- a/drivers/gpu/drm/panel/panel-edp.c
+++ b/drivers/gpu/drm/panel/panel-edp.c
@@ -609,6 +609,13 @@ static int panel_edp_get_timings(struct drm_panel *panel,
 	return p->desc->num_timings;
 }
 
+static enum drm_panel_orientation panel_edp_get_orientation(struct drm_panel *panel)
+{
+	struct panel_edp *p = to_panel_edp(panel);
+
+       return p->orientation;
+}
+
 static int detected_panel_show(struct seq_file *s, void *data)
 {
 	struct drm_panel *panel = s->private;
@@ -637,6 +644,7 @@ static const struct drm_panel_funcs panel_edp_funcs = {
 	.prepare = panel_edp_prepare,
 	.enable = panel_edp_enable,
 	.get_modes = panel_edp_get_modes,
+	.get_orientation = panel_edp_get_orientation,
 	.get_timings = panel_edp_get_timings,
 	.debugfs_init = panel_edp_debugfs_init,
 };
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 4/8] drm/panel: lvds: Implement .get_orientation callback
  2022-06-01  9:46 ` Hsin-Yi Wang
  (?)
  (?)
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  -1 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Rob Clark, Rob Herring, David Airlie, linux-kernel,
	Douglas Anderson, Stephen Boyd, Hans de Goede, Thierry Reding,
	linux-mediatek, dri-devel, Thomas Zimmermann, Matthias Brugger,
	Sam Ravnborg, linux-arm-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-lvds.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index 27a1c9923b09..dc50f73d400f 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -107,10 +107,18 @@ static int panel_lvds_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation panel_lvds_get_orientation,(struct drm_panel *panel)
+{
+       struct panel_lvds *lvds = to_panel_lvds(panel);
+
+       return lvds->orientation;
+}
+
 static const struct drm_panel_funcs panel_lvds_funcs = {
 	.unprepare = panel_lvds_unprepare,
 	.prepare = panel_lvds_prepare,
 	.get_modes = panel_lvds_get_modes,
+	.get_orientation = panel_lvds_get_orientation,
 };
 
 static int panel_lvds_parse_dt(struct panel_lvds *lvds)
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 4/8] drm/panel: lvds: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-lvds.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index 27a1c9923b09..dc50f73d400f 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -107,10 +107,18 @@ static int panel_lvds_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation panel_lvds_get_orientation,(struct drm_panel *panel)
+{
+       struct panel_lvds *lvds = to_panel_lvds(panel);
+
+       return lvds->orientation;
+}
+
 static const struct drm_panel_funcs panel_lvds_funcs = {
 	.unprepare = panel_lvds_unprepare,
 	.prepare = panel_lvds_prepare,
 	.get_modes = panel_lvds_get_modes,
+	.get_orientation = panel_lvds_get_orientation,
 };
 
 static int panel_lvds_parse_dt(struct panel_lvds *lvds)
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 4/8] drm/panel: lvds: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-lvds.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index 27a1c9923b09..dc50f73d400f 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -107,10 +107,18 @@ static int panel_lvds_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation panel_lvds_get_orientation,(struct drm_panel *panel)
+{
+       struct panel_lvds *lvds = to_panel_lvds(panel);
+
+       return lvds->orientation;
+}
+
 static const struct drm_panel_funcs panel_lvds_funcs = {
 	.unprepare = panel_lvds_unprepare,
 	.prepare = panel_lvds_prepare,
 	.get_modes = panel_lvds_get_modes,
+	.get_orientation = panel_lvds_get_orientation,
 };
 
 static int panel_lvds_parse_dt(struct panel_lvds *lvds)
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 4/8] drm/panel: lvds: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-lvds.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index 27a1c9923b09..dc50f73d400f 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -107,10 +107,18 @@ static int panel_lvds_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation panel_lvds_get_orientation,(struct drm_panel *panel)
+{
+       struct panel_lvds *lvds = to_panel_lvds(panel);
+
+       return lvds->orientation;
+}
+
 static const struct drm_panel_funcs panel_lvds_funcs = {
 	.unprepare = panel_lvds_unprepare,
 	.prepare = panel_lvds_prepare,
 	.get_modes = panel_lvds_get_modes,
+	.get_orientation = panel_lvds_get_orientation,
 };
 
 static int panel_lvds_parse_dt(struct panel_lvds *lvds)
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 5/8] drm/panel: panel-simple: Implement .get_orientation callback
  2022-06-01  9:46 ` Hsin-Yi Wang
  (?)
  (?)
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  -1 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Rob Clark, Rob Herring, David Airlie, linux-kernel,
	Douglas Anderson, Stephen Boyd, Hans de Goede, Thierry Reding,
	linux-mediatek, dri-devel, Thomas Zimmermann, Matthias Brugger,
	Sam Ravnborg, linux-arm-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-simple.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index a34f4198a534..54e78d978dcb 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -434,6 +434,14 @@ static int panel_simple_get_timings(struct drm_panel *panel,
 	return p->desc->num_timings;
 }
 
+static enum drm_panel_orientation panel_simple_get_orientation(struct drm_panel *panel)
+{
+       struct panel_simple *p = to_panel_simple(panel);
+
+       return p->orientation;
+}
+
+
 static const struct drm_panel_funcs panel_simple_funcs = {
 	.disable = panel_simple_disable,
 	.unprepare = panel_simple_unprepare,
@@ -441,6 +449,7 @@ static const struct drm_panel_funcs panel_simple_funcs = {
 	.enable = panel_simple_enable,
 	.get_modes = panel_simple_get_modes,
 	.get_timings = panel_simple_get_timings,
+	.get_orientation = panel_simple_get_orientation,
 };
 
 static struct panel_desc panel_dpi;
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 5/8] drm/panel: panel-simple: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-simple.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index a34f4198a534..54e78d978dcb 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -434,6 +434,14 @@ static int panel_simple_get_timings(struct drm_panel *panel,
 	return p->desc->num_timings;
 }
 
+static enum drm_panel_orientation panel_simple_get_orientation(struct drm_panel *panel)
+{
+       struct panel_simple *p = to_panel_simple(panel);
+
+       return p->orientation;
+}
+
+
 static const struct drm_panel_funcs panel_simple_funcs = {
 	.disable = panel_simple_disable,
 	.unprepare = panel_simple_unprepare,
@@ -441,6 +449,7 @@ static const struct drm_panel_funcs panel_simple_funcs = {
 	.enable = panel_simple_enable,
 	.get_modes = panel_simple_get_modes,
 	.get_timings = panel_simple_get_timings,
+	.get_orientation = panel_simple_get_orientation,
 };
 
 static struct panel_desc panel_dpi;
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 5/8] drm/panel: panel-simple: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-simple.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index a34f4198a534..54e78d978dcb 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -434,6 +434,14 @@ static int panel_simple_get_timings(struct drm_panel *panel,
 	return p->desc->num_timings;
 }
 
+static enum drm_panel_orientation panel_simple_get_orientation(struct drm_panel *panel)
+{
+       struct panel_simple *p = to_panel_simple(panel);
+
+       return p->orientation;
+}
+
+
 static const struct drm_panel_funcs panel_simple_funcs = {
 	.disable = panel_simple_disable,
 	.unprepare = panel_simple_unprepare,
@@ -441,6 +449,7 @@ static const struct drm_panel_funcs panel_simple_funcs = {
 	.enable = panel_simple_enable,
 	.get_modes = panel_simple_get_modes,
 	.get_timings = panel_simple_get_timings,
+	.get_orientation = panel_simple_get_orientation,
 };
 
 static struct panel_desc panel_dpi;
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 5/8] drm/panel: panel-simple: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-simple.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index a34f4198a534..54e78d978dcb 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -434,6 +434,14 @@ static int panel_simple_get_timings(struct drm_panel *panel,
 	return p->desc->num_timings;
 }
 
+static enum drm_panel_orientation panel_simple_get_orientation(struct drm_panel *panel)
+{
+       struct panel_simple *p = to_panel_simple(panel);
+
+       return p->orientation;
+}
+
+
 static const struct drm_panel_funcs panel_simple_funcs = {
 	.disable = panel_simple_disable,
 	.unprepare = panel_simple_unprepare,
@@ -441,6 +449,7 @@ static const struct drm_panel_funcs panel_simple_funcs = {
 	.enable = panel_simple_enable,
 	.get_modes = panel_simple_get_modes,
 	.get_timings = panel_simple_get_timings,
+	.get_orientation = panel_simple_get_orientation,
 };
 
 static struct panel_desc panel_dpi;
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 6/8] drm/panel: ili9881c: Implement .get_orientation callback
  2022-06-01  9:46 ` Hsin-Yi Wang
  (?)
  (?)
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  -1 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Rob Clark, Rob Herring, David Airlie, linux-kernel,
	Douglas Anderson, Stephen Boyd, Hans de Goede, Thierry Reding,
	linux-mediatek, dri-devel, Thomas Zimmermann, Matthias Brugger,
	Sam Ravnborg, linux-arm-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
index ba30d11547ad..238b6a75d2ed 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
@@ -858,12 +858,20 @@ static int ili9881c_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation ili9881c_get_orientation(struct drm_panel *panel)
+{
+       struct ili9881c *ctx = panel_to_ili9881c(panel);
+
+       return ctx->orientation;
+}
+
 static const struct drm_panel_funcs ili9881c_funcs = {
 	.prepare	= ili9881c_prepare,
 	.unprepare	= ili9881c_unprepare,
 	.enable		= ili9881c_enable,
 	.disable	= ili9881c_disable,
 	.get_modes	= ili9881c_get_modes,
+	.get_orientation = ili9881c_get_orientation,
 };
 
 static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 6/8] drm/panel: ili9881c: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
index ba30d11547ad..238b6a75d2ed 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
@@ -858,12 +858,20 @@ static int ili9881c_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation ili9881c_get_orientation(struct drm_panel *panel)
+{
+       struct ili9881c *ctx = panel_to_ili9881c(panel);
+
+       return ctx->orientation;
+}
+
 static const struct drm_panel_funcs ili9881c_funcs = {
 	.prepare	= ili9881c_prepare,
 	.unprepare	= ili9881c_unprepare,
 	.enable		= ili9881c_enable,
 	.disable	= ili9881c_disable,
 	.get_modes	= ili9881c_get_modes,
+	.get_orientation = ili9881c_get_orientation,
 };
 
 static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 6/8] drm/panel: ili9881c: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
index ba30d11547ad..238b6a75d2ed 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
@@ -858,12 +858,20 @@ static int ili9881c_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation ili9881c_get_orientation(struct drm_panel *panel)
+{
+       struct ili9881c *ctx = panel_to_ili9881c(panel);
+
+       return ctx->orientation;
+}
+
 static const struct drm_panel_funcs ili9881c_funcs = {
 	.prepare	= ili9881c_prepare,
 	.unprepare	= ili9881c_unprepare,
 	.enable		= ili9881c_enable,
 	.disable	= ili9881c_disable,
 	.get_modes	= ili9881c_get_modes,
+	.get_orientation = ili9881c_get_orientation,
 };
 
 static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 6/8] drm/panel: ili9881c: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
index ba30d11547ad..238b6a75d2ed 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
@@ -858,12 +858,20 @@ static int ili9881c_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation ili9881c_get_orientation(struct drm_panel *panel)
+{
+       struct ili9881c *ctx = panel_to_ili9881c(panel);
+
+       return ctx->orientation;
+}
+
 static const struct drm_panel_funcs ili9881c_funcs = {
 	.prepare	= ili9881c_prepare,
 	.unprepare	= ili9881c_unprepare,
 	.enable		= ili9881c_enable,
 	.disable	= ili9881c_disable,
 	.get_modes	= ili9881c_get_modes,
+	.get_orientation = ili9881c_get_orientation,
 };
 
 static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 7/8] drm/panel: elida-kd35t133: Implement .get_orientation callback
  2022-06-01  9:46 ` Hsin-Yi Wang
  (?)
  (?)
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  -1 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Rob Clark, Rob Herring, David Airlie, linux-kernel,
	Douglas Anderson, Stephen Boyd, Hans de Goede, Thierry Reding,
	linux-mediatek, dri-devel, Thomas Zimmermann, Matthias Brugger,
	Sam Ravnborg, linux-arm-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-elida-kd35t133.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-elida-kd35t133.c b/drivers/gpu/drm/panel/panel-elida-kd35t133.c
index 80227617a4d6..079ed71f660c 100644
--- a/drivers/gpu/drm/panel/panel-elida-kd35t133.c
+++ b/drivers/gpu/drm/panel/panel-elida-kd35t133.c
@@ -222,10 +222,18 @@ static int kd35t133_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation kd35t133_get_orientation(struct drm_panel *panel)
+{
+       struct kd35t133 *ctx = panel_to_kd35t133(panel);
+
+       return ctx->orientation;
+}
+
 static const struct drm_panel_funcs kd35t133_funcs = {
 	.unprepare	= kd35t133_unprepare,
 	.prepare	= kd35t133_prepare,
 	.get_modes	= kd35t133_get_modes,
+	.get_orientation = kd35t133_get_orientation,
 };
 
 static int kd35t133_probe(struct mipi_dsi_device *dsi)
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 7/8] drm/panel: elida-kd35t133: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-elida-kd35t133.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-elida-kd35t133.c b/drivers/gpu/drm/panel/panel-elida-kd35t133.c
index 80227617a4d6..079ed71f660c 100644
--- a/drivers/gpu/drm/panel/panel-elida-kd35t133.c
+++ b/drivers/gpu/drm/panel/panel-elida-kd35t133.c
@@ -222,10 +222,18 @@ static int kd35t133_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation kd35t133_get_orientation(struct drm_panel *panel)
+{
+       struct kd35t133 *ctx = panel_to_kd35t133(panel);
+
+       return ctx->orientation;
+}
+
 static const struct drm_panel_funcs kd35t133_funcs = {
 	.unprepare	= kd35t133_unprepare,
 	.prepare	= kd35t133_prepare,
 	.get_modes	= kd35t133_get_modes,
+	.get_orientation = kd35t133_get_orientation,
 };
 
 static int kd35t133_probe(struct mipi_dsi_device *dsi)
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 7/8] drm/panel: elida-kd35t133: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-elida-kd35t133.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-elida-kd35t133.c b/drivers/gpu/drm/panel/panel-elida-kd35t133.c
index 80227617a4d6..079ed71f660c 100644
--- a/drivers/gpu/drm/panel/panel-elida-kd35t133.c
+++ b/drivers/gpu/drm/panel/panel-elida-kd35t133.c
@@ -222,10 +222,18 @@ static int kd35t133_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation kd35t133_get_orientation(struct drm_panel *panel)
+{
+       struct kd35t133 *ctx = panel_to_kd35t133(panel);
+
+       return ctx->orientation;
+}
+
 static const struct drm_panel_funcs kd35t133_funcs = {
 	.unprepare	= kd35t133_unprepare,
 	.prepare	= kd35t133_prepare,
 	.get_modes	= kd35t133_get_modes,
+	.get_orientation = kd35t133_get_orientation,
 };
 
 static int kd35t133_probe(struct mipi_dsi_device *dsi)
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 7/8] drm/panel: elida-kd35t133: Implement .get_orientation callback
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

To return the orientation property to drm/kms driver.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/gpu/drm/panel/panel-elida-kd35t133.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-elida-kd35t133.c b/drivers/gpu/drm/panel/panel-elida-kd35t133.c
index 80227617a4d6..079ed71f660c 100644
--- a/drivers/gpu/drm/panel/panel-elida-kd35t133.c
+++ b/drivers/gpu/drm/panel/panel-elida-kd35t133.c
@@ -222,10 +222,18 @@ static int kd35t133_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation kd35t133_get_orientation(struct drm_panel *panel)
+{
+       struct kd35t133 *ctx = panel_to_kd35t133(panel);
+
+       return ctx->orientation;
+}
+
 static const struct drm_panel_funcs kd35t133_funcs = {
 	.unprepare	= kd35t133_unprepare,
 	.prepare	= kd35t133_prepare,
 	.get_modes	= kd35t133_get_modes,
+	.get_orientation = kd35t133_get_orientation,
 };
 
 static int kd35t133_probe(struct mipi_dsi_device *dsi)
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 8/8] drm/mediatek: Config orientation property if panel provides it
  2022-06-01  9:46 ` Hsin-Yi Wang
  (?)
  (?)
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  -1 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Rob Clark, Rob Herring, David Airlie, linux-kernel,
	Douglas Anderson, Stephen Boyd, Hans de Goede, Thierry Reding,
	linux-mediatek, dri-devel, Thomas Zimmermann, Matthias Brugger,
	Sam Ravnborg, linux-arm-kernel

Panel orientation property should be set before drm_dev_register().
Mediatek drm driver calls drm_dev_register() in .bind(). However, most
panels sets orientation property relatively late, mostly in .get_modes()
callback, since this is when they are able to get the connector and
binds the orientation property to it, though the value should be known
when the panel is probed.

Let the drm driver check if the remote end point is a panel and if it
contains the orientation property. If it does, set it before
drm_dev_register() is called.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
---
v1->v2: remove unused checks.
---
 drivers/gpu/drm/mediatek/mtk_dsi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index bd3f5b485085..86613360d2d9 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -185,6 +185,7 @@ struct mtk_dsi {
 	struct drm_encoder encoder;
 	struct drm_bridge bridge;
 	struct drm_bridge *next_bridge;
+	struct drm_panel *panel;
 	struct drm_connector *connector;
 	struct phy *phy;
 
@@ -822,6 +823,12 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
 		ret = PTR_ERR(dsi->connector);
 		goto err_cleanup_encoder;
 	}
+
+	/* Read panel orientation */
+	if (dsi->panel)
+		drm_connector_set_panel_orientation(dsi->connector,
+				drm_panel_get_orientation(dsi->panel));
+
 	drm_connector_attach_encoder(dsi->connector, &dsi->encoder);
 
 	return 0;
@@ -837,6 +844,9 @@ static int mtk_dsi_bind(struct device *dev, struct device *master, void *data)
 	struct drm_device *drm = data;
 	struct mtk_dsi *dsi = dev_get_drvdata(dev);
 
+	/* Get panel if existed */
+	drm_of_find_panel_or_bridge(dev->of_node, 0, 0, &dsi->panel, NULL);
+
 	ret = mtk_dsi_encoder_init(drm, dsi);
 	if (ret)
 		return ret;
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 8/8] drm/mediatek: Config orientation property if panel provides it
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

Panel orientation property should be set before drm_dev_register().
Mediatek drm driver calls drm_dev_register() in .bind(). However, most
panels sets orientation property relatively late, mostly in .get_modes()
callback, since this is when they are able to get the connector and
binds the orientation property to it, though the value should be known
when the panel is probed.

Let the drm driver check if the remote end point is a panel and if it
contains the orientation property. If it does, set it before
drm_dev_register() is called.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
---
v1->v2: remove unused checks.
---
 drivers/gpu/drm/mediatek/mtk_dsi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index bd3f5b485085..86613360d2d9 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -185,6 +185,7 @@ struct mtk_dsi {
 	struct drm_encoder encoder;
 	struct drm_bridge bridge;
 	struct drm_bridge *next_bridge;
+	struct drm_panel *panel;
 	struct drm_connector *connector;
 	struct phy *phy;
 
@@ -822,6 +823,12 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
 		ret = PTR_ERR(dsi->connector);
 		goto err_cleanup_encoder;
 	}
+
+	/* Read panel orientation */
+	if (dsi->panel)
+		drm_connector_set_panel_orientation(dsi->connector,
+				drm_panel_get_orientation(dsi->panel));
+
 	drm_connector_attach_encoder(dsi->connector, &dsi->encoder);
 
 	return 0;
@@ -837,6 +844,9 @@ static int mtk_dsi_bind(struct device *dev, struct device *master, void *data)
 	struct drm_device *drm = data;
 	struct mtk_dsi *dsi = dev_get_drvdata(dev);
 
+	/* Get panel if existed */
+	drm_of_find_panel_or_bridge(dev->of_node, 0, 0, &dsi->panel, NULL);
+
 	ret = mtk_dsi_encoder_init(drm, dsi);
 	if (ret)
 		return ret;
-- 
2.36.1.255.ge46751e96f-goog


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 8/8] drm/mediatek: Config orientation property if panel provides it
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

Panel orientation property should be set before drm_dev_register().
Mediatek drm driver calls drm_dev_register() in .bind(). However, most
panels sets orientation property relatively late, mostly in .get_modes()
callback, since this is when they are able to get the connector and
binds the orientation property to it, though the value should be known
when the panel is probed.

Let the drm driver check if the remote end point is a panel and if it
contains the orientation property. If it does, set it before
drm_dev_register() is called.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
---
v1->v2: remove unused checks.
---
 drivers/gpu/drm/mediatek/mtk_dsi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index bd3f5b485085..86613360d2d9 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -185,6 +185,7 @@ struct mtk_dsi {
 	struct drm_encoder encoder;
 	struct drm_bridge bridge;
 	struct drm_bridge *next_bridge;
+	struct drm_panel *panel;
 	struct drm_connector *connector;
 	struct phy *phy;
 
@@ -822,6 +823,12 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
 		ret = PTR_ERR(dsi->connector);
 		goto err_cleanup_encoder;
 	}
+
+	/* Read panel orientation */
+	if (dsi->panel)
+		drm_connector_set_panel_orientation(dsi->connector,
+				drm_panel_get_orientation(dsi->panel));
+
 	drm_connector_attach_encoder(dsi->connector, &dsi->encoder);
 
 	return 0;
@@ -837,6 +844,9 @@ static int mtk_dsi_bind(struct device *dev, struct device *master, void *data)
 	struct drm_device *drm = data;
 	struct mtk_dsi *dsi = dev_get_drvdata(dev);
 
+	/* Get panel if existed */
+	drm_of_find_panel_or_bridge(dev->of_node, 0, 0, &dsi->panel, NULL);
+
 	ret = mtk_dsi_encoder_init(drm, dsi);
 	if (ret)
 		return ret;
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 8/8] drm/mediatek: Config orientation property if panel provides it
@ 2022-06-01  9:46   ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-01  9:46 UTC (permalink / raw)
  To: Chun-Kuang Hu
  Cc: Hans de Goede, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel, linux-mediatek,
	Rob Clark, Stephen Boyd, Douglas Anderson, Rob Herring,
	linux-arm-kernel, linux-kernel

Panel orientation property should be set before drm_dev_register().
Mediatek drm driver calls drm_dev_register() in .bind(). However, most
panels sets orientation property relatively late, mostly in .get_modes()
callback, since this is when they are able to get the connector and
binds the orientation property to it, though the value should be known
when the panel is probed.

Let the drm driver check if the remote end point is a panel and if it
contains the orientation property. If it does, set it before
drm_dev_register() is called.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
---
v1->v2: remove unused checks.
---
 drivers/gpu/drm/mediatek/mtk_dsi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
index bd3f5b485085..86613360d2d9 100644
--- a/drivers/gpu/drm/mediatek/mtk_dsi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
@@ -185,6 +185,7 @@ struct mtk_dsi {
 	struct drm_encoder encoder;
 	struct drm_bridge bridge;
 	struct drm_bridge *next_bridge;
+	struct drm_panel *panel;
 	struct drm_connector *connector;
 	struct phy *phy;
 
@@ -822,6 +823,12 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
 		ret = PTR_ERR(dsi->connector);
 		goto err_cleanup_encoder;
 	}
+
+	/* Read panel orientation */
+	if (dsi->panel)
+		drm_connector_set_panel_orientation(dsi->connector,
+				drm_panel_get_orientation(dsi->panel));
+
 	drm_connector_attach_encoder(dsi->connector, &dsi->encoder);
 
 	return 0;
@@ -837,6 +844,9 @@ static int mtk_dsi_bind(struct device *dev, struct device *master, void *data)
 	struct drm_device *drm = data;
 	struct mtk_dsi *dsi = dev_get_drvdata(dev);
 
+	/* Get panel if existed */
+	drm_of_find_panel_or_bridge(dev->of_node, 0, 0, &dsi->panel, NULL);
+
 	ret = mtk_dsi_encoder_init(drm, dsi);
 	if (ret)
 		return ret;
-- 
2.36.1.255.ge46751e96f-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
  2022-06-01  9:46 ` Hsin-Yi Wang
  (?)
  (?)
@ 2022-06-02  8:02   ` CK Hu
  -1 siblings, 0 replies; 60+ messages in thread
From: CK Hu @ 2022-06-02  8:02 UTC (permalink / raw)
  To: Hsin-Yi Wang, Chun-Kuang Hu
  Cc: Rob Clark, Rob Herring, David Airlie, linux-kernel,
	Douglas Anderson, Stephen Boyd, Hans de Goede, Thierry Reding,
	linux-mediatek, dri-devel, Thomas Zimmermann, Matthias Brugger,
	Sam Ravnborg, linux-arm-kernel

Hi, Hsin-Yi:

I'm curious that panel driver setting orientation in get_modes() would
work or not. It it works, why not just set orientation in get_modes()?
I find that exynos dsi driver has implement the get_modes() [1] but
Mediatek dsi does not implement. Would you try this?

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/exynos/exynos_drm_dsi.c?h=v5.18#n1483

Regards,
CK

On Wed, 2022-06-01 at 17:46 +0800, Hsin-Yi Wang wrote:
> Panels usually call drm_connector_set_panel_orientation(), which is
> later than drm/kms driver calling drm_dev_register(). This leads to a
> WARN()[1].
> 
> The orientation property is known earlier. For example, some panels
> parse the property through device tree during probe.
> 
> The series add a panel API drm_panel_get_orientation() for drm/kms
> drivers. The drivers can use the API to get panel's orientation, so
> they
> can call drm_connector_set_panel_orientation() before
> drm_dev_register().
> 
> Panel needs to implement .get_orientation callback to return the
> property.
> 
> [1] 
> https://urldefense.com/v3/__https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/__;!!CTRNKA9wMg0ARbw!0ytf4wPxKANnYbw_fgq-eqQARnAXIHv4jwu04ZW6X6dAxZDFsJ0CltY_PvCBAQ$
>  
> 
> Hsin-Yi Wang (8):
>   drm/panel: Add an API drm_panel_get_orientation() to return panel
>     orientation
>   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
>   drm/panel: panel-edp: Implement .get_orientation callback
>   drm/panel: lvds: Implement .get_orientation callback
>   drm/panel: panel-simple: Implement .get_orientation callback
>   drm/panel: ili9881c: Implement .get_orientation callback
>   drm/panel: elida-kd35t133: Implement .get_orientation callback
>   drm/mediatek: Config orientation property if panel provides it
> 
>  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
>  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
>  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
>  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
>  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
>  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
>  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
>  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
>  include/drm/drm_panel.h                        | 10 ++++++++++
>  9 files changed, 77 insertions(+)
> 


^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-02  8:02   ` CK Hu
  0 siblings, 0 replies; 60+ messages in thread
From: CK Hu @ 2022-06-02  8:02 UTC (permalink / raw)
  To: Hsin-Yi Wang, Chun-Kuang Hu
  Cc: Rob Clark, Douglas Anderson, David Airlie, linux-kernel,
	dri-devel, Stephen Boyd, Hans de Goede, Rob Herring,
	Thierry Reding, Thomas Zimmermann, Matthias Brugger,
	linux-mediatek, Sam Ravnborg, linux-arm-kernel

Hi, Hsin-Yi:

I'm curious that panel driver setting orientation in get_modes() would
work or not. It it works, why not just set orientation in get_modes()?
I find that exynos dsi driver has implement the get_modes() [1] but
Mediatek dsi does not implement. Would you try this?

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/exynos/exynos_drm_dsi.c?h=v5.18#n1483

Regards,
CK

On Wed, 2022-06-01 at 17:46 +0800, Hsin-Yi Wang wrote:
> Panels usually call drm_connector_set_panel_orientation(), which is
> later than drm/kms driver calling drm_dev_register(). This leads to a
> WARN()[1].
> 
> The orientation property is known earlier. For example, some panels
> parse the property through device tree during probe.
> 
> The series add a panel API drm_panel_get_orientation() for drm/kms
> drivers. The drivers can use the API to get panel's orientation, so
> they
> can call drm_connector_set_panel_orientation() before
> drm_dev_register().
> 
> Panel needs to implement .get_orientation callback to return the
> property.
> 
> [1] 
> https://urldefense.com/v3/__https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/__;!!CTRNKA9wMg0ARbw!0ytf4wPxKANnYbw_fgq-eqQARnAXIHv4jwu04ZW6X6dAxZDFsJ0CltY_PvCBAQ$
>  
> 
> Hsin-Yi Wang (8):
>   drm/panel: Add an API drm_panel_get_orientation() to return panel
>     orientation
>   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
>   drm/panel: panel-edp: Implement .get_orientation callback
>   drm/panel: lvds: Implement .get_orientation callback
>   drm/panel: panel-simple: Implement .get_orientation callback
>   drm/panel: ili9881c: Implement .get_orientation callback
>   drm/panel: elida-kd35t133: Implement .get_orientation callback
>   drm/mediatek: Config orientation property if panel provides it
> 
>  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
>  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
>  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
>  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
>  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
>  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
>  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
>  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
>  include/drm/drm_panel.h                        | 10 ++++++++++
>  9 files changed, 77 insertions(+)
> 


^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-02  8:02   ` CK Hu
  0 siblings, 0 replies; 60+ messages in thread
From: CK Hu @ 2022-06-02  8:02 UTC (permalink / raw)
  To: Hsin-Yi Wang, Chun-Kuang Hu
  Cc: Rob Clark, Rob Herring, David Airlie, linux-kernel,
	Douglas Anderson, Stephen Boyd, Hans de Goede, Thierry Reding,
	linux-mediatek, dri-devel, Thomas Zimmermann, Matthias Brugger,
	Sam Ravnborg, linux-arm-kernel

Hi, Hsin-Yi:

I'm curious that panel driver setting orientation in get_modes() would
work or not. It it works, why not just set orientation in get_modes()?
I find that exynos dsi driver has implement the get_modes() [1] but
Mediatek dsi does not implement. Would you try this?

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/exynos/exynos_drm_dsi.c?h=v5.18#n1483

Regards,
CK

On Wed, 2022-06-01 at 17:46 +0800, Hsin-Yi Wang wrote:
> Panels usually call drm_connector_set_panel_orientation(), which is
> later than drm/kms driver calling drm_dev_register(). This leads to a
> WARN()[1].
> 
> The orientation property is known earlier. For example, some panels
> parse the property through device tree during probe.
> 
> The series add a panel API drm_panel_get_orientation() for drm/kms
> drivers. The drivers can use the API to get panel's orientation, so
> they
> can call drm_connector_set_panel_orientation() before
> drm_dev_register().
> 
> Panel needs to implement .get_orientation callback to return the
> property.
> 
> [1] 
> https://urldefense.com/v3/__https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/__;!!CTRNKA9wMg0ARbw!0ytf4wPxKANnYbw_fgq-eqQARnAXIHv4jwu04ZW6X6dAxZDFsJ0CltY_PvCBAQ$
>  
> 
> Hsin-Yi Wang (8):
>   drm/panel: Add an API drm_panel_get_orientation() to return panel
>     orientation
>   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
>   drm/panel: panel-edp: Implement .get_orientation callback
>   drm/panel: lvds: Implement .get_orientation callback
>   drm/panel: panel-simple: Implement .get_orientation callback
>   drm/panel: ili9881c: Implement .get_orientation callback
>   drm/panel: elida-kd35t133: Implement .get_orientation callback
>   drm/mediatek: Config orientation property if panel provides it
> 
>  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
>  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
>  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
>  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
>  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
>  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
>  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
>  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
>  include/drm/drm_panel.h                        | 10 ++++++++++
>  9 files changed, 77 insertions(+)
> 


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-02  8:02   ` CK Hu
  0 siblings, 0 replies; 60+ messages in thread
From: CK Hu @ 2022-06-02  8:02 UTC (permalink / raw)
  To: Hsin-Yi Wang, Chun-Kuang Hu
  Cc: Rob Clark, Rob Herring, David Airlie, linux-kernel,
	Douglas Anderson, Stephen Boyd, Hans de Goede, Thierry Reding,
	linux-mediatek, dri-devel, Thomas Zimmermann, Matthias Brugger,
	Sam Ravnborg, linux-arm-kernel

Hi, Hsin-Yi:

I'm curious that panel driver setting orientation in get_modes() would
work or not. It it works, why not just set orientation in get_modes()?
I find that exynos dsi driver has implement the get_modes() [1] but
Mediatek dsi does not implement. Would you try this?

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/exynos/exynos_drm_dsi.c?h=v5.18#n1483

Regards,
CK

On Wed, 2022-06-01 at 17:46 +0800, Hsin-Yi Wang wrote:
> Panels usually call drm_connector_set_panel_orientation(), which is
> later than drm/kms driver calling drm_dev_register(). This leads to a
> WARN()[1].
> 
> The orientation property is known earlier. For example, some panels
> parse the property through device tree during probe.
> 
> The series add a panel API drm_panel_get_orientation() for drm/kms
> drivers. The drivers can use the API to get panel's orientation, so
> they
> can call drm_connector_set_panel_orientation() before
> drm_dev_register().
> 
> Panel needs to implement .get_orientation callback to return the
> property.
> 
> [1] 
> https://urldefense.com/v3/__https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/__;!!CTRNKA9wMg0ARbw!0ytf4wPxKANnYbw_fgq-eqQARnAXIHv4jwu04ZW6X6dAxZDFsJ0CltY_PvCBAQ$
>  
> 
> Hsin-Yi Wang (8):
>   drm/panel: Add an API drm_panel_get_orientation() to return panel
>     orientation
>   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
>   drm/panel: panel-edp: Implement .get_orientation callback
>   drm/panel: lvds: Implement .get_orientation callback
>   drm/panel: panel-simple: Implement .get_orientation callback
>   drm/panel: ili9881c: Implement .get_orientation callback
>   drm/panel: elida-kd35t133: Implement .get_orientation callback
>   drm/mediatek: Config orientation property if panel provides it
> 
>  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
>  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
>  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
>  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
>  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
>  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
>  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
>  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
>  include/drm/drm_panel.h                        | 10 ++++++++++
>  9 files changed, 77 insertions(+)
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
  2022-06-02  8:02   ` CK Hu
  (?)
  (?)
@ 2022-06-02  8:07     ` Hsin-Yi Wang
  -1 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-02  8:07 UTC (permalink / raw)
  To: CK Hu
  Cc: Chun-Kuang Hu, Rob Clark, Rob Herring, David Airlie,
	linux-kernel, Douglas Anderson, Stephen Boyd, Hans de Goede,
	Thierry Reding, linux-mediatek, dri-devel, Thomas Zimmermann,
	Matthias Brugger, Sam Ravnborg, linux-arm-kernel

On Thu, Jun 2, 2022 at 4:03 PM CK Hu <ck.hu@mediatek.com> wrote:
>
> Hi, Hsin-Yi:
>
> I'm curious that panel driver setting orientation in get_modes() would
> work or not. It it works, why not just set orientation in get_modes()?
> I find that exynos dsi driver has implement the get_modes() [1] but
> Mediatek dsi does not implement. Would you try this?

It's explained in the cover letter:
```
Panels usually call drm_connector_set_panel_orientation(), which is
later than drm/kms driver calling drm_dev_register(). This leads to a
WARN()[1].
```
If the get_modes() in dsi is still being called later than bind(),
then the same issue still appears.
The purpose is to set the property before drm_dev_register().



>
> [1]
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/exynos/exynos_drm_dsi.c?h=v5.18#n1483
>
> Regards,
> CK
>
> On Wed, 2022-06-01 at 17:46 +0800, Hsin-Yi Wang wrote:
> > Panels usually call drm_connector_set_panel_orientation(), which is
> > later than drm/kms driver calling drm_dev_register(). This leads to a
> > WARN()[1].
> >
> > The orientation property is known earlier. For example, some panels
> > parse the property through device tree during probe.
> >
> > The series add a panel API drm_panel_get_orientation() for drm/kms
> > drivers. The drivers can use the API to get panel's orientation, so
> > they
> > can call drm_connector_set_panel_orientation() before
> > drm_dev_register().
> >
> > Panel needs to implement .get_orientation callback to return the
> > property.
> >
> > [1]
> > https://urldefense.com/v3/__https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/__;!!CTRNKA9wMg0ARbw!0ytf4wPxKANnYbw_fgq-eqQARnAXIHv4jwu04ZW6X6dAxZDFsJ0CltY_PvCBAQ$
> >
> >
> > Hsin-Yi Wang (8):
> >   drm/panel: Add an API drm_panel_get_orientation() to return panel
> >     orientation
> >   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
> >   drm/panel: panel-edp: Implement .get_orientation callback
> >   drm/panel: lvds: Implement .get_orientation callback
> >   drm/panel: panel-simple: Implement .get_orientation callback
> >   drm/panel: ili9881c: Implement .get_orientation callback
> >   drm/panel: elida-kd35t133: Implement .get_orientation callback
> >   drm/mediatek: Config orientation property if panel provides it
> >
> >  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
> >  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
> >  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
> >  include/drm/drm_panel.h                        | 10 ++++++++++
> >  9 files changed, 77 insertions(+)
> >
>

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-02  8:07     ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-02  8:07 UTC (permalink / raw)
  To: CK Hu
  Cc: Chun-Kuang Hu, Rob Clark, Rob Herring, David Airlie,
	linux-kernel, Douglas Anderson, Stephen Boyd, Hans de Goede,
	Thierry Reding, linux-mediatek, dri-devel, Thomas Zimmermann,
	Matthias Brugger, Sam Ravnborg, linux-arm-kernel

On Thu, Jun 2, 2022 at 4:03 PM CK Hu <ck.hu@mediatek.com> wrote:
>
> Hi, Hsin-Yi:
>
> I'm curious that panel driver setting orientation in get_modes() would
> work or not. It it works, why not just set orientation in get_modes()?
> I find that exynos dsi driver has implement the get_modes() [1] but
> Mediatek dsi does not implement. Would you try this?

It's explained in the cover letter:
```
Panels usually call drm_connector_set_panel_orientation(), which is
later than drm/kms driver calling drm_dev_register(). This leads to a
WARN()[1].
```
If the get_modes() in dsi is still being called later than bind(),
then the same issue still appears.
The purpose is to set the property before drm_dev_register().



>
> [1]
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/exynos/exynos_drm_dsi.c?h=v5.18#n1483
>
> Regards,
> CK
>
> On Wed, 2022-06-01 at 17:46 +0800, Hsin-Yi Wang wrote:
> > Panels usually call drm_connector_set_panel_orientation(), which is
> > later than drm/kms driver calling drm_dev_register(). This leads to a
> > WARN()[1].
> >
> > The orientation property is known earlier. For example, some panels
> > parse the property through device tree during probe.
> >
> > The series add a panel API drm_panel_get_orientation() for drm/kms
> > drivers. The drivers can use the API to get panel's orientation, so
> > they
> > can call drm_connector_set_panel_orientation() before
> > drm_dev_register().
> >
> > Panel needs to implement .get_orientation callback to return the
> > property.
> >
> > [1]
> > https://urldefense.com/v3/__https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/__;!!CTRNKA9wMg0ARbw!0ytf4wPxKANnYbw_fgq-eqQARnAXIHv4jwu04ZW6X6dAxZDFsJ0CltY_PvCBAQ$
> >
> >
> > Hsin-Yi Wang (8):
> >   drm/panel: Add an API drm_panel_get_orientation() to return panel
> >     orientation
> >   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
> >   drm/panel: panel-edp: Implement .get_orientation callback
> >   drm/panel: lvds: Implement .get_orientation callback
> >   drm/panel: panel-simple: Implement .get_orientation callback
> >   drm/panel: ili9881c: Implement .get_orientation callback
> >   drm/panel: elida-kd35t133: Implement .get_orientation callback
> >   drm/mediatek: Config orientation property if panel provides it
> >
> >  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
> >  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
> >  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
> >  include/drm/drm_panel.h                        | 10 ++++++++++
> >  9 files changed, 77 insertions(+)
> >
>

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-02  8:07     ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-02  8:07 UTC (permalink / raw)
  To: CK Hu
  Cc: Rob Clark, Chun-Kuang Hu, David Airlie, linux-kernel, dri-devel,
	Douglas Anderson, Hans de Goede, Rob Herring, Thierry Reding,
	Thomas Zimmermann, Matthias Brugger, linux-mediatek,
	Stephen Boyd, Sam Ravnborg, linux-arm-kernel

On Thu, Jun 2, 2022 at 4:03 PM CK Hu <ck.hu@mediatek.com> wrote:
>
> Hi, Hsin-Yi:
>
> I'm curious that panel driver setting orientation in get_modes() would
> work or not. It it works, why not just set orientation in get_modes()?
> I find that exynos dsi driver has implement the get_modes() [1] but
> Mediatek dsi does not implement. Would you try this?

It's explained in the cover letter:
```
Panels usually call drm_connector_set_panel_orientation(), which is
later than drm/kms driver calling drm_dev_register(). This leads to a
WARN()[1].
```
If the get_modes() in dsi is still being called later than bind(),
then the same issue still appears.
The purpose is to set the property before drm_dev_register().



>
> [1]
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/exynos/exynos_drm_dsi.c?h=v5.18#n1483
>
> Regards,
> CK
>
> On Wed, 2022-06-01 at 17:46 +0800, Hsin-Yi Wang wrote:
> > Panels usually call drm_connector_set_panel_orientation(), which is
> > later than drm/kms driver calling drm_dev_register(). This leads to a
> > WARN()[1].
> >
> > The orientation property is known earlier. For example, some panels
> > parse the property through device tree during probe.
> >
> > The series add a panel API drm_panel_get_orientation() for drm/kms
> > drivers. The drivers can use the API to get panel's orientation, so
> > they
> > can call drm_connector_set_panel_orientation() before
> > drm_dev_register().
> >
> > Panel needs to implement .get_orientation callback to return the
> > property.
> >
> > [1]
> > https://urldefense.com/v3/__https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/__;!!CTRNKA9wMg0ARbw!0ytf4wPxKANnYbw_fgq-eqQARnAXIHv4jwu04ZW6X6dAxZDFsJ0CltY_PvCBAQ$
> >
> >
> > Hsin-Yi Wang (8):
> >   drm/panel: Add an API drm_panel_get_orientation() to return panel
> >     orientation
> >   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
> >   drm/panel: panel-edp: Implement .get_orientation callback
> >   drm/panel: lvds: Implement .get_orientation callback
> >   drm/panel: panel-simple: Implement .get_orientation callback
> >   drm/panel: ili9881c: Implement .get_orientation callback
> >   drm/panel: elida-kd35t133: Implement .get_orientation callback
> >   drm/mediatek: Config orientation property if panel provides it
> >
> >  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
> >  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
> >  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
> >  include/drm/drm_panel.h                        | 10 ++++++++++
> >  9 files changed, 77 insertions(+)
> >
>

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-02  8:07     ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-02  8:07 UTC (permalink / raw)
  To: CK Hu
  Cc: Chun-Kuang Hu, Rob Clark, Rob Herring, David Airlie,
	linux-kernel, Douglas Anderson, Stephen Boyd, Hans de Goede,
	Thierry Reding, linux-mediatek, dri-devel, Thomas Zimmermann,
	Matthias Brugger, Sam Ravnborg, linux-arm-kernel

On Thu, Jun 2, 2022 at 4:03 PM CK Hu <ck.hu@mediatek.com> wrote:
>
> Hi, Hsin-Yi:
>
> I'm curious that panel driver setting orientation in get_modes() would
> work or not. It it works, why not just set orientation in get_modes()?
> I find that exynos dsi driver has implement the get_modes() [1] but
> Mediatek dsi does not implement. Would you try this?

It's explained in the cover letter:
```
Panels usually call drm_connector_set_panel_orientation(), which is
later than drm/kms driver calling drm_dev_register(). This leads to a
WARN()[1].
```
If the get_modes() in dsi is still being called later than bind(),
then the same issue still appears.
The purpose is to set the property before drm_dev_register().



>
> [1]
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/exynos/exynos_drm_dsi.c?h=v5.18#n1483
>
> Regards,
> CK
>
> On Wed, 2022-06-01 at 17:46 +0800, Hsin-Yi Wang wrote:
> > Panels usually call drm_connector_set_panel_orientation(), which is
> > later than drm/kms driver calling drm_dev_register(). This leads to a
> > WARN()[1].
> >
> > The orientation property is known earlier. For example, some panels
> > parse the property through device tree during probe.
> >
> > The series add a panel API drm_panel_get_orientation() for drm/kms
> > drivers. The drivers can use the API to get panel's orientation, so
> > they
> > can call drm_connector_set_panel_orientation() before
> > drm_dev_register().
> >
> > Panel needs to implement .get_orientation callback to return the
> > property.
> >
> > [1]
> > https://urldefense.com/v3/__https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/__;!!CTRNKA9wMg0ARbw!0ytf4wPxKANnYbw_fgq-eqQARnAXIHv4jwu04ZW6X6dAxZDFsJ0CltY_PvCBAQ$
> >
> >
> > Hsin-Yi Wang (8):
> >   drm/panel: Add an API drm_panel_get_orientation() to return panel
> >     orientation
> >   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
> >   drm/panel: panel-edp: Implement .get_orientation callback
> >   drm/panel: lvds: Implement .get_orientation callback
> >   drm/panel: panel-simple: Implement .get_orientation callback
> >   drm/panel: ili9881c: Implement .get_orientation callback
> >   drm/panel: elida-kd35t133: Implement .get_orientation callback
> >   drm/mediatek: Config orientation property if panel provides it
> >
> >  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
> >  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
> >  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
> >  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
> >  include/drm/drm_panel.h                        | 10 ++++++++++
> >  9 files changed, 77 insertions(+)
> >
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 3/8] drm/panel: panel-edp: Implement .get_orientation callback
  2022-06-01  9:46   ` Hsin-Yi Wang
  (?)
  (?)
@ 2022-06-02 21:43     ` Doug Anderson
  -1 siblings, 0 replies; 60+ messages in thread
From: Doug Anderson @ 2022-06-02 21:43 UTC (permalink / raw)
  To: Hsin-Yi Wang
  Cc: Chun-Kuang Hu, Hans de Goede, Thierry Reding, Sam Ravnborg,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Philipp Zabel, David Airlie, Daniel Vetter, Matthias Brugger,
	dri-devel, moderated list:ARM/Mediatek SoC support, Rob Clark,
	Stephen Boyd, Rob Herring, Linux ARM, LKML

Hi,

On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> To return the orientation property to drm/kms driver.
>
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/gpu/drm/panel/panel-edp.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c
> index 1732b4f56e38..a2133581a72d 100644
> --- a/drivers/gpu/drm/panel/panel-edp.c
> +++ b/drivers/gpu/drm/panel/panel-edp.c
> @@ -609,6 +609,13 @@ static int panel_edp_get_timings(struct drm_panel *panel,
>         return p->desc->num_timings;
>  }
>
> +static enum drm_panel_orientation panel_edp_get_orientation(struct drm_panel *panel)
> +{
> +       struct panel_edp *p = to_panel_edp(panel);
> +
> +       return p->orientation;
> +}
> +
>  static int detected_panel_show(struct seq_file *s, void *data)
>  {
>         struct drm_panel *panel = s->private;
> @@ -637,6 +644,7 @@ static const struct drm_panel_funcs panel_edp_funcs = {
>         .prepare = panel_edp_prepare,
>         .enable = panel_edp_enable,
>         .get_modes = panel_edp_get_modes,
> +       .get_orientation = panel_edp_get_orientation,
>         .get_timings = panel_edp_get_timings,
>         .debugfs_init = panel_edp_debugfs_init,
>  };

I'm curious: should we be removing the old
drm_connector_set_panel_orientation() from panel_edp_get_modes()?
...or maybe you want to keep it for now because you're only adding
support to the mediatek driver and for other drivers the WARN_ON is
better than no orientation support at all?

Maybe you could put a comment next to the old
drm_connector_set_panel_orientation() saying that it's deprecated and
that drm drivers are expected to add a call to get_orientation()? Then
when people see the WARN_ON splat they'll quickly figure out how to
fix it. ...and eventually we can probably remove all the old calls
from get_modes() ?

-Doug

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 3/8] drm/panel: panel-edp: Implement .get_orientation callback
@ 2022-06-02 21:43     ` Doug Anderson
  0 siblings, 0 replies; 60+ messages in thread
From: Doug Anderson @ 2022-06-02 21:43 UTC (permalink / raw)
  To: Hsin-Yi Wang
  Cc: Chun-Kuang Hu, Hans de Goede, Thierry Reding, Sam Ravnborg,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Philipp Zabel, David Airlie, Daniel Vetter, Matthias Brugger,
	dri-devel, moderated list:ARM/Mediatek SoC support, Rob Clark,
	Stephen Boyd, Rob Herring, Linux ARM, LKML

Hi,

On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> To return the orientation property to drm/kms driver.
>
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/gpu/drm/panel/panel-edp.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c
> index 1732b4f56e38..a2133581a72d 100644
> --- a/drivers/gpu/drm/panel/panel-edp.c
> +++ b/drivers/gpu/drm/panel/panel-edp.c
> @@ -609,6 +609,13 @@ static int panel_edp_get_timings(struct drm_panel *panel,
>         return p->desc->num_timings;
>  }
>
> +static enum drm_panel_orientation panel_edp_get_orientation(struct drm_panel *panel)
> +{
> +       struct panel_edp *p = to_panel_edp(panel);
> +
> +       return p->orientation;
> +}
> +
>  static int detected_panel_show(struct seq_file *s, void *data)
>  {
>         struct drm_panel *panel = s->private;
> @@ -637,6 +644,7 @@ static const struct drm_panel_funcs panel_edp_funcs = {
>         .prepare = panel_edp_prepare,
>         .enable = panel_edp_enable,
>         .get_modes = panel_edp_get_modes,
> +       .get_orientation = panel_edp_get_orientation,
>         .get_timings = panel_edp_get_timings,
>         .debugfs_init = panel_edp_debugfs_init,
>  };

I'm curious: should we be removing the old
drm_connector_set_panel_orientation() from panel_edp_get_modes()?
...or maybe you want to keep it for now because you're only adding
support to the mediatek driver and for other drivers the WARN_ON is
better than no orientation support at all?

Maybe you could put a comment next to the old
drm_connector_set_panel_orientation() saying that it's deprecated and
that drm drivers are expected to add a call to get_orientation()? Then
when people see the WARN_ON splat they'll quickly figure out how to
fix it. ...and eventually we can probably remove all the old calls
from get_modes() ?

-Doug

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 3/8] drm/panel: panel-edp: Implement .get_orientation callback
@ 2022-06-02 21:43     ` Doug Anderson
  0 siblings, 0 replies; 60+ messages in thread
From: Doug Anderson @ 2022-06-02 21:43 UTC (permalink / raw)
  To: Hsin-Yi Wang
  Cc: Rob Clark, Chun-Kuang Hu, Rob Herring, David Airlie, LKML,
	Stephen Boyd, Hans de Goede, Thierry Reding,
	moderated list:ARM/Mediatek SoC support, dri-devel,
	Thomas Zimmermann, Matthias Brugger, Sam Ravnborg, Linux ARM

Hi,

On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> To return the orientation property to drm/kms driver.
>
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/gpu/drm/panel/panel-edp.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c
> index 1732b4f56e38..a2133581a72d 100644
> --- a/drivers/gpu/drm/panel/panel-edp.c
> +++ b/drivers/gpu/drm/panel/panel-edp.c
> @@ -609,6 +609,13 @@ static int panel_edp_get_timings(struct drm_panel *panel,
>         return p->desc->num_timings;
>  }
>
> +static enum drm_panel_orientation panel_edp_get_orientation(struct drm_panel *panel)
> +{
> +       struct panel_edp *p = to_panel_edp(panel);
> +
> +       return p->orientation;
> +}
> +
>  static int detected_panel_show(struct seq_file *s, void *data)
>  {
>         struct drm_panel *panel = s->private;
> @@ -637,6 +644,7 @@ static const struct drm_panel_funcs panel_edp_funcs = {
>         .prepare = panel_edp_prepare,
>         .enable = panel_edp_enable,
>         .get_modes = panel_edp_get_modes,
> +       .get_orientation = panel_edp_get_orientation,
>         .get_timings = panel_edp_get_timings,
>         .debugfs_init = panel_edp_debugfs_init,
>  };

I'm curious: should we be removing the old
drm_connector_set_panel_orientation() from panel_edp_get_modes()?
...or maybe you want to keep it for now because you're only adding
support to the mediatek driver and for other drivers the WARN_ON is
better than no orientation support at all?

Maybe you could put a comment next to the old
drm_connector_set_panel_orientation() saying that it's deprecated and
that drm drivers are expected to add a call to get_orientation()? Then
when people see the WARN_ON splat they'll quickly figure out how to
fix it. ...and eventually we can probably remove all the old calls
from get_modes() ?

-Doug

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 3/8] drm/panel: panel-edp: Implement .get_orientation callback
@ 2022-06-02 21:43     ` Doug Anderson
  0 siblings, 0 replies; 60+ messages in thread
From: Doug Anderson @ 2022-06-02 21:43 UTC (permalink / raw)
  To: Hsin-Yi Wang
  Cc: Chun-Kuang Hu, Hans de Goede, Thierry Reding, Sam Ravnborg,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Philipp Zabel, David Airlie, Daniel Vetter, Matthias Brugger,
	dri-devel, moderated list:ARM/Mediatek SoC support, Rob Clark,
	Stephen Boyd, Rob Herring, Linux ARM, LKML

Hi,

On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> To return the orientation property to drm/kms driver.
>
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/gpu/drm/panel/panel-edp.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c
> index 1732b4f56e38..a2133581a72d 100644
> --- a/drivers/gpu/drm/panel/panel-edp.c
> +++ b/drivers/gpu/drm/panel/panel-edp.c
> @@ -609,6 +609,13 @@ static int panel_edp_get_timings(struct drm_panel *panel,
>         return p->desc->num_timings;
>  }
>
> +static enum drm_panel_orientation panel_edp_get_orientation(struct drm_panel *panel)
> +{
> +       struct panel_edp *p = to_panel_edp(panel);
> +
> +       return p->orientation;
> +}
> +
>  static int detected_panel_show(struct seq_file *s, void *data)
>  {
>         struct drm_panel *panel = s->private;
> @@ -637,6 +644,7 @@ static const struct drm_panel_funcs panel_edp_funcs = {
>         .prepare = panel_edp_prepare,
>         .enable = panel_edp_enable,
>         .get_modes = panel_edp_get_modes,
> +       .get_orientation = panel_edp_get_orientation,
>         .get_timings = panel_edp_get_timings,
>         .debugfs_init = panel_edp_debugfs_init,
>  };

I'm curious: should we be removing the old
drm_connector_set_panel_orientation() from panel_edp_get_modes()?
...or maybe you want to keep it for now because you're only adding
support to the mediatek driver and for other drivers the WARN_ON is
better than no orientation support at all?

Maybe you could put a comment next to the old
drm_connector_set_panel_orientation() saying that it's deprecated and
that drm drivers are expected to add a call to get_orientation()? Then
when people see the WARN_ON splat they'll quickly figure out how to
fix it. ...and eventually we can probably remove all the old calls
from get_modes() ?

-Doug

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
  2022-06-01  9:46 ` Hsin-Yi Wang
  (?)
  (?)
@ 2022-06-02 21:48   ` Doug Anderson
  -1 siblings, 0 replies; 60+ messages in thread
From: Doug Anderson @ 2022-06-02 21:48 UTC (permalink / raw)
  To: Hsin-Yi Wang
  Cc: Chun-Kuang Hu, Hans de Goede, Thierry Reding, Sam Ravnborg,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Philipp Zabel, David Airlie, Daniel Vetter, Matthias Brugger,
	dri-devel, moderated list:ARM/Mediatek SoC support, Rob Clark,
	Stephen Boyd, Rob Herring, Linux ARM, LKML

Hi,

On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> Panels usually call drm_connector_set_panel_orientation(), which is
> later than drm/kms driver calling drm_dev_register(). This leads to a
> WARN()[1].
>
> The orientation property is known earlier. For example, some panels
> parse the property through device tree during probe.
>
> The series add a panel API drm_panel_get_orientation() for drm/kms
> drivers. The drivers can use the API to get panel's orientation, so they
> can call drm_connector_set_panel_orientation() before drm_dev_register().
>
> Panel needs to implement .get_orientation callback to return the property.
>
> [1] https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/
>
> Hsin-Yi Wang (8):
>   drm/panel: Add an API drm_panel_get_orientation() to return panel
>     orientation
>   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
>   drm/panel: panel-edp: Implement .get_orientation callback
>   drm/panel: lvds: Implement .get_orientation callback
>   drm/panel: panel-simple: Implement .get_orientation callback
>   drm/panel: ili9881c: Implement .get_orientation callback
>   drm/panel: elida-kd35t133: Implement .get_orientation callback
>   drm/mediatek: Config orientation property if panel provides it
>
>  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
>  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
>  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
>  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
>  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
>  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
>  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
>  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
>  include/drm/drm_panel.h                        | 10 ++++++++++
>  9 files changed, 77 insertions(+)

Seems reasonable to me. I added a request to the panel-edp patch that
probably applies to all of the panel patches requesting a comment next
to the old calls in get_modes().

I assume that all but patch #8 ought to land through drm-misc. I'm
happy to help commit them once everyone is happy. If the Mediatek
maintainer(s) want to Ack patch #8 I can land that in drm-misc too. If
we want something fancier like an immutable branch you'll probably
have to get someone involved that's got a higher drm pay grade than
me. ;-)

-Doug

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-02 21:48   ` Doug Anderson
  0 siblings, 0 replies; 60+ messages in thread
From: Doug Anderson @ 2022-06-02 21:48 UTC (permalink / raw)
  To: Hsin-Yi Wang
  Cc: Rob Clark, Chun-Kuang Hu, Rob Herring, David Airlie, LKML,
	Stephen Boyd, Hans de Goede, Thierry Reding,
	moderated list:ARM/Mediatek SoC support, dri-devel,
	Thomas Zimmermann, Matthias Brugger, Sam Ravnborg, Linux ARM

Hi,

On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> Panels usually call drm_connector_set_panel_orientation(), which is
> later than drm/kms driver calling drm_dev_register(). This leads to a
> WARN()[1].
>
> The orientation property is known earlier. For example, some panels
> parse the property through device tree during probe.
>
> The series add a panel API drm_panel_get_orientation() for drm/kms
> drivers. The drivers can use the API to get panel's orientation, so they
> can call drm_connector_set_panel_orientation() before drm_dev_register().
>
> Panel needs to implement .get_orientation callback to return the property.
>
> [1] https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/
>
> Hsin-Yi Wang (8):
>   drm/panel: Add an API drm_panel_get_orientation() to return panel
>     orientation
>   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
>   drm/panel: panel-edp: Implement .get_orientation callback
>   drm/panel: lvds: Implement .get_orientation callback
>   drm/panel: panel-simple: Implement .get_orientation callback
>   drm/panel: ili9881c: Implement .get_orientation callback
>   drm/panel: elida-kd35t133: Implement .get_orientation callback
>   drm/mediatek: Config orientation property if panel provides it
>
>  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
>  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
>  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
>  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
>  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
>  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
>  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
>  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
>  include/drm/drm_panel.h                        | 10 ++++++++++
>  9 files changed, 77 insertions(+)

Seems reasonable to me. I added a request to the panel-edp patch that
probably applies to all of the panel patches requesting a comment next
to the old calls in get_modes().

I assume that all but patch #8 ought to land through drm-misc. I'm
happy to help commit them once everyone is happy. If the Mediatek
maintainer(s) want to Ack patch #8 I can land that in drm-misc too. If
we want something fancier like an immutable branch you'll probably
have to get someone involved that's got a higher drm pay grade than
me. ;-)

-Doug

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-02 21:48   ` Doug Anderson
  0 siblings, 0 replies; 60+ messages in thread
From: Doug Anderson @ 2022-06-02 21:48 UTC (permalink / raw)
  To: Hsin-Yi Wang
  Cc: Chun-Kuang Hu, Hans de Goede, Thierry Reding, Sam Ravnborg,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Philipp Zabel, David Airlie, Daniel Vetter, Matthias Brugger,
	dri-devel, moderated list:ARM/Mediatek SoC support, Rob Clark,
	Stephen Boyd, Rob Herring, Linux ARM, LKML

Hi,

On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> Panels usually call drm_connector_set_panel_orientation(), which is
> later than drm/kms driver calling drm_dev_register(). This leads to a
> WARN()[1].
>
> The orientation property is known earlier. For example, some panels
> parse the property through device tree during probe.
>
> The series add a panel API drm_panel_get_orientation() for drm/kms
> drivers. The drivers can use the API to get panel's orientation, so they
> can call drm_connector_set_panel_orientation() before drm_dev_register().
>
> Panel needs to implement .get_orientation callback to return the property.
>
> [1] https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/
>
> Hsin-Yi Wang (8):
>   drm/panel: Add an API drm_panel_get_orientation() to return panel
>     orientation
>   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
>   drm/panel: panel-edp: Implement .get_orientation callback
>   drm/panel: lvds: Implement .get_orientation callback
>   drm/panel: panel-simple: Implement .get_orientation callback
>   drm/panel: ili9881c: Implement .get_orientation callback
>   drm/panel: elida-kd35t133: Implement .get_orientation callback
>   drm/mediatek: Config orientation property if panel provides it
>
>  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
>  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
>  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
>  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
>  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
>  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
>  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
>  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
>  include/drm/drm_panel.h                        | 10 ++++++++++
>  9 files changed, 77 insertions(+)

Seems reasonable to me. I added a request to the panel-edp patch that
probably applies to all of the panel patches requesting a comment next
to the old calls in get_modes().

I assume that all but patch #8 ought to land through drm-misc. I'm
happy to help commit them once everyone is happy. If the Mediatek
maintainer(s) want to Ack patch #8 I can land that in drm-misc too. If
we want something fancier like an immutable branch you'll probably
have to get someone involved that's got a higher drm pay grade than
me. ;-)

-Doug

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-02 21:48   ` Doug Anderson
  0 siblings, 0 replies; 60+ messages in thread
From: Doug Anderson @ 2022-06-02 21:48 UTC (permalink / raw)
  To: Hsin-Yi Wang
  Cc: Chun-Kuang Hu, Hans de Goede, Thierry Reding, Sam Ravnborg,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Philipp Zabel, David Airlie, Daniel Vetter, Matthias Brugger,
	dri-devel, moderated list:ARM/Mediatek SoC support, Rob Clark,
	Stephen Boyd, Rob Herring, Linux ARM, LKML

Hi,

On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> Panels usually call drm_connector_set_panel_orientation(), which is
> later than drm/kms driver calling drm_dev_register(). This leads to a
> WARN()[1].
>
> The orientation property is known earlier. For example, some panels
> parse the property through device tree during probe.
>
> The series add a panel API drm_panel_get_orientation() for drm/kms
> drivers. The drivers can use the API to get panel's orientation, so they
> can call drm_connector_set_panel_orientation() before drm_dev_register().
>
> Panel needs to implement .get_orientation callback to return the property.
>
> [1] https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/
>
> Hsin-Yi Wang (8):
>   drm/panel: Add an API drm_panel_get_orientation() to return panel
>     orientation
>   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
>   drm/panel: panel-edp: Implement .get_orientation callback
>   drm/panel: lvds: Implement .get_orientation callback
>   drm/panel: panel-simple: Implement .get_orientation callback
>   drm/panel: ili9881c: Implement .get_orientation callback
>   drm/panel: elida-kd35t133: Implement .get_orientation callback
>   drm/mediatek: Config orientation property if panel provides it
>
>  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
>  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
>  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
>  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
>  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
>  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
>  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
>  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
>  include/drm/drm_panel.h                        | 10 ++++++++++
>  9 files changed, 77 insertions(+)

Seems reasonable to me. I added a request to the panel-edp patch that
probably applies to all of the panel patches requesting a comment next
to the old calls in get_modes().

I assume that all but patch #8 ought to land through drm-misc. I'm
happy to help commit them once everyone is happy. If the Mediatek
maintainer(s) want to Ack patch #8 I can land that in drm-misc too. If
we want something fancier like an immutable branch you'll probably
have to get someone involved that's got a higher drm pay grade than
me. ;-)

-Doug

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 3/8] drm/panel: panel-edp: Implement .get_orientation callback
  2022-06-02 21:43     ` Doug Anderson
  (?)
  (?)
@ 2022-06-03  4:01       ` Hsin-Yi Wang
  -1 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-03  4:01 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Chun-Kuang Hu, Hans de Goede, Thierry Reding, Sam Ravnborg,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Philipp Zabel, David Airlie, Daniel Vetter, Matthias Brugger,
	dri-devel, moderated list:ARM/Mediatek SoC support, Rob Clark,
	Stephen Boyd, Rob Herring, Linux ARM, LKML

On Fri, Jun 3, 2022 at 5:51 AM Doug Anderson <dianders@chromium.org> wrote:
>
> Hi,
>
> On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> >
> > To return the orientation property to drm/kms driver.
> >
> > Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> > Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> > ---
> >  drivers/gpu/drm/panel/panel-edp.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c
> > index 1732b4f56e38..a2133581a72d 100644
> > --- a/drivers/gpu/drm/panel/panel-edp.c
> > +++ b/drivers/gpu/drm/panel/panel-edp.c
> > @@ -609,6 +609,13 @@ static int panel_edp_get_timings(struct drm_panel *panel,
> >         return p->desc->num_timings;
> >  }
> >
> > +static enum drm_panel_orientation panel_edp_get_orientation(struct drm_panel *panel)
> > +{
> > +       struct panel_edp *p = to_panel_edp(panel);
> > +
> > +       return p->orientation;
> > +}
> > +
> >  static int detected_panel_show(struct seq_file *s, void *data)
> >  {
> >         struct drm_panel *panel = s->private;
> > @@ -637,6 +644,7 @@ static const struct drm_panel_funcs panel_edp_funcs = {
> >         .prepare = panel_edp_prepare,
> >         .enable = panel_edp_enable,
> >         .get_modes = panel_edp_get_modes,
> > +       .get_orientation = panel_edp_get_orientation,
> >         .get_timings = panel_edp_get_timings,
> >         .debugfs_init = panel_edp_debugfs_init,
> >  };
>
> I'm curious: should we be removing the old
> drm_connector_set_panel_orientation() from panel_edp_get_modes()?
> ...or maybe you want to keep it for now because you're only adding
> support to the mediatek driver and for other drivers the WARN_ON is
> better than no orientation support at all?

Right, for the drm/kms drivers that calls
drm_connector_set_panel_orientation(), the
drm_connector_set_panel_orientation() called in panels is no-op, but
others they still need this to be called in the panel.
>
> Maybe you could put a comment next to the old
> drm_connector_set_panel_orientation() saying that it's deprecated and
> that drm drivers are expected to add a call to get_orientation()? Then
> when people see the WARN_ON splat they'll quickly figure out how to
> fix it. ...and eventually we can probably remove all the old calls
> from get_modes() ?
Sure, sounds good to me. I will add this.

>
> -Doug

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 3/8] drm/panel: panel-edp: Implement .get_orientation callback
@ 2022-06-03  4:01       ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-03  4:01 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Chun-Kuang Hu, Hans de Goede, Thierry Reding, Sam Ravnborg,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Philipp Zabel, David Airlie, Daniel Vetter, Matthias Brugger,
	dri-devel, moderated list:ARM/Mediatek SoC support, Rob Clark,
	Stephen Boyd, Rob Herring, Linux ARM, LKML

On Fri, Jun 3, 2022 at 5:51 AM Doug Anderson <dianders@chromium.org> wrote:
>
> Hi,
>
> On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> >
> > To return the orientation property to drm/kms driver.
> >
> > Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> > Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> > ---
> >  drivers/gpu/drm/panel/panel-edp.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c
> > index 1732b4f56e38..a2133581a72d 100644
> > --- a/drivers/gpu/drm/panel/panel-edp.c
> > +++ b/drivers/gpu/drm/panel/panel-edp.c
> > @@ -609,6 +609,13 @@ static int panel_edp_get_timings(struct drm_panel *panel,
> >         return p->desc->num_timings;
> >  }
> >
> > +static enum drm_panel_orientation panel_edp_get_orientation(struct drm_panel *panel)
> > +{
> > +       struct panel_edp *p = to_panel_edp(panel);
> > +
> > +       return p->orientation;
> > +}
> > +
> >  static int detected_panel_show(struct seq_file *s, void *data)
> >  {
> >         struct drm_panel *panel = s->private;
> > @@ -637,6 +644,7 @@ static const struct drm_panel_funcs panel_edp_funcs = {
> >         .prepare = panel_edp_prepare,
> >         .enable = panel_edp_enable,
> >         .get_modes = panel_edp_get_modes,
> > +       .get_orientation = panel_edp_get_orientation,
> >         .get_timings = panel_edp_get_timings,
> >         .debugfs_init = panel_edp_debugfs_init,
> >  };
>
> I'm curious: should we be removing the old
> drm_connector_set_panel_orientation() from panel_edp_get_modes()?
> ...or maybe you want to keep it for now because you're only adding
> support to the mediatek driver and for other drivers the WARN_ON is
> better than no orientation support at all?

Right, for the drm/kms drivers that calls
drm_connector_set_panel_orientation(), the
drm_connector_set_panel_orientation() called in panels is no-op, but
others they still need this to be called in the panel.
>
> Maybe you could put a comment next to the old
> drm_connector_set_panel_orientation() saying that it's deprecated and
> that drm drivers are expected to add a call to get_orientation()? Then
> when people see the WARN_ON splat they'll quickly figure out how to
> fix it. ...and eventually we can probably remove all the old calls
> from get_modes() ?
Sure, sounds good to me. I will add this.

>
> -Doug

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 3/8] drm/panel: panel-edp: Implement .get_orientation callback
@ 2022-06-03  4:01       ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-03  4:01 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Rob Clark, Chun-Kuang Hu, Rob Herring, David Airlie, LKML,
	Stephen Boyd, Hans de Goede, Thierry Reding,
	moderated list:ARM/Mediatek SoC support, dri-devel,
	Thomas Zimmermann, Matthias Brugger, Sam Ravnborg, Linux ARM

On Fri, Jun 3, 2022 at 5:51 AM Doug Anderson <dianders@chromium.org> wrote:
>
> Hi,
>
> On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> >
> > To return the orientation property to drm/kms driver.
> >
> > Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> > Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> > ---
> >  drivers/gpu/drm/panel/panel-edp.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c
> > index 1732b4f56e38..a2133581a72d 100644
> > --- a/drivers/gpu/drm/panel/panel-edp.c
> > +++ b/drivers/gpu/drm/panel/panel-edp.c
> > @@ -609,6 +609,13 @@ static int panel_edp_get_timings(struct drm_panel *panel,
> >         return p->desc->num_timings;
> >  }
> >
> > +static enum drm_panel_orientation panel_edp_get_orientation(struct drm_panel *panel)
> > +{
> > +       struct panel_edp *p = to_panel_edp(panel);
> > +
> > +       return p->orientation;
> > +}
> > +
> >  static int detected_panel_show(struct seq_file *s, void *data)
> >  {
> >         struct drm_panel *panel = s->private;
> > @@ -637,6 +644,7 @@ static const struct drm_panel_funcs panel_edp_funcs = {
> >         .prepare = panel_edp_prepare,
> >         .enable = panel_edp_enable,
> >         .get_modes = panel_edp_get_modes,
> > +       .get_orientation = panel_edp_get_orientation,
> >         .get_timings = panel_edp_get_timings,
> >         .debugfs_init = panel_edp_debugfs_init,
> >  };
>
> I'm curious: should we be removing the old
> drm_connector_set_panel_orientation() from panel_edp_get_modes()?
> ...or maybe you want to keep it for now because you're only adding
> support to the mediatek driver and for other drivers the WARN_ON is
> better than no orientation support at all?

Right, for the drm/kms drivers that calls
drm_connector_set_panel_orientation(), the
drm_connector_set_panel_orientation() called in panels is no-op, but
others they still need this to be called in the panel.
>
> Maybe you could put a comment next to the old
> drm_connector_set_panel_orientation() saying that it's deprecated and
> that drm drivers are expected to add a call to get_orientation()? Then
> when people see the WARN_ON splat they'll quickly figure out how to
> fix it. ...and eventually we can probably remove all the old calls
> from get_modes() ?
Sure, sounds good to me. I will add this.

>
> -Doug

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 3/8] drm/panel: panel-edp: Implement .get_orientation callback
@ 2022-06-03  4:01       ` Hsin-Yi Wang
  0 siblings, 0 replies; 60+ messages in thread
From: Hsin-Yi Wang @ 2022-06-03  4:01 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Chun-Kuang Hu, Hans de Goede, Thierry Reding, Sam Ravnborg,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Philipp Zabel, David Airlie, Daniel Vetter, Matthias Brugger,
	dri-devel, moderated list:ARM/Mediatek SoC support, Rob Clark,
	Stephen Boyd, Rob Herring, Linux ARM, LKML

On Fri, Jun 3, 2022 at 5:51 AM Doug Anderson <dianders@chromium.org> wrote:
>
> Hi,
>
> On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
> >
> > To return the orientation property to drm/kms driver.
> >
> > Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> > Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> > ---
> >  drivers/gpu/drm/panel/panel-edp.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c
> > index 1732b4f56e38..a2133581a72d 100644
> > --- a/drivers/gpu/drm/panel/panel-edp.c
> > +++ b/drivers/gpu/drm/panel/panel-edp.c
> > @@ -609,6 +609,13 @@ static int panel_edp_get_timings(struct drm_panel *panel,
> >         return p->desc->num_timings;
> >  }
> >
> > +static enum drm_panel_orientation panel_edp_get_orientation(struct drm_panel *panel)
> > +{
> > +       struct panel_edp *p = to_panel_edp(panel);
> > +
> > +       return p->orientation;
> > +}
> > +
> >  static int detected_panel_show(struct seq_file *s, void *data)
> >  {
> >         struct drm_panel *panel = s->private;
> > @@ -637,6 +644,7 @@ static const struct drm_panel_funcs panel_edp_funcs = {
> >         .prepare = panel_edp_prepare,
> >         .enable = panel_edp_enable,
> >         .get_modes = panel_edp_get_modes,
> > +       .get_orientation = panel_edp_get_orientation,
> >         .get_timings = panel_edp_get_timings,
> >         .debugfs_init = panel_edp_debugfs_init,
> >  };
>
> I'm curious: should we be removing the old
> drm_connector_set_panel_orientation() from panel_edp_get_modes()?
> ...or maybe you want to keep it for now because you're only adding
> support to the mediatek driver and for other drivers the WARN_ON is
> better than no orientation support at all?

Right, for the drm/kms drivers that calls
drm_connector_set_panel_orientation(), the
drm_connector_set_panel_orientation() called in panels is no-op, but
others they still need this to be called in the panel.
>
> Maybe you could put a comment next to the old
> drm_connector_set_panel_orientation() saying that it's deprecated and
> that drm drivers are expected to add a call to get_orientation()? Then
> when people see the WARN_ON splat they'll quickly figure out how to
> fix it. ...and eventually we can probably remove all the old calls
> from get_modes() ?
Sure, sounds good to me. I will add this.

>
> -Doug

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
  2022-06-02 21:48   ` Doug Anderson
  (?)
  (?)
@ 2022-06-03  6:53     ` Hans de Goede
  -1 siblings, 0 replies; 60+ messages in thread
From: Hans de Goede @ 2022-06-03  6:53 UTC (permalink / raw)
  To: Doug Anderson, Hsin-Yi Wang
  Cc: Chun-Kuang Hu, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel,
	moderated list:ARM/Mediatek SoC support, Rob Clark, Stephen Boyd,
	Rob Herring, Linux ARM, LKML

Hi,

On 6/2/22 23:48, Doug Anderson wrote:
> Hi,
> 
> On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>>
>> Panels usually call drm_connector_set_panel_orientation(), which is
>> later than drm/kms driver calling drm_dev_register(). This leads to a
>> WARN()[1].
>>
>> The orientation property is known earlier. For example, some panels
>> parse the property through device tree during probe.
>>
>> The series add a panel API drm_panel_get_orientation() for drm/kms
>> drivers. The drivers can use the API to get panel's orientation, so they
>> can call drm_connector_set_panel_orientation() before drm_dev_register().
>>
>> Panel needs to implement .get_orientation callback to return the property.
>>
>> [1] https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/
>>
>> Hsin-Yi Wang (8):
>>   drm/panel: Add an API drm_panel_get_orientation() to return panel
>>     orientation
>>   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
>>   drm/panel: panel-edp: Implement .get_orientation callback
>>   drm/panel: lvds: Implement .get_orientation callback
>>   drm/panel: panel-simple: Implement .get_orientation callback
>>   drm/panel: ili9881c: Implement .get_orientation callback
>>   drm/panel: elida-kd35t133: Implement .get_orientation callback
>>   drm/mediatek: Config orientation property if panel provides it
>>
>>  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
>>  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
>>  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
>>  include/drm/drm_panel.h                        | 10 ++++++++++
>>  9 files changed, 77 insertions(+)
> 
> Seems reasonable to me. I added a request to the panel-edp patch that
> probably applies to all of the panel patches requesting a comment next
> to the old calls in get_modes().
> 
> I assume that all but patch #8 ought to land through drm-misc. I'm
> happy to help commit them once everyone is happy. If the Mediatek
> maintainer(s) want to Ack patch #8 I can land that in drm-misc too. If
> we want something fancier like an immutable branch you'll probably
> have to get someone involved that's got a higher drm pay grade than
> me. ;-)

Thanks, patch 8/8 looks good to me now too, so:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

for the series.

Note I'm currently travelling so I cannot push this to drm-mic-next
myself.

Regards,

Hans



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-03  6:53     ` Hans de Goede
  0 siblings, 0 replies; 60+ messages in thread
From: Hans de Goede @ 2022-06-03  6:53 UTC (permalink / raw)
  To: Doug Anderson, Hsin-Yi Wang
  Cc: Rob Clark, Chun-Kuang Hu, David Airlie, LKML, Stephen Boyd,
	Rob Herring, Thierry Reding,
	moderated list:ARM/Mediatek SoC support, dri-devel,
	Thomas Zimmermann, Matthias Brugger, Sam Ravnborg, Linux ARM

Hi,

On 6/2/22 23:48, Doug Anderson wrote:
> Hi,
> 
> On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>>
>> Panels usually call drm_connector_set_panel_orientation(), which is
>> later than drm/kms driver calling drm_dev_register(). This leads to a
>> WARN()[1].
>>
>> The orientation property is known earlier. For example, some panels
>> parse the property through device tree during probe.
>>
>> The series add a panel API drm_panel_get_orientation() for drm/kms
>> drivers. The drivers can use the API to get panel's orientation, so they
>> can call drm_connector_set_panel_orientation() before drm_dev_register().
>>
>> Panel needs to implement .get_orientation callback to return the property.
>>
>> [1] https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/
>>
>> Hsin-Yi Wang (8):
>>   drm/panel: Add an API drm_panel_get_orientation() to return panel
>>     orientation
>>   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
>>   drm/panel: panel-edp: Implement .get_orientation callback
>>   drm/panel: lvds: Implement .get_orientation callback
>>   drm/panel: panel-simple: Implement .get_orientation callback
>>   drm/panel: ili9881c: Implement .get_orientation callback
>>   drm/panel: elida-kd35t133: Implement .get_orientation callback
>>   drm/mediatek: Config orientation property if panel provides it
>>
>>  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
>>  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
>>  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
>>  include/drm/drm_panel.h                        | 10 ++++++++++
>>  9 files changed, 77 insertions(+)
> 
> Seems reasonable to me. I added a request to the panel-edp patch that
> probably applies to all of the panel patches requesting a comment next
> to the old calls in get_modes().
> 
> I assume that all but patch #8 ought to land through drm-misc. I'm
> happy to help commit them once everyone is happy. If the Mediatek
> maintainer(s) want to Ack patch #8 I can land that in drm-misc too. If
> we want something fancier like an immutable branch you'll probably
> have to get someone involved that's got a higher drm pay grade than
> me. ;-)

Thanks, patch 8/8 looks good to me now too, so:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

for the series.

Note I'm currently travelling so I cannot push this to drm-mic-next
myself.

Regards,

Hans



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-03  6:53     ` Hans de Goede
  0 siblings, 0 replies; 60+ messages in thread
From: Hans de Goede @ 2022-06-03  6:53 UTC (permalink / raw)
  To: Doug Anderson, Hsin-Yi Wang
  Cc: Chun-Kuang Hu, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel,
	moderated list:ARM/Mediatek SoC support, Rob Clark, Stephen Boyd,
	Rob Herring, Linux ARM, LKML

Hi,

On 6/2/22 23:48, Doug Anderson wrote:
> Hi,
> 
> On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>>
>> Panels usually call drm_connector_set_panel_orientation(), which is
>> later than drm/kms driver calling drm_dev_register(). This leads to a
>> WARN()[1].
>>
>> The orientation property is known earlier. For example, some panels
>> parse the property through device tree during probe.
>>
>> The series add a panel API drm_panel_get_orientation() for drm/kms
>> drivers. The drivers can use the API to get panel's orientation, so they
>> can call drm_connector_set_panel_orientation() before drm_dev_register().
>>
>> Panel needs to implement .get_orientation callback to return the property.
>>
>> [1] https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/
>>
>> Hsin-Yi Wang (8):
>>   drm/panel: Add an API drm_panel_get_orientation() to return panel
>>     orientation
>>   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
>>   drm/panel: panel-edp: Implement .get_orientation callback
>>   drm/panel: lvds: Implement .get_orientation callback
>>   drm/panel: panel-simple: Implement .get_orientation callback
>>   drm/panel: ili9881c: Implement .get_orientation callback
>>   drm/panel: elida-kd35t133: Implement .get_orientation callback
>>   drm/mediatek: Config orientation property if panel provides it
>>
>>  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
>>  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
>>  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
>>  include/drm/drm_panel.h                        | 10 ++++++++++
>>  9 files changed, 77 insertions(+)
> 
> Seems reasonable to me. I added a request to the panel-edp patch that
> probably applies to all of the panel patches requesting a comment next
> to the old calls in get_modes().
> 
> I assume that all but patch #8 ought to land through drm-misc. I'm
> happy to help commit them once everyone is happy. If the Mediatek
> maintainer(s) want to Ack patch #8 I can land that in drm-misc too. If
> we want something fancier like an immutable branch you'll probably
> have to get someone involved that's got a higher drm pay grade than
> me. ;-)

Thanks, patch 8/8 looks good to me now too, so:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

for the series.

Note I'm currently travelling so I cannot push this to drm-mic-next
myself.

Regards,

Hans



_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH v2 0/8] Add a panel API to return panel orientation
@ 2022-06-03  6:53     ` Hans de Goede
  0 siblings, 0 replies; 60+ messages in thread
From: Hans de Goede @ 2022-06-03  6:53 UTC (permalink / raw)
  To: Doug Anderson, Hsin-Yi Wang
  Cc: Chun-Kuang Hu, Thierry Reding, Sam Ravnborg, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, Philipp Zabel, David Airlie,
	Daniel Vetter, Matthias Brugger, dri-devel,
	moderated list:ARM/Mediatek SoC support, Rob Clark, Stephen Boyd,
	Rob Herring, Linux ARM, LKML

Hi,

On 6/2/22 23:48, Doug Anderson wrote:
> Hi,
> 
> On Wed, Jun 1, 2022 at 2:46 AM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>>
>> Panels usually call drm_connector_set_panel_orientation(), which is
>> later than drm/kms driver calling drm_dev_register(). This leads to a
>> WARN()[1].
>>
>> The orientation property is known earlier. For example, some panels
>> parse the property through device tree during probe.
>>
>> The series add a panel API drm_panel_get_orientation() for drm/kms
>> drivers. The drivers can use the API to get panel's orientation, so they
>> can call drm_connector_set_panel_orientation() before drm_dev_register().
>>
>> Panel needs to implement .get_orientation callback to return the property.
>>
>> [1] https://patchwork.kernel.org/project/linux-mediatek/patch/20220530081910.3947168-2-hsinyi@chromium.org/
>>
>> Hsin-Yi Wang (8):
>>   drm/panel: Add an API drm_panel_get_orientation() to return panel
>>     orientation
>>   drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback
>>   drm/panel: panel-edp: Implement .get_orientation callback
>>   drm/panel: lvds: Implement .get_orientation callback
>>   drm/panel: panel-simple: Implement .get_orientation callback
>>   drm/panel: ili9881c: Implement .get_orientation callback
>>   drm/panel: elida-kd35t133: Implement .get_orientation callback
>>   drm/mediatek: Config orientation property if panel provides it
>>
>>  drivers/gpu/drm/drm_panel.c                    |  8 ++++++++
>>  drivers/gpu/drm/mediatek/mtk_dsi.c             | 10 ++++++++++
>>  drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-edp.c              |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-elida-kd35t133.c   |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-ilitek-ili9881c.c  |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-lvds.c             |  8 ++++++++
>>  drivers/gpu/drm/panel/panel-simple.c           |  9 +++++++++
>>  include/drm/drm_panel.h                        | 10 ++++++++++
>>  9 files changed, 77 insertions(+)
> 
> Seems reasonable to me. I added a request to the panel-edp patch that
> probably applies to all of the panel patches requesting a comment next
> to the old calls in get_modes().
> 
> I assume that all but patch #8 ought to land through drm-misc. I'm
> happy to help commit them once everyone is happy. If the Mediatek
> maintainer(s) want to Ack patch #8 I can land that in drm-misc too. If
> we want something fancier like an immutable branch you'll probably
> have to get someone involved that's got a higher drm pay grade than
> me. ;-)

Thanks, patch 8/8 looks good to me now too, so:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

for the series.

Note I'm currently travelling so I cannot push this to drm-mic-next
myself.

Regards,

Hans



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 60+ messages in thread

end of thread, other threads:[~2022-06-03  6:54 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-01  9:46 [PATCH v2 0/8] Add a panel API to return panel orientation Hsin-Yi Wang
2022-06-01  9:46 ` Hsin-Yi Wang
2022-06-01  9:46 ` Hsin-Yi Wang
2022-06-01  9:46 ` Hsin-Yi Wang
2022-06-01  9:46 ` [PATCH v2 1/8] drm/panel: Add an API drm_panel_get_orientation() " Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46 ` [PATCH v2 2/8] drm/panel: boe-tv101wum-nl6: Implement .get_orientation callback Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46 ` [PATCH v2 3/8] drm/panel: panel-edp: " Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-02 21:43   ` Doug Anderson
2022-06-02 21:43     ` Doug Anderson
2022-06-02 21:43     ` Doug Anderson
2022-06-02 21:43     ` Doug Anderson
2022-06-03  4:01     ` Hsin-Yi Wang
2022-06-03  4:01       ` Hsin-Yi Wang
2022-06-03  4:01       ` Hsin-Yi Wang
2022-06-03  4:01       ` Hsin-Yi Wang
2022-06-01  9:46 ` [PATCH v2 4/8] drm/panel: lvds: " Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46 ` [PATCH v2 5/8] drm/panel: panel-simple: " Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46 ` [PATCH v2 6/8] drm/panel: ili9881c: " Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46 ` [PATCH v2 7/8] drm/panel: elida-kd35t133: " Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46 ` [PATCH v2 8/8] drm/mediatek: Config orientation property if panel provides it Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-01  9:46   ` Hsin-Yi Wang
2022-06-02  8:02 ` [PATCH v2 0/8] Add a panel API to return panel orientation CK Hu
2022-06-02  8:02   ` CK Hu
2022-06-02  8:02   ` CK Hu
2022-06-02  8:02   ` CK Hu
2022-06-02  8:07   ` Hsin-Yi Wang
2022-06-02  8:07     ` Hsin-Yi Wang
2022-06-02  8:07     ` Hsin-Yi Wang
2022-06-02  8:07     ` Hsin-Yi Wang
2022-06-02 21:48 ` Doug Anderson
2022-06-02 21:48   ` Doug Anderson
2022-06-02 21:48   ` Doug Anderson
2022-06-02 21:48   ` Doug Anderson
2022-06-03  6:53   ` Hans de Goede
2022-06-03  6:53     ` Hans de Goede
2022-06-03  6:53     ` Hans de Goede
2022-06-03  6:53     ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.