Linux-Samsung-soc Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v3 00/35] drm/bridge: Consolidate initialization
@ 2019-12-24 17:34 Mihail Atanassov
  2019-12-24 17:34 ` [PATCH v3 05/35] drm/exynos: mic: Stop using drm_bridge->driver_private Mihail Atanassov
  2019-12-24 17:34 ` [PATCH v3 29/35] drm/exynos: mic: Use drm_bridge_init() Mihail Atanassov
  0 siblings, 2 replies; 3+ messages in thread
From: Mihail Atanassov @ 2019-12-24 17:34 UTC (permalink / raw)
  To: dri-devel
  Cc: Mihail Atanassov, nd, Andrzej Hajda, Benjamin Gaignard, CK Hu,
	Daniel Vetter, David Airlie, Inki Dae, Krzysztof Kozlowski,
	Kukjin Kim, Laurent Pinchart, Linus Walleij, Maarten Lankhorst,
	Martyn Welch, Matthias Brugger, Maxime Ripard, Neil Armstrong,
	Peter Senna Tschudin, Rob Clark, Russell King, Sam Ravnborg,
	Sean Paul, Thomas Zimmermann, Vincent Abriou, freedreno,
	linux-arm-kernel, linux-arm-msm, linux-kernel, linux-mediatek,
	linux-renesas-soc, linux-samsung-soc

Hi all,

Version 3 of my drm_bridge_init() series here. The biggest change from
the previous version is the removal of drm_bridge->dev (1/35) and the
removal of ->driver_private (2-7/35). The rest of the patches are mostly
the same, save for dropping the driver_private argument from
drm_bridge_init().

v3:
 - remove drm_bridge->dev (Thomas)
 - convert ->driver_private users to container_of() (Laurent)
 - remove drm_bridge->driver_private (Laurent)
 - remove driver_private argument from drm_bridge_init() (Laurent)
 - clean up the wording on some comments (Laurent)
 - pass the correct struct device to drm_bridge_init in analogix
   (Laurent)
 - I've kept the rcar-du patches separate but changed their order; this
   should make it easier to take only one part of the series if needed

v2:
 - expanded commit messages and added some extra bridge-related
   documentation (Daniel)
 - dropped v1 patches 29 and 30: 29 needs more work, and 30 depends on
   it
 - added all remaining drm_bridge implementers, found by searching for
   drm_bridge_funcs which is mandatory for any bridge; new uses in
   patches 3, 27, and 28 (Sam)
 - due to the above, I've decided to squash all analogix changes into
   one patch

