Linux-Amlogic Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 00/10] rockchip: kevin: Enable edp display
@ 2017-10-19  3:48 Jeffy Chen
  2017-10-19  3:48 ` [PATCH v6 09/10] drm/bridge/synopsys: dw-hdmi: Do not use device's drvdata Jeffy Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jeffy Chen @ 2017-10-19  3:48 UTC (permalink / raw)
  To: linus-amlogic


Make edp display works on chromebook kevin(at least for boot animation).

Also solve some issues i meet during the bringup.

Changes in v6:
Don't change order of rockchip_drm_psr_register().

Changes in v5:
Call the destroy hook in the error handling path like in unbind().
Call the destroy hook in the error handling path like in unbind().
Update cleanup order in unbind().
Add disable to unbind(), and inline clk_prepare_enable() with bind().

Jeffy Chen (10):
  arm64: dts: rockchip: Enable edp disaplay on kevin
  drm/rockchip: analogix_dp: Remove unnecessary init code
  drm/bridge: analogix: Do not use device's drvdata
  drm/bridge: analogix_dp: Fix connector and encoder cleanup
  drm/rockchip: analogix_dp: Add a sanity check for
    rockchip_drm_psr_register()
  drm/rockchip: dw-mipi-dsi: Fix error handling path
  drm/rockchip: inno_hdmi: Fix error handling path
  drm/bridge/synopsys: dw-hdmi: Add missing bridge detach
  drm/bridge/synopsys: dw-hdmi: Do not use device's drvdata
  drm/rockchip: dw_hdmi: Fix error handling path

 arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts  | 29 +++++++
 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi       | 16 ++++
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 52 +++++-------
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c          | 53 ++++++------
 drivers/gpu/drm/exynos/exynos_dp.c                 | 29 ++++---
 drivers/gpu/drm/imx/dw_hdmi-imx.c                  | 22 +++--
 drivers/gpu/drm/meson/meson_dw_hdmi.c              | 20 +++--
 drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c             | 14 +++-
 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c    | 95 +++++++++++-----------
 drivers/gpu/drm/rockchip/dw-mipi-dsi.c             | 21 +++--
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c        | 39 +++++----
 drivers/gpu/drm/rockchip/inno_hdmi.c               | 22 +++--
 include/drm/bridge/analogix_dp.h                   | 19 +++--
 include/drm/bridge/dw_hdmi.h                       | 17 ++--
 14 files changed, 265 insertions(+), 183 deletions(-)

-- 
2.11.0

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

* [PATCH v6 09/10] drm/bridge/synopsys: dw-hdmi: Do not use device's drvdata
  2017-10-19  3:48 [PATCH v6 00/10] rockchip: kevin: Enable edp display Jeffy Chen
@ 2017-10-19  3:48 ` Jeffy Chen
  2017-10-20 17:07 ` [PATCH v6 00/10] rockchip: kevin: Enable edp display Sean Paul
  2017-10-30 23:01 ` Heiko Stuebner
  2 siblings, 0 replies; 7+ messages in thread
From: Jeffy Chen @ 2017-10-19  3:48 UTC (permalink / raw)
  To: linus-amlogic

Let plat drivers own the drvdata, so that they could cleanup resources
in their unbind().

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
---

Changes in v6: None
Changes in v5: None

 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c   | 43 ++++++++++-------------------
 drivers/gpu/drm/imx/dw_hdmi-imx.c           | 22 +++++++++------
 drivers/gpu/drm/meson/meson_dw_hdmi.c       | 20 ++++++++++----
 drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c      | 14 ++++++++--
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 23 ++++++++-------
 include/drm/bridge/dw_hdmi.h                | 17 ++++++------
 6 files changed, 77 insertions(+), 62 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index ff1b3d2b5d06..6fbfafc5832b 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -2072,7 +2072,7 @@ static irqreturn_t dw_hdmi_hardirq(int irq, void *dev_id)
 	return ret;
 }
 
-void __dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense)
+void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense)
 {
 	mutex_lock(&hdmi->mutex);
 
@@ -2098,13 +2098,6 @@ void __dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense)
 	}
 	mutex_unlock(&hdmi->mutex);
 }
-
-void dw_hdmi_setup_rx_sense(struct device *dev, bool hpd, bool rx_sense)
-{
-	struct dw_hdmi *hdmi = dev_get_drvdata(dev);
-
-	__dw_hdmi_setup_rx_sense(hdmi, hpd, rx_sense);
-}
 EXPORT_SYMBOL_GPL(dw_hdmi_setup_rx_sense);
 
 static irqreturn_t dw_hdmi_irq(int irq, void *dev_id)
