drm/bridge: synopsys: dw-hdmi: update rxsense status in repo_hpd_event

Under following processes, rxsense will be not match the real
signal status.
1. HDMI plug in, irq is triggered.

2. HDMI irq is mute in dw_hdmi_hardirq, bring up dw_hdmi_irq.

3. For HDMI connection is not stable, phy_stat read in
   dw_hdmi_irq may be zero, then hdmi->rxsense will be false.

4. Connection fallback to stable, but dw_hdmi_irq had not
   unmute the irq, irq is not triggered again, and hdmi->rxsense
   keep false.

5. repo_hpd_event inform HDMI is pluggned in, dw_hdmi_bridge_enable
   is called to enable HDMI. For rxsense is flase, bridge is not
   powered up.

When repo_hpd_event is called, we think HDMI connection is stable,
updating rxsense is reliable.

Change-Id: Ie1f52f65b15e9a603dad9200529202053528a390
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
This commit is contained in:
Zheng Yang
2018-03-01 13:27:48 +08:00
committed by Tao Huang
parent b4c413f25c
commit ae989813d6

View File

@@ -378,6 +378,14 @@ static void repo_hpd_event(struct work_struct *p_work)
struct dw_hdmi *hdmi = container_of(p_work, struct dw_hdmi, work.work);
enum drm_connector_status status = hdmi->hpd_state ?
connector_status_connected : connector_status_disconnected;
u8 phy_stat = hdmi_readb(hdmi, HDMI_PHY_STAT0);
mutex_lock(&hdmi->mutex);
if (!(phy_stat & HDMI_PHY_RX_SENSE))
hdmi->rxsense = false;
if (phy_stat & HDMI_PHY_HPD)
hdmi->rxsense = true;
mutex_unlock(&hdmi->mutex);
if (hdmi->bridge.dev) {
drm_helper_hpd_irq_event(hdmi->bridge.dev);