Mihail Atanassov (35):
  drm: Remove drm_bridge->dev
  drm/bridge: analogix_dp: Stop using drm_bridge->driver_private
  drm/bridge/synopsys: Stop using drm_bridge->driver_private
  drm/bridge: thc63lvd1024: Don't set drm_bridge->driver_private
  drm/exynos: mic: Stop using drm_bridge->driver_private
  drm: rcar-du: lvds: Don't set drm_bridge->driver_private
  drm/sti: Stop using drm_bridge->driver_private
  drm: Remove drm_bridge->driver_private
  drm: Introduce drm_bridge_init()
  drm/bridge: adv7511: Use drm_bridge_init()
  drm/bridge/analogix: Use drm_bridge_init()
  drm/bridge: cdns: Use drm_bridge_init()
  drm/bridge: dumb-vga-dac: Use drm_bridge_init()
  drm/bridge: lvds-codec: Use drm_bridge_init()
  drm/bridge: megachips-stdpxxxx-ge-b850v3-fw: Use drm_bridge_init()
  drm/bridge: nxp-ptn3460: Use drm_bridge_init()
  drm/bridge: panel: Use drm_bridge_init()
  drm/bridge: ps8622: Use drm_bridge_init()
  drm/bridge: sii902x: Use drm_bridge_init()
  drm/bridge: sii9234: Use drm_bridge_init()
  drm/bridge: sil_sii8620: Use drm_bridge_init()
  drm/bridge: dw-hdmi: Use drm_bridge_init()
  drm/bridge/synopsys: dsi: Use drm_bridge_init()
  drm/bridge: tc358764: Use drm_bridge_init()
  drm/bridge: tc358767: Use drm_bridge_init()
  drm/bridge: thc63: Use drm_bridge_init()
  drm/bridge: ti-sn65dsi86: Use drm_bridge_init()
  drm/bridge: ti-tfp410: Use drm_bridge_init()
  drm/exynos: mic: Use drm_bridge_init()
  drm/i2c: tda998x: Use drm_bridge_init()
  drm/mcde: dsi: Use drm_bridge_init()
  drm/mediatek: hdmi: Use drm_bridge_init()
  drm: rcar-du: lvds: Use drm_bridge_init()
  drm/sti: Use drm_bridge_init()
  drm/msm: Use drm_bridge_init()

 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c  |  6 +--
 .../drm/bridge/analogix/analogix-anx6345.c    |  7 ++--
 .../drm/bridge/analogix/analogix-anx78xx.c    | 10 ++---
 .../drm/bridge/analogix/analogix_dp_core.c    | 42 +++++++------------
 .../drm/bridge/analogix/analogix_dp_core.h    |  8 +++-
 drivers/gpu/drm/bridge/cdns-dsi.c             |  6 +--
 drivers/gpu/drm/bridge/dumb-vga-dac.c         |  8 ++--
 drivers/gpu/drm/bridge/lvds-codec.c           |  8 ++--
 .../bridge/megachips-stdpxxxx-ge-b850v3-fw.c  |  6 +--
 drivers/gpu/drm/bridge/nxp-ptn3460.c          |  5 +--
 drivers/gpu/drm/bridge/panel.c                |  9 ++--
 drivers/gpu/drm/bridge/parade-ps8622.c        |  5 +--
 drivers/gpu/drm/bridge/sii902x.c              | 11 +++--
 drivers/gpu/drm/bridge/sii9234.c              |  3 +-
 drivers/gpu/drm/bridge/sil-sii8620.c          |  3 +-
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c     | 26 ++++++------
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c |  7 +---
 drivers/gpu/drm/bridge/tc358764.c             |  8 ++--
 drivers/gpu/drm/bridge/tc358767.c             |  9 ++--
 drivers/gpu/drm/bridge/thc63lvd1024.c         |  7 +---
 drivers/gpu/drm/bridge/ti-sn65dsi86.c         |  7 ++--
 drivers/gpu/drm/bridge/ti-tfp410.c            | 10 ++---
 drivers/gpu/drm/drm_bridge.c                  | 40 +++++++++++++++---
 drivers/gpu/drm/exynos/exynos_drm_mic.c       | 16 +++----
 drivers/gpu/drm/i2c/tda998x_drv.c             |  8 +---
 drivers/gpu/drm/mcde/mcde_dsi.c               |  5 +--
 drivers/gpu/drm/mediatek/mtk_hdmi.c           |  4 +-
 drivers/gpu/drm/msm/dsi/dsi_manager.c         |  3 +-
 drivers/gpu/drm/msm/edp/edp_bridge.c          |  5 +--
 drivers/gpu/drm/msm/hdmi/hdmi_bridge.c        |  7 ++--
 drivers/gpu/drm/rcar-du/rcar_lvds.c           |  7 ++--
 drivers/gpu/drm/sti/sti_dvo.c                 | 23 ++++------
 drivers/gpu/drm/sti/sti_hda.c                 | 19 ++++-----
 drivers/gpu/drm/sti/sti_hdmi.c                | 15 +++----
 drivers/gpu/drm/sti/sti_hdmi.h                |  5 +++
 include/drm/drm_bridge.h                      | 16 +++++--
 36 files changed, 181 insertions(+), 203 deletions(-)

-- 
2.24.0


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

* [PATCH v3 05/35] drm/exynos: mic: Stop using drm_bridge->driver_private
  2019-12-24 17:34 [PATCH v3 00/35] drm/bridge: Consolidate initialization Mihail Atanassov
@ 2019-12-24 17:34 ` Mihail Atanassov
  2019-12-24 17:34 ` [PATCH v3 29/35] drm/exynos: mic: Use drm_bridge_init() Mihail Atanassov
  1 sibling, 0 replies; 3+ messages in thread
From: Mihail Atanassov @ 2019-12-24 17:34 UTC (permalink / raw)
  To: dri-devel
  Cc: Mihail Atanassov, nd, Inki Dae, David Airlie, Daniel Vetter,
	Krzysztof Kozlowski, linux-arm-kernel, linux-samsung-soc,
	linux-kernel

Use a container_of wrapper instead. Note that no logic depends on
driver_private being NULL or not, so the cleanup in exynos_mic_bind is
safe to apply.

Cc: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
---

Reviewer note: the driver_private cleanup used to be part of the
relevant drm_bridge_init() patch.

 drivers/gpu/drm/exynos/exynos_drm_mic.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c