@@ -2140,9 +2133,8 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id)
 	 */
 	if (intr_stat &
 	    (HDMI_IH_PHY_STAT0_RX_SENSE | HDMI_IH_PHY_STAT0_HPD)) {
-		__dw_hdmi_setup_rx_sense(hdmi,
-					 phy_stat & HDMI_PHY_HPD,
-					 phy_stat & HDMI_PHY_RX_SENSE);
+		dw_hdmi_setup_rx_sense(hdmi, phy_stat & HDMI_PHY_HPD,
+				       phy_stat & HDMI_PHY_RX_SENSE);
 
 		if ((phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD)) == 0)
 			cec_notifier_set_phys_addr(hdmi->cec_notifier,
@@ -2512,8 +2504,6 @@ __dw_hdmi_probe(struct platform_device *pdev,
 	if (hdmi->i2c)
 		dw_hdmi_i2c_init(hdmi);
 
-	platform_set_drvdata(pdev, hdmi);
-
 	return hdmi;
 
 err_iahb:
@@ -2559,25 +2549,23 @@ static void __dw_hdmi_remove(struct dw_hdmi *hdmi)
 /* -----------------------------------------------------------------------------
  * Probe/remove API, used from platforms based on the DRM bridge API.
  */
-int dw_hdmi_probe(struct platform_device *pdev,
-		  const struct dw_hdmi_plat_data *plat_data)
+struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
+			      const struct dw_hdmi_plat_data *plat_data)
 {
 	struct dw_hdmi *hdmi;
 
 	hdmi = __dw_hdmi_probe(pdev, plat_data);
 	if (IS_ERR(hdmi))
-		return PTR_ERR(hdmi);
+		return hdmi;
 
 	drm_bridge_add(&hdmi->bridge);
 
-	return 0;
+	return hdmi;
 }
 EXPORT_SYMBOL_GPL(dw_hdmi_probe);
 
-void dw_hdmi_remove(struct platform_device *pdev)
+void dw_hdmi_remove(struct dw_hdmi *hdmi)
 {
-	struct dw_hdmi *hdmi = platform_get_drvdata(pdev);
-
 	drm_bridge_remove(&hdmi->bridge);
 
 	__dw_hdmi_remove(hdmi);
@@ -2587,31 +2575,30 @@ EXPORT_SYMBOL_GPL(dw_hdmi_remove);
 /* -----------------------------------------------------------------------------
  * Bind/unbind API, used from platforms based on the component framework.
  */
-int dw_hdmi_bind(struct platform_device *pdev, struct drm_encoder *encoder,
-		 const struct dw_hdmi_plat_data *plat_data)
+struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev,
+			    struct drm_encoder *encoder,
+			    const struct dw_hdmi_plat_data *plat_data)
 {
 	struct dw_hdmi *hdmi;
 	int ret;
 
 	hdmi = __dw_hdmi_probe(pdev, plat_data);
 	if (IS_ERR(hdmi))
-		return PTR_ERR(hdmi);
+		return hdmi;
 
 	ret = drm_bridge_attach(encoder, &hdmi->bridge, NULL);
 	if (ret) {
 		__dw_hdmi_remove(hdmi);
 		DRM_ERROR("Failed to initialize bridge with drm\n");
-		return ret;
+		return ERR_PTR(ret);
 	}
 
-	return 0;
+	return hdmi;
 }
 EXPORT_SYMBOL_GPL(dw_hdmi_bind);
 
-void dw_hdmi_unbind(struct device *dev)
+void dw_hdmi_unbind(struct dw_hdmi *hdmi)
 {
-	struct dw_hdmi *hdmi = dev_get_drvdata(dev);
-
 	__dw_hdmi_remove(hdmi);
 }
 EXPORT_SYMBOL_GPL(dw_hdmi_unbind);
diff --git a/drivers/gpu/drm/imx/dw_hdmi-imx.c b/drivers/gpu/drm/imx/dw_hdmi-imx.c
index b62763aa8706..b01d03e02ce0 100644
--- a/drivers/gpu/drm/imx/dw_hdmi-imx.c
+++ b/drivers/gpu/drm/imx/dw_hdmi-imx.c
@@ -26,6 +26,8 @@ struct imx_hdmi {
 	struct device *dev;
 	struct drm_encoder encoder;
 	struct regmap *regmap;
+
+	struct dw_hdmi *hdmi;
 };
 
 static inline struct imx_hdmi *enc_to_imx_hdmi(struct drm_encoder *e)
@@ -239,22 +241,24 @@ static int dw_hdmi_imx_bind(struct device *dev, struct device *master,
 	drm_encoder_init(drm, encoder, &dw_hdmi_imx_encoder_funcs,
 			 DRM_MODE_ENCODER_TMDS, NULL);
 
-	ret = dw_hdmi_bind(pdev, encoder, plat_data);
+	hdmi->hdmi = dw_hdmi_bind(pdev, encoder, plat_data);
+	if (IS_ERR(hdmi->hdmi)) {
+		encoder->funcs->destroy(encoder);
+		return PTR_ERR(hdmi->hdmi);
+	}
 
-	/*
-	 * If dw_hdmi_bind() fails we'll never call dw_hdmi_unbind(),
-	 * which would have called the encoder cleanup.  Do it manually.
-	 */
-	if (ret)
-		drm_encoder_cleanup(encoder);
+	dev_set_drvdata(dev, hdmi);
 
-	return ret;
+	return 0;
 }
 
 static void dw_hdmi_imx_unbind(struct device *dev, struct device *master,
 			       void *data)
 {
-	return dw_hdmi_unbind(dev);
+	struct imx_hdmi *hdmi = dev_get_drvdata(dev);
+
+	dw_hdmi_unbind(hdmi->hdmi);
+	hdmi->encoder.funcs->destroy(&hdmi->encoder);
 }
 
 static const struct component_ops dw_hdmi_imx_ops = {
diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c
index cef414466f9f..fc29f69f7108 100644
--- a/drivers/gpu/drm/meson/meson_dw_hdmi.c
+++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c
@@ -138,6 +138,8 @@ struct meson_dw_hdmi {
 	struct clk *hdmi_pclk;
 	struct clk *venci_clk;
 	u32 irq_stat;
+
+	struct dw_hdmi *hdmi;
 };
 #define encoder_to_meson_dw_hdmi(x) \
 	container_of(x, struct meson_dw_hdmi, encoder)
@@ -526,7 +528,7 @@ static irqreturn_t dw_hdmi_top_thread_irq(int irq, void *dev_id)
 		if (stat & HDMITX_TOP_INTR_HPD_RISE)
 			hpd_connected = true;
 
-		dw_hdmi_setup_rx_sense(dw_hdmi->dev, hpd_connected,
+		dw_hdmi_setup_rx_sense(dw_hdmi->hdmi, hpd_connected,
 				       hpd_connected);
 
 		drm_helper_hpd_irq_event(dw_hdmi->encoder.dev);
@@ -865,9 +867,14 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
 	dw_plat_data->input_bus_format = MEDIA_BUS_FMT_YUV8_1X24;
 	dw_plat_data->input_bus_encoding = V4L2_YCBCR_ENC_709;
 
-	ret = dw_hdmi_bind(pdev, encoder, &meson_dw_hdmi->dw_plat_data);
-	if (ret)
-		return ret;
+	meson_dw_hdmi->hdmi = dw_hdmi_bind(pdev, encoder,
+					   &meson_dw_hdmi->dw_plat_data);
+	if (IS_ERR(meson_dw_hdmi->hdmi)) {
+		encoder->funcs->destroy(encoder);
+		return PTR_ERR(meson_dw_hdmi->hdmi);
+	}
+
+	dev_set_drvdata(dev, meson_dw_hdmi);
 
 	DRM_DEBUG_DRIVER("HDMI controller initialized\n");
 
@@ -877,7 +884,10 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
 static void meson_dw_hdmi_unbind(struct device *dev, struct device *master,
 				   void *data)
 {
-	dw_hdmi_unbind(dev);
+	struct meson_dw_hdmi *meson_dw_hdmi = dev_get_drvdata(dev);
+
+	dw_hdmi_unbind(meson_dw_hdmi->hdmi);
+	meson_dw_hdmi->encoder.funcs->destroy(&meson_dw_hdmi->encoder);
 }
 
 static const struct component_ops meson_dw_hdmi_ops = {
diff --git a/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c b/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c
index dc85b53d58ef..76210ae25094 100644
--- a/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c
+++ b/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c
@@ -68,12 +68,22 @@ static const struct dw_hdmi_plat_data rcar_dw_hdmi_plat_data = {
 
 static int rcar_dw_hdmi_probe(struct platform_device *pdev)
 {
-	return dw_hdmi_probe(pdev, &rcar_dw_hdmi_plat_data);
+	struct dw_hdmi *hdmi;
+
+	hdmi = dw_hdmi_probe(pdev, &rcar_dw_hdmi_plat_data);
+	if (IS_ERR(hdmi))
+		return PTR_ERR(hdmi);
+
+	platform_set_drvdata(pdev, hdmi);
+
+	return 0;
 }
 
 static int rcar_dw_hdmi_remove(struct platform_device *pdev)
 {
-	dw_hdmi_remove(pdev);
+	struct dw_hdmi *hdmi = platform_get_drvdata(pdev);
+
+	dw_hdmi_remove(hdmi);
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index 1eb02a82fd91..791ab938f998 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -48,6 +48,8 @@ struct rockchip_hdmi {
 	const struct rockchip_hdmi_chip_data *chip_data;
 	struct clk *vpll_clk;
 	struct clk *grf_clk;
+
+	struct dw_hdmi *hdmi;
 };
 
 #define to_rockchip_hdmi(x)	container_of(x, struct rockchip_hdmi, x)
@@ -164,7 +166,6 @@ static const struct dw_hdmi_phy_config rockchip_phy_config[] = {
 static int rockchip_hdmi_parse_dt(struct rockchip_hdmi *hdmi)
 {
 	struct device_node *np = hdmi->dev->of_node;
-	int ret;
 
 	hdmi->regmap = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
 	if (IS_ERR(hdmi->regmap)) {
@@ -377,22 +378,24 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
 	drm_encoder_init(drm, encoder, &dw_hdmi_rockchip_encoder_funcs,
 			 DRM_MODE_ENCODER_TMDS, NULL);
 
-	ret = dw_hdmi_bind(pdev, encoder, plat_data);
+	hdmi->hdmi = dw_hdmi_bind(pdev, encoder, plat_data);
+	if (IS_ERR(hdmi->hdmi)) {
+		encoder->funcs->destroy(encoder);
+		return PTR_ERR(hdmi->hdmi);
+	}
 
-	/*
-	 * If dw_hdmi_bind() fails we'll never call dw_hdmi_unbind(),
-	 * which would have called the encoder cleanup.  Do it manually.
-	 */
-	if (ret)
-		drm_encoder_cleanup(encoder);
+	dev_set_drvdata(dev, hdmi);
 
-	return ret;
+	return 0;
 }
 
 static void dw_hdmi_rockchip_unbind(struct device *dev, struct device *master,
 				    void *data)
 {
-	return dw_hdmi_unbind(dev);
+	struct rockchip_hdmi *hdmi = dev_get_drvdata(dev);
+
+	dw_hdmi_unbind(hdmi->hdmi);
+	hdmi->encoder.funcs->destroy(&hdmi->encoder);
 }
 
 static const struct component_ops dw_hdmi_rockchip_ops = {
diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
index 182f83283e24..29b8900caaf7 100644
--- a/include/drm/bridge/dw_hdmi.h
+++ b/include/drm/bridge/dw_hdmi.h
@@ -143,14 +143,15 @@ struct dw_hdmi_plat_data {
 			     unsigned long mpixelclock);
 };
 
-int dw_hdmi_probe(struct platform_device *pdev,
-		  const struct dw_hdmi_plat_data *plat_data);
-void dw_hdmi_remove(struct platform_device *pdev);
-void dw_hdmi_unbind(struct device *dev);
-int dw_hdmi_bind(struct platform_device *pdev, struct drm_encoder *encoder,
-		 const struct dw_hdmi_plat_data *plat_data);
-
-void dw_hdmi_setup_rx_sense(struct device *dev, bool hpd, bool rx_sense);
+struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
+			      const struct dw_hdmi_plat_data *plat_data);
+void dw_hdmi_remove(struct dw_hdmi *hdmi);
+void dw_hdmi_unbind(struct dw_hdmi *hdmi);
+struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev,
+			     struct drm_encoder *encoder,
+			     const struct dw_hdmi_plat_data *plat_data);
+
+void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense);
 
 void dw_hdmi_set_sample_rate(struct dw_hdmi *hdmi, unsigned int rate);
 void dw_hdmi_audio_enable(struct dw_hdmi *hdmi);
-- 
2.11.0

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

* [PATCH v6 00/10] rockchip: kevin: Enable edp display
  2017-10-19  3:48 [PATCH v6 00/10] rockchip: kevin: Enable edp display Jeffy Chen
  2017-10-19  3:48 ` [PATCH v6 09/10] drm/bridge/synopsys: dw-hdmi: Do not use device's drvdata Jeffy Chen
@ 2017-10-20 17:07 ` Sean Paul
  2017-10-30 23:01 ` Heiko Stuebner
  2 siblings, 0 replies; 7+ messages in thread
From: Sean Paul @ 2017-10-20 17:07 UTC (permalink / raw)
  To: linus-amlogic

On Thu, Oct 19, 2017 at 11:48:02AM +0800, Jeffy Chen wrote:
> 
> Make edp display works on chromebook kevin(at least for boot animation).
> 
> Also solve some issues i meet during the bringup.
> 
> Changes in v6:
> Don't change order of rockchip_drm_psr_register().
> 
> Changes in v5:
> Call the destroy hook in the error handling path like in unbind().
> Call the destroy hook in the error handling path like in unbind().
> Update cleanup order in unbind().
> Add disable to unbind(), and inline clk_prepare_enable() with bind().
> 
> Jeffy Chen (10):
>   arm64: dts: rockchip: Enable edp disaplay on kevin
>   drm/rockchip: analogix_dp: Remove unnecessary init code
>   drm/bridge: analogix: Do not use device's drvdata
>   drm/bridge: analogix_dp: Fix connector and encoder cleanup
>   drm/rockchip: analogix_dp: Add a sanity check for
>     rockchip_drm_psr_register()
>   drm/rockchip: dw-mipi-dsi: Fix error handling path
>   drm/rockchip: inno_hdmi: Fix error handling path
>   drm/bridge/synopsys: dw-hdmi: Add missing bridge detach
>   drm/bridge/synopsys: dw-hdmi: Do not use device's drvdata
>   drm/rockchip: dw_hdmi: Fix error handling path

Hi Jeffy,
I've pushed 2/10. Once you fix 3/10, I can push 3-7. I'd like someone familiar
with synopsys to review 8-9 before pushing those. Since 10 depends on 9, it'll
be blocked on synopsys review.

Sean

> 
>  arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts  | 29 +++++++
>  arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi       | 16 ++++
>  drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 52 +++++-------
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c          | 53 ++++++------
>  drivers/gpu/drm/exynos/exynos_dp.c                 | 29 ++++---
>  drivers/gpu/drm/imx/dw_hdmi-imx.c                  | 22 +++--
>  drivers/gpu/drm/meson/meson_dw_hdmi.c              | 20 +++--
>  drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c             | 14 +++-
>  drivers/gpu/drm/rockchip/analogix_dp-rockchip.c    | 95 +++++++++++-----------
>  drivers/gpu/drm/rockchip/dw-mipi-dsi.c             | 21 +++--
>  drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c        | 39 +++++----
>  drivers/gpu/drm/rockchip/inno_hdmi.c               | 22 +++--
>  include/drm/bridge/analogix_dp.h                   | 19 +++--
>  include/drm/bridge/dw_hdmi.h                       | 17 ++--
>  14 files changed, 265 insertions(+), 183 deletions(-)
> 
> -- 
> 2.11.0
> 
> 

-- 
Sean Paul, Software Engineer, Google / Chromium OS

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

* [PATCH v6 00/10] rockchip: kevin: Enable edp display
  2017-10-19  3:48 [PATCH v6 00/10] rockchip: kevin: Enable edp display Jeffy Chen
  2017-10-19  3:48 ` [PATCH v6 09/10] drm/bridge/synopsys: dw-hdmi: Do not use device's drvdata Jeffy Chen
  2017-10-20 17:07 ` [PATCH v6 00/10] rockchip: kevin: Enable edp display Sean Paul
@ 2017-10-30 23:01 ` Heiko Stuebner
  2017-10-31  4:37   ` JeffyChen
  2 siblings, 1 reply; 7+ messages in thread
From: Heiko Stuebner @ 2017-10-30 23:01 UTC (permalink / raw)
  To: linus-amlogic

Hi Jeffy, Sean,

Am Donnerstag, 19. Oktober 2017, 11:48:02 CET schrieb Jeffy Chen:
> 
> Make edp display works on chromebook kevin(at least for boot animation).
> 
> Also solve some issues i meet during the bringup.
> 
> Changes in v6:
> Don't change order of rockchip_drm_psr_register().
> 
> Changes in v5:
> Call the destroy hook in the error handling path like in unbind().
> Call the destroy hook in the error handling path like in unbind().
> Update cleanup order in unbind().
> Add disable to unbind(), and inline clk_prepare_enable() with bind().
> 
> Jeffy Chen (10):
>   arm64: dts: rockchip: Enable edp disaplay on kevin
>   drm/rockchip: analogix_dp: Remove unnecessary init code
>   drm/bridge: analogix: Do not use device's drvdata
>   drm/bridge: analogix_dp: Fix connector and encoder cleanup
>   drm/rockchip: analogix_dp: Add a sanity check for
>     rockchip_drm_psr_register()
>   drm/rockchip: dw-mipi-dsi: Fix error handling path
>   drm/rockchip: inno_hdmi: Fix error handling path
>   drm/bridge/synopsys: dw-hdmi: Add missing bridge detach
>   drm/bridge/synopsys: dw-hdmi: Do not use device's drvdata
>   drm/rockchip: dw_hdmi: Fix error handling path

As I was just looking at the edp dts change in patch1 again, does this
series also contain a fix for the issue below [0] ?

I'm still seeing this on 4.14-rc6 with the most recent drm tree merged in.


Heiko

[0]

[   27.960120] BUG: scheduling while atomic: kworker/1:1/68/0x00000002
[   27.974429] Modules linked in: rockchipdrm dw_hdmi analogix_dp drm_kms_helper panel_simple crc32_ce drm crct10dif_ce rockchip_saradc pwm_bl pwm_cros_ec rockchip_thermal ip_tables x_tabl
es ipv6 smsc95xx smsc75xx ax88179_178a asix usbnet phy_rockchip_pcie pcie_rockchip
[   28.008769] CPU: 1 PID: 68 Comm: kworker/1:1 Tainted: G        W       4.14.0-rc7-03201-g12490811b353 #559
[   28.008774] Hardware name: Google Kevin (DT)
[   28.008825] Workqueue: events analogix_dp_psr_work [rockchipdrm]
[   28.008828] Call trace:
[   28.008838] [<ffff000008088d60>] dump_backtrace+0x0/0x378
[   28.008842] [<ffff0000080890ec>] show_stack+0x14/0x20
[   28.008847] [<ffff0000089b04d8>] dump_stack+0x9c/0xbc
[   28.008852] [<ffff0000080ec4b4>] __schedule_bug+0x4c/0x70
[   28.008856] [<ffff0000089c4828>] __schedule+0x558/0x5e8
[   28.008859] [<ffff0000089c48f0>] schedule+0x38/0xa0
[   28.008864] [<ffff0000089c8194>] schedule_hrtimeout_range_clock+0x84/0xe8
[   28.008867] [<ffff0000089c8208>] schedule_hrtimeout_range+0x10/0x18
[   28.008870] [<ffff0000089c7c74>] usleep_range+0x64/0x78
[   28.008882] [<ffff000000ef56e4>] analogix_dp_transfer+0x16c/0xa88 [analogix_dp]
[   28.008891] [<ffff000000ef2190>] analogix_dpaux_transfer+0x10/0x18 [analogix_dp]
[   28.008950] [<ffff000000ddbb1c>] drm_dp_dpcd_access+0x4c/0xf8 [drm_kms_helper]
[   28.008994] [<ffff000000ddbbe4>] drm_dp_dpcd_write+0x1c/0x28 [drm_kms_helper]
[   28.009002] [<ffff000000ef2130>] analogix_dp_disable_psr+0x60/0xb0 [analogix_dp]
[   28.009036] [<ffff000000f8398c>] analogix_dp_psr_work+0x4c/0xc0 [rockchipdrm]
[   28.009040] [<ffff0000080dff44>] process_one_work+0x1d4/0x348
[   28.009043] [<ffff0000080e0100>] worker_thread+0x48/0x470
[   28.009048] [<ffff0000080e63d4>] kthread+0x12c/0x130
[   28.009052] [<ffff000008084b88>] ret_from_fork+0x10/0x18

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

* [PATCH v6 00/10] rockchip: kevin: Enable edp display
  2017-10-30 23:01 ` Heiko Stuebner
@ 2017-10-31  4:37   ` JeffyChen
  2017-11-01 19:33     ` Sean Paul
  0 siblings, 1 reply; 7+ messages in thread
From: JeffyChen @ 2017-10-31  4:37 UTC (permalink / raw)
  To: linus-amlogic

Hi Heiko,

On 10/31/2017 07:01 AM, Heiko Stuebner wrote:
> As I was just looking at the edp dts change in patch1 again, does this
> series also contain a fix for the issue below [0] ?
>
> I'm still seeing this on 4.14-rc6 with the most recent drm tree merged in.
>
i saw that too, it should due to our psr code...i think Zain has solved 
these in chromeos kernel, i will ask Zain if he have time to upstream 
them, or maybe i'll try to upstream them.
>
> Heiko
>
> [0]
>
> [   27.960120] BUG: scheduling while atomic: kworker/1:1/68/0x00000002
> [   27.974429] Modules linked in: rockchipdrm dw_hdmi analogix_dp drm_kms_helper panel_simple crc32_ce drm crct10dif_ce rockchip_saradc pwm_bl pwm_cros_ec rockchip_thermal ip_tables x_tabl
> es ipv6 smsc95xx smsc75xx ax88179_178a asix usbnet phy_rockchip_pcie pcie_rockchip
> [   28.008769] CPU: 1 PID: 68 Comm: kworker/1:1 Tainted: G        W       4.14.0-rc7-03201-g12490811b353 #559
> [   28.008774] Hardware name: Google Kevin (DT)
> [   28.008825] Workqueue: events analogix_dp_psr_work [rockchipdrm]
> [   28.008828] Call trace:
> [   28.008838] [<ffff000008088d60>] dump_backtrace+0x0/0x378
> [   28.008842] [<ffff0000080890ec>] show_stack+0x14/0x20
> [   28.008847] [<ffff0000089b04d8>] dump_stack+0x9c/0xbc
> [   28.008852] [<ffff0000080ec4b4>] __schedule_bug+0x4c/0x70
> [   28.008856] [<ffff0000089c4828>] __schedule+0x558/0x5e8
> [   28.008859] [<ffff0000089c48f0>] schedule+0x38/0xa0
> [   28.008864] [<ffff0000089c8194>] schedule_hrtimeout_range_clock+0x84/0xe8
> [   28.008867] [<ffff0000089c8208>] schedule_hrtimeout_range+0x10/0x18
> [   28.008870] [<ffff0000089c7c74>] usleep_range+0x64/0x78
> [   28.008882] [<ffff000000ef56e4>] analogix_dp_transfer+0x16c/0xa88 [analogix_dp]
> [   28.008891] [<ffff000000ef2190>] analogix_dpaux_transfer+0x10/0x18 [analogix_dp]
> [   28.008950] [<ffff000000ddbb1c>] drm_dp_dpcd_access+0x4c/0xf8 [drm_kms_helper]
> [   28.008994] [<ffff000000ddbbe4>] drm_dp_dpcd_write+0x1c/0x28 [drm_kms_helper]
> [   28.009002] [<ffff000000ef2130>] analogix_dp_disable_psr+0x60/0xb0 [analogix_dp]
> [   28.009036] [<ffff000000f8398c>] analogix_dp_psr_work+0x4c/0xc0 [rockchipdrm]
> [   28.009040] [<ffff0000080dff44>] process_one_work+0x1d4/0x348
> [   28.009043] [<ffff0000080e0100>] worker_thread+0x48/0x470
> [   28.009048] [<ffff0000080e63d4>] kthread+0x12c/0x130
> [   28.009052] [<ffff000008084b88>] ret_from_fork+0x10/0x18
>
>
>
>

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

* [PATCH v6 00/10] rockchip: kevin: Enable edp display
  2017-10-31  4:37   ` JeffyChen
@ 2017-11-01 19:33     ` Sean Paul
  2017-11-10 12:15       ` Enric Balletbo Serra
  0 siblings, 1 reply; 7+ messages in thread
From: Sean Paul @ 2017-11-01 19:33 UTC (permalink / raw)
  To: linus-amlogic

On Tue, Oct 31, 2017 at 12:37:43PM +0800, JeffyChen wrote:
> Hi Heiko,
> 
> On 10/31/2017 07:01 AM, Heiko Stuebner wrote:
> > As I was just looking at the edp dts change in patch1 again, does this
> > series also contain a fix for the issue below [0] ?
> > 
> > I'm still seeing this on 4.14-rc6 with the most recent drm tree merged in.
> > 
> i saw that too, it should due to our psr code...i think Zain has solved
> these in chromeos kernel, i will ask Zain if he have time to upstream them,
> or maybe i'll try to upstream them.

You need the patchset where I've refactored the psr locking/workers. I have a
version of it based on Heiko's tree at
https://cgit.freedesktop.org/~seanpaul/dogwood/log/?h=rk3399-display

With this kernel, the backlight comes on, but I don't have anything on the
display (which is why I didn't post it). I'll try putting this set on top and
see what happens.

Sean

> > 
> > Heiko
> > 
> > [0]
> > 
> > [   27.960120] BUG: scheduling while atomic: kworker/1:1/68/0x00000002
> > [   27.974429] Modules linked in: rockchipdrm dw_hdmi analogix_dp drm_kms_helper panel_simple crc32_ce drm crct10dif_ce rockchip_saradc pwm_bl pwm_cros_ec rockchip_thermal ip_tables x_tabl
> > es ipv6 smsc95xx smsc75xx ax88179_178a asix usbnet phy_rockchip_pcie pcie_rockchip
> > [   28.008769] CPU: 1 PID: 68 Comm: kworker/1:1 Tainted: G        W       4.14.0-rc7-03201-g12490811b353 #559
> > [   28.008774] Hardware name: Google Kevin (DT)
> > [   28.008825] Workqueue: events analogix_dp_psr_work [rockchipdrm]
> > [   28.008828] Call trace:
> > [   28.008838] [<ffff000008088d60>] dump_backtrace+0x0/0x378
> > [   28.008842] [<ffff0000080890ec>] show_stack+0x14/0x20
> > [   28.008847] [<ffff0000089b04d8>] dump_stack+0x9c/0xbc
> > [   28.008852] [<ffff0000080ec4b4>] __schedule_bug+0x4c/0x70
> > [   28.008856] [<ffff0000089c4828>] __schedule+0x558/0x5e8
> > [   28.008859] [<ffff0000089c48f0>] schedule+0x38/0xa0
> > [   28.008864] [<ffff0000089c8194>] schedule_hrtimeout_range_clock+0x84/0xe8
> > [   28.008867] [<ffff0000089c8208>] schedule_hrtimeout_range+0x10/0x18
> > [   28.008870] [<ffff0000089c7c74>] usleep_range+0x64/0x78
> > [   28.008882] [<ffff000000ef56e4>] analogix_dp_transfer+0x16c/0xa88 [analogix_dp]
> > [   28.008891] [<ffff000000ef2190>] analogix_dpaux_transfer+0x10/0x18 [analogix_dp]
> > [   28.008950] [<ffff000000ddbb1c>] drm_dp_dpcd_access+0x4c/0xf8 [drm_kms_helper]
> > [   28.008994] [<ffff000000ddbbe4>] drm_dp_dpcd_write+0x1c/0x28 [drm_kms_helper]
> > [   28.009002] [<ffff000000ef2130>] analogix_dp_disable_psr+0x60/0xb0 [analogix_dp]
> > [   28.009036] [<ffff000000f8398c>] analogix_dp_psr_work+0x4c/0xc0 [rockchipdrm]
> > [   28.009040] [<ffff0000080dff44>] process_one_work+0x1d4/0x348
> > [   28.009043] [<ffff0000080e0100>] worker_thread+0x48/0x470
> > [   28.009048] [<ffff0000080e63d4>] kthread+0x12c/0x130
> > [   28.009052] [<ffff000008084b88>] ret_from_fork+0x10/0x18
> > 
> > 
> > 
> > 
> 
> 

-- 
Sean Paul, Software Engineer, Google / Chromium OS

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

* [PATCH v6 00/10] rockchip: kevin: Enable edp display
  2017-11-01 19:33     ` Sean Paul
@ 2017-11-10 12:15       ` Enric Balletbo Serra
  0 siblings, 0 replies; 7+ messages in thread
From: Enric Balletbo Serra @ 2017-11-10 12:15 UTC (permalink / raw)
  To: linus-amlogic

Dear all,

2017-11-01 20:33 GMT+01:00 Sean Paul <seanpaul@chromium.org>:
> On Tue, Oct 31, 2017 at 12:37:43PM +0800, JeffyChen wrote:
>> Hi Heiko,
>>
>> On 10/31/2017 07:01 AM, Heiko Stuebner wrote:
>> > As I was just looking at the edp dts change in patch1 again, does this
>> > series also contain a fix for the issue below [0] ?
>> >
>> > I'm still seeing this on 4.14-rc6 with the most recent drm tree merged in.
>> >
>> i saw that too, it should due to our psr code...i think Zain has solved
>> these in chromeos kernel, i will ask Zain if he have time to upstream them,
>> or maybe i'll try to upstream them.
>
> You need the patchset where I've refactored the psr locking/workers. I have a
> version of it based on Heiko's tree at
> https://cgit.freedesktop.org/~seanpaul/dogwood/log/?h=rk3399-display
>
> With this kernel, the backlight comes on, but I don't have anything on the
> display (which is why I didn't post it). I'll try putting this set on top and
> see what happens.
>

There is a patch in the ML sent by Emil [1], similar to the Sean
patch, that solves the issue.

And I can confirm that the Jeffy's patches + Emil patch makes the
display work on kevin or current rc8

[1] https://patchwork.kernel.org/patch/9985237/

Enric

> Sean
>
>> >
>> > Heiko
>> >
>> > [0]
>> >
>> > [   27.960120] BUG: scheduling while atomic: kworker/1:1/68/0x00000002
>> > [   27.974429] Modules linked in: rockchipdrm dw_hdmi analogix_dp drm_kms_helper panel_simple crc32_ce drm crct10dif_ce rockchip_saradc pwm_bl pwm_cros_ec rockchip_thermal ip_tables x_tabl
>> > es ipv6 smsc95xx smsc75xx ax88179_178a asix usbnet phy_rockchip_pcie pcie_rockchip
>> > [   28.008769] CPU: 1 PID: 68 Comm: kworker/1:1 Tainted: G        W       4.14.0-rc7-03201-g12490811b353 #559
>> > [   28.008774] Hardware name: Google Kevin (DT)
>> > [   28.008825] Workqueue: events analogix_dp_psr_work [rockchipdrm]
>> > [   28.008828] Call trace:
>> > [   28.008838] [<ffff000008088d60>] dump_backtrace+0x0/0x378
>> > [   28.008842] [<ffff0000080890ec>] show_stack+0x14/0x20
>> > [   28.008847] [<ffff0000089b04d8>] dump_stack+0x9c/0xbc
>> > [   28.008852] [<ffff0000080ec4b4>] __schedule_bug+0x4c/0x70
>> > [   28.008856] [<ffff0000089c4828>] __schedule+0x558/0x5e8
>> > [   28.008859] [<ffff0000089c48f0>] schedule+0x38/0xa0
>> > [   28.008864] [<ffff0000089c8194>] schedule_hrtimeout_range_clock+0x84/0xe8
>> > [   28.008867] [<ffff0000089c8208>] schedule_hrtimeout_range+0x10/0x18
>> > [   28.008870] [<ffff0000089c7c74>] usleep_range+0x64/0x78
>> > [   28.008882] [<ffff000000ef56e4>] analogix_dp_transfer+0x16c/0xa88 [analogix_dp]
>> > [   28.008891] [<ffff000000ef2190>] analogix_dpaux_transfer+0x10/0x18 [analogix_dp]
>> > [   28.008950] [<ffff000000ddbb1c>] drm_dp_dpcd_access+0x4c/0xf8 [drm_kms_helper]
>> > [   28.008994] [<ffff000000ddbbe4>] drm_dp_dpcd_write+0x1c/0x28 [drm_kms_helper]
>> > [   28.009002] [<ffff000000ef2130>] analogix_dp_disable_psr+0x60/0xb0 [analogix_dp]
>> > [   28.009036] [<ffff000000f8398c>] analogix_dp_psr_work+0x4c/0xc0 [rockchipdrm]
>> > [   28.009040] [<ffff0000080dff44>] process_one_work+0x1d4/0x348
>> > [   28.009043] [<ffff0000080e0100>] worker_thread+0x48/0x470
>> > [   28.009048] [<ffff0000080e63d4>] kthread+0x12c/0x130
>> > [   28.009052] [<ffff000008084b88>] ret_from_fork+0x10/0x18
>> >
>> >
>> >
>> >
>>
>>
>
> --
> Sean Paul, Software Engineer, Google / Chromium OS
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2017-11-10 12:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-19  3:48 [PATCH v6 00/10] rockchip: kevin: Enable edp display Jeffy Chen
2017-10-19  3:48 ` [PATCH v6 09/10] drm/bridge/synopsys: dw-hdmi: Do not use device's drvdata Jeffy Chen
2017-10-20 17:07 ` [PATCH v6 00/10] rockchip: kevin: Enable edp display Sean Paul
2017-10-30 23:01 ` Heiko Stuebner
2017-10-31  4:37   ` JeffyChen
2017-11-01 19:33     ` Sean Paul
2017-11-10 12:15       ` Enric Balletbo Serra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox