From 03c728399f8a678aea3ecd4ea150f2a637109033 Mon Sep 17 00:00:00 2001 From: Yu Kang Ku Date: Wed, 17 Aug 2016 10:25:43 -0700 Subject: [PATCH] drm/i915/chv: Add 3us latency requirement for HDMI FIFO underruns in pipe C (used for HDMI) are causing flickers, tearing, and eventually a blank external monitor. This is a workaround that prevents underruns by adding a latency requirement via PM QoS. The 3us value is based on the latencies specified in vlv_setup_wm_latency(). For HDMI use cases, this patch reduces battery life by about an hour, based on experimental results. At the same time, for these use cases, an assumption is being made here that the user will be more willing to plug the device into an outlet. BUG=chrome-os-partner:49379 TEST=Play a Youtube video at 1080p full screen on HDMI monitor Change-Id: I7d9dfb9edab4c899741b8b61aae784f7151ac591 Signed-off-by: Yu Kang Ku --- drivers/gpu/drm/i915/i915_drv.h | 3 +++ drivers/gpu/drm/i915/intel_hdmi.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 55fdce5..1d29c2c 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1933,6 +1933,9 @@ struct drm_i915_private { bool edp_low_vswing; + /* HDMI latency constraint */ + struct pm_qos_request hdmi_pm_qos; + /* perform PHY state sanity checks? */ bool chv_phy_assert[2]; diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index c5c8834..5b4efad 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c @@ -1825,6 +1825,8 @@ static void chv_hdmi_post_disable(struct intel_encoder *encoder) chv_data_lane_soft_reset(encoder, true); mutex_unlock(&dev_priv->sb_lock); + + pm_qos_remove_request(&dev_priv->hdmi_pm_qos); } static void chv_hdmi_pre_enable(struct intel_encoder *encoder) @@ -1842,6 +1844,9 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder) int data, i, stagger; u32 val; + /* Add a 3us latency requirement to prevent FIFO underruns in pipe C */ + pm_qos_add_request(&dev_priv->hdmi_pm_qos, PM_QOS_CPU_DMA_LATENCY, 3); + mutex_lock(&dev_priv->sb_lock); /* allow hardware to manage TX FIFO reset source */ -- 1.9.1