dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: dw-hdmi: fix hdmi display lost
@ 2016-08-11  7:54 Mark Yao
  2016-08-11  8:32 ` Russell King - ARM Linux
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Yao @ 2016-08-11  7:54 UTC (permalink / raw)
  To: David Airlie, Heiko Stuebner, dri-devel, linux-arm-kernel,
	linux-rockchip, linux-kernel
  Cc: Daniel Vetter, Russell King, Fabio Estevam

hdmi->disabled maybe not match to the real hardware status.

->dw_hdmi_bridge_enable()
  hdmi->disabled = false;
-->dw_hdmi_update_power()
   if (hdmi->rxsense)
       force = DRM_FORCE_ON;
   else
       force = DRM_FORCE_OFF;

hdmi->rxsense maybe false on bridge enable path, then hdmi->disabled
is false, but actually hardware is power off, they are not match.

So on dw_hdmi_irq, judge the hardware status with hdmi->disabled is wrong.
This bug would cause display lost, unplug/plug can't recovery display.

Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Liu Ying <gnuiyl@gmail.com>

Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
---
 drivers/gpu/drm/bridge/dw-hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/dw-hdmi.c b/drivers/gpu/drm/bridge/dw-hdmi.c
index 77ab473..a4fcb47 100644
--- a/drivers/gpu/drm/bridge/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/dw-hdmi.c
@@ -1563,7 +1563,7 @@ 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)) {
 		mutex_lock(&hdmi->mutex);
-		if (!hdmi->disabled && !hdmi->force) {
+		if (!hdmi->bridge_is_on && !hdmi->force) {
 			/*
 			 * If the RX sense status indicates we're disconnected,
 			 * clear the software rxsense status.
-- 
1.9.1


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/bridge: dw-hdmi: fix hdmi display lost
  2016-08-11  7:54 [PATCH] drm/bridge: dw-hdmi: fix hdmi display lost Mark Yao
@ 2016-08-11  8:32 ` Russell King - ARM Linux
  2016-08-11  9:09   ` Mark yao
  0 siblings, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2016-08-11  8:32 UTC (permalink / raw)
  To: Mark Yao
  Cc: David Airlie, Heiko Stuebner, dri-devel, linux-arm-kernel,
	linux-rockchip, linux-kernel, Daniel Vetter, Fabio Estevam,
	Liu Ying

On Thu, Aug 11, 2016 at 03:54:03PM +0800, Mark Yao wrote:
> hdmi->disabled maybe not match to the real hardware status.
> 
> ->dw_hdmi_bridge_enable()
>   hdmi->disabled = false;
> -->dw_hdmi_update_power()
>    if (hdmi->rxsense)
>        force = DRM_FORCE_ON;
>    else
>        force = DRM_FORCE_OFF;
> 
> hdmi->rxsense maybe false on bridge enable path, then hdmi->disabled
> is false, but actually hardware is power off, they are not match.

... which is correct.  If rxsense is false, it means there is nothing
plugged in, so we don't power the hardware up until something _is_
plugged in.

When something is plugged in, we get the HPD and RXSENSE events, which
will cause dw_hdmi_update_power() to be called.

hdmi->disabled is merely a bit mask of things that would cause us to
want to avoid powering the hardware up when rxsense becomes true.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

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

* Re: [PATCH] drm/bridge: dw-hdmi: fix hdmi display lost
  2016-08-11  8:32 ` Russell King - ARM Linux
@ 2016-08-11  9:09   ` Mark yao
  2016-08-11  9:21     ` Mark yao
  0 siblings, 1 reply; 4+ messages in thread
From: Mark yao @ 2016-08-11  9:09 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Fabio Estevam, Daniel Vetter, linux-kernel, dri-devel,
	linux-rockchip, linux-arm-kernel

[-- Attachment #1: Type: text/html, Size: 3093 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/bridge: dw-hdmi: fix hdmi display lost
  2016-08-11  9:09   ` Mark yao
@ 2016-08-11  9:21     ` Mark yao
  0 siblings, 0 replies; 4+ messages in thread
From: Mark yao @ 2016-08-11  9:21 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Fabio Estevam, Daniel Vetter, linux-kernel, dri-devel,
	linux-rockchip, linux-arm-kernel

[-- Attachment #1: Type: text/html, Size: 3751 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2016-08-11  9:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-11  7:54 [PATCH] drm/bridge: dw-hdmi: fix hdmi display lost Mark Yao
2016-08-11  8:32 ` Russell King - ARM Linux
2016-08-11  9:09   ` Mark yao
2016-08-11  9:21     ` Mark yao

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