<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Sean,<br>
<br>
Thanks for your fast respond :-)<br>
<br>
But this patch is not the latest one, I have upgraded this to "v1.1"
version to fix the eDP can't be disabled problem:<br>
[PATCH v1.1 2/2] drm/bridge: analogix_dp: turn off the panel
when eDP need to disable<br>
Changes in v1.1:
- unprepare the panel at the end of bridge->disable() function<br>
<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
In spite of this, I would take your comments with my "v1.1" patch.
<br>
<br>
<div class="moz-cite-prefix">On 07/21/2016 10:28 PM, Sean Paul
wrote:<br>
</div>
<blockquote
cite="mid:CAOw6vbK7CnFwH_Tyrq6ab4DBxVLa8-JCYEM-Tu+mOYsKmNULtg@mail.gmail.com"
type="cite">
<pre wrap="">On Thu, Jul 21, 2016 at 9:14 AM, Yakir Yang <a class="moz-txt-link-rfc2396E" href="mailto:ykk@rock-chips.com"><ykk@rock-chips.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Some panels (like Sharp LQ123P1JX31) need to be turn off when eDP
controller stop to send valid video signal, otherwhise panel would
go burn in, and keep flicker and flicker.
So it's better to turn off the panel when eDP need to disable, and
we need to turn on the panel in connector->detect() callback, so
that driver would detect panel status rightly.
Signed-off-by: Yakir Yang <a class="moz-txt-link-rfc2396E" href="mailto:ykk@rock-chips.com"><ykk@rock-chips.com></a>
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 32715da..ea059b3 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -961,6 +961,14 @@ analogix_dp_detect(struct drm_connector *connector, bool force)
{
struct analogix_dp_device *dp = to_dp(connector);
+ /*
+ * Panle would prepare for several times here, but don't worry it
</pre>
</blockquote>
<pre wrap="">
s/Panle/Panel/
</pre>
</blockquote>
<br>
Done<br>
<br>
<blockquote
cite="mid:CAOw6vbK7CnFwH_Tyrq6ab4DBxVLa8-JCYEM-Tu+mOYsKmNULtg@mail.gmail.com"
type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">+ * would only enable the hardware at the first prepare time.
</pre>
</blockquote>
<pre wrap="">
Errr, this shouldn't go in detect. How about putting this in
bridge_enable instead?
</pre>
</blockquote>
<br>
Nope, if we put this in bridge_enable, then eDP would never be
enabled. Here're the calling flow.<br>
<br>
--> analogix_dp_probe<br>
--> analogix_dp_bind # we still haven't prepared the panel
here, that means panel have been powered up<br>
--> analogix_dp_detect # Oops, losing panel valid hotplug
signal, cause panel have been powered up<br>
--> ** Keep detecting **<br>
<br>
<blockquote
cite="mid:CAOw6vbK7CnFwH_Tyrq6ab4DBxVLa8-JCYEM-Tu+mOYsKmNULtg@mail.gmail.com"
type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">+ */
+ if (dp->plat_data->panel)
+ if (drm_panel_prepare(dp->plat_data->panel))
</pre>
</blockquote>
<pre wrap="">
Personally, I don't like doing work in a conditional since you're
throwing the return code away. Could you break this out into:
ret = drm_panel_prepare(dp->plat_data->panel);
if (ret)
DRM_ERROR("failed to setup the panel ret=%d\n", ret);</pre>
</blockquote>
<br>
Okay<br>
<br>
<blockquote
cite="mid:CAOw6vbK7CnFwH_Tyrq6ab4DBxVLa8-JCYEM-Tu+mOYsKmNULtg@mail.gmail.com"
type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">+ DRM_ERROR("failed to setup the panel\n");
+
if (analogix_dp_detect_hpd(dp))
return connector_status_disconnected;
@@ -1063,7 +1071,8 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge)
return;
if (dp->plat_data->panel) {
- if (drm_panel_disable(dp->plat_data->panel)) {
+ if (drm_panel_disable(dp->plat_data->panel) ||
+ drm_panel_unprepare(dp->plat_data->panel)) {
</pre>
</blockquote>
<pre wrap="">
Same comment here, please break this out into separate statements for
better readability/logging.</pre>
</blockquote>
<br>
Okay, <br>
<br>
<br>
Thanks,<br>
- Yakir<br>
<br>
<blockquote
cite="mid:CAOw6vbK7CnFwH_Tyrq6ab4DBxVLa8-JCYEM-Tu+mOYsKmNULtg@mail.gmail.com"
type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap=""> DRM_ERROR("failed to disable the panel\n");
return;
}
@@ -1333,13 +1342,6 @@ int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev,
phy_power_on(dp->phy);
- if (dp->plat_data->panel) {
- if (drm_panel_prepare(dp->plat_data->panel)) {
- DRM_ERROR("failed to setup the panel\n");
- return -EBUSY;
- }
- }
-
analogix_dp_init_dp(dp);
ret = devm_request_threaded_irq(&pdev->dev, dp->irq,
--
1.9.1
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<br>
</body>
</html>