index f41d75923557..2b5f10c3a285 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_mic.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c
@@ -106,6 +106,8 @@ struct exynos_mic {
 	bool enabled;
 };
 
+#define bridge_to_exynos_mic(b) container_of((b), struct exynos_mic, bridge)
+
 static void mic_set_path(struct exynos_mic *mic, bool enable)
 {
 	int ret;
@@ -232,7 +234,7 @@ static void mic_disable(struct drm_bridge *bridge) { }
 
 static void mic_post_disable(struct drm_bridge *bridge)
 {
-	struct exynos_mic *mic = bridge->driver_private;
+	struct exynos_mic *mic = bridge_to_exynos_mic(bridge);
 
 	mutex_lock(&mic_mutex);
 	if (!mic->enabled)
@@ -251,7 +253,7 @@ static void mic_mode_set(struct drm_bridge *bridge,
 			 const struct drm_display_mode *mode,
 			 const struct drm_display_mode *adjusted_mode)
 {
-	struct exynos_mic *mic = bridge->driver_private;
+	struct exynos_mic *mic = bridge_to_exynos_mic(bridge);
 
 	mutex_lock(&mic_mutex);
 	drm_display_mode_to_videomode(mode, &mic->vm);
@@ -261,7 +263,7 @@ static void mic_mode_set(struct drm_bridge *bridge,
 
 static void mic_pre_enable(struct drm_bridge *bridge)
 {
-	struct exynos_mic *mic = bridge->driver_private;
+	struct exynos_mic *mic = bridge_to_exynos_mic(bridge);
 	int ret;
 
 	mutex_lock(&mic_mutex);
@@ -309,10 +311,6 @@ static const struct drm_bridge_funcs mic_bridge_funcs = {
 static int exynos_mic_bind(struct device *dev, struct device *master,
 			   void *data)
 {
-	struct exynos_mic *mic = dev_get_drvdata(dev);
-
-	mic->bridge.driver_private = mic;
-
 	return 0;
 }
 
-- 
2.24.0


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

* [PATCH v3 29/35] drm/exynos: mic: Use drm_bridge_init()
  2019-12-24 17:34 [PATCH v3 00/35] drm/bridge: Consolidate initialization Mihail Atanassov
  2019-12-24 17:34 ` [PATCH v3 05/35] drm/exynos: mic: Stop using drm_bridge->driver_private Mihail Atanassov
@ 2019-12-24 17:34 ` Mihail Atanassov
  1 sibling, 0 replies; 3+ messages in thread
From: Mihail Atanassov @ 2019-12-24 17:34 UTC (permalink / raw)
  To: dri-devel
  Cc: Mihail Atanassov, nd, Inki Dae, Joonyoung Shim, Seung-Woo Kim,
	Kyungmin Park, David Airlie, Daniel Vetter, Kukjin Kim,
	Krzysztof Kozlowski, linux-arm-kernel, linux-samsung-soc,
	linux-kernel, Laurent Pinchart

No functional change.

v3:
 - drop driver_private argument (Laurent)

Cc: Inki Dae <inki.dae@samsung.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
---
 drivers/gpu/drm/exynos/exynos_drm_mic.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c
index 2b5f10c3a285..3bc9f81d0170 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_mic.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c
@@ -420,9 +420,7 @@ static int exynos_mic_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, mic);
 
-	mic->bridge.funcs = &mic_bridge_funcs;
-	mic->bridge.of_node = dev->of_node;
-
+	drm_bridge_init(&mic->bridge, dev, &mic_bridge_funcs, NULL);
 	drm_bridge_add(&mic->bridge);
 
 	pm_runtime_enable(dev);
-- 
2.24.0


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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-24 17:34 [PATCH v3 00/35] drm/bridge: Consolidate initialization Mihail Atanassov
2019-12-24 17:34 ` [PATCH v3 05/35] drm/exynos: mic: Stop using drm_bridge->driver_private Mihail Atanassov
2019-12-24 17:34 ` [PATCH v3 29/35] drm/exynos: mic: Use drm_bridge_init() Mihail Atanassov

Linux-Samsung-soc Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-samsung-soc/0 linux-samsung-soc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-samsung-soc linux-samsung-soc/ https://lore.kernel.org/linux-samsung-soc \
		linux-samsung-soc@vger.kernel.org
	public-inbox-index linux-samsung-soc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-samsung-soc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git