summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Hu <austin.hu@intel.com>2017-05-05 18:03:20 +0800
committerDaniel Cardenas <danielcar@google.com>2017-05-10 01:45:55 +0000
commitc56cdeae1c5c78b6ee70ae286f38598bdf6b71cd (patch)
tree3e401c350141150496dc9c3434ee659a3b484bea
parentd445a089d51d5d9fa951caff6fecb71f2641fe9b (diff)
downloadx86_64-c56cdeae1c5c78b6ee70ae286f38598bdf6b71cd.tar.gz
Fixed the issue that Display can't be turned off after screen saver.
Bug: 37908039 BZ: 51478 By following the whole HDMI power on/off processes of early_suspend and late_resume. NOTE: after booting system in Fugu, if we operated the remote control to highlight any icon on the Home UI, SNDRV_PCM_TRIGGER_START would be triggered and SNDRV_PCM_TRIGGER_STOP wouldn't be triggered, even though there wasn't any operation later. Actually there is an audio bug in Fugu user space (through AudioFliger and libalsa path?), so that the HDMI Audio driver keeps in busy status, and we have to do such hacking in android_hdmi.c to turn off the whole HDMI pipe according to the requirement. Change-Id: Ib61af73207c46edd756c21812efebdb2e5964a68 Signed-off-by: Austin Hu <austin.hu@intel.com>
-rw-r--r--drivers/staging/imgtec/intel/display/tng/drv/mrfld_display.c41
-rw-r--r--drivers/staging/imgtec/intel/otm_hdmi/os/android/android_hdmi.c39
2 files changed, 48 insertions, 32 deletions
diff --git a/drivers/staging/imgtec/intel/display/tng/drv/mrfld_display.c b/drivers/staging/imgtec/intel/display/tng/drv/mrfld_display.c
index c578f997461e..7e7d5ba24b25 100644
--- a/drivers/staging/imgtec/intel/display/tng/drv/mrfld_display.c
+++ b/drivers/staging/imgtec/intel/display/tng/drv/mrfld_display.c
@@ -312,6 +312,47 @@ static void mrfld_crtc_dpms(struct drm_crtc *crtc, int mode)
return;
#endif
+ if (pipe == 1 && dev_priv->psb_hotplug_state) {
+ if (mode == DRM_MODE_DPMS_OFF) {
+ flush_workqueue(dev_priv->power_wq);
+
+ DCLockMutex();
+ DC_MRFLD_onPowerOff(1);
+ /* give time to the last flip to take effective, if we
+ * disable hardware too quickly, overlay hardware may
+ * crash, causing pipe hang next time when we try to
+ * use overlay
+ */
+ msleep(50);
+
+ drm_handle_vblank(dev, 1);
+ /* Turn off vsync interrupt. */
+ drm_vblank_off(dev, 1);
+
+ /* Make the pending flip request as completed. */
+ DCUnAttachPipe(1);
+ DCUnLockMutex();
+
+ android_hdmi_suspend_display(dev);
+ } else {
+ android_hdmi_resume_display(dev);
+
+ /*
+ * Devices connect status will be changed
+ * when system suspend,re-detect once here.
+ */
+ if (android_hdmi_is_connected(dev)) {
+ DCLockMutex();
+ DCAttachPipe(1);
+ DC_MRFLD_onPowerOn(1);
+ mid_hdmi_audio_resume(dev);
+ DCUnLockMutex();
+ }
+ }
+
+ return;
+ }
+
power_island = pipe_to_island(pipe);
if (!power_island_get(power_island))
diff --git a/drivers/staging/imgtec/intel/otm_hdmi/os/android/android_hdmi.c b/drivers/staging/imgtec/intel/otm_hdmi/os/android/android_hdmi.c
index a688e195cfc0..d36c2380047b 100644
--- a/drivers/staging/imgtec/intel/otm_hdmi/os/android/android_hdmi.c
+++ b/drivers/staging/imgtec/intel/otm_hdmi/os/android/android_hdmi.c
@@ -2586,12 +2586,10 @@ void android_hdmi_connector_destroy(struct drm_connector *connector)
void android_hdmi_connector_dpms(struct drm_connector *connector, int mode)
{
- struct drm_device *dev = connector->dev;
- bool hdmi_audio_busy = false;
- u32 dspcntr_val;
- struct drm_psb_private *dev_priv = dev->dev_private;
#if (defined CONFIG_PM_RUNTIME) && (!defined MERRIFIELD) \
&& (defined CONFIG_SUPPORT_MIPI)
+ struct drm_device *dev = connector->dev;
+ struct drm_psb_private *dev_priv = dev->dev_private;
bool panel_on = false, panel_on2 = false;
struct mdfld_dsi_config **dsi_configs;
#endif
@@ -2601,35 +2599,12 @@ void android_hdmi_connector_dpms(struct drm_connector *connector, int mode)
OSPM_UHB_FORCE_POWER_ON))
return ;
- /* Check HDMI Audio Status */
- hdmi_audio_busy = mid_hdmi_audio_is_busy(dev);
-
- pr_debug("[DPMS] audio busy: 0x%x\n", hdmi_audio_busy);
-
- /* if hdmi audio is busy, just turn off hdmi display plane */
- if (hdmi_audio_busy) {
- dspcntr_val = PSB_RVDC32(DSPBCNTR);
- connector->dpms = mode;
-
- if (mode != DRM_MODE_DPMS_ON) {
- if (!dev_priv->hdmi_first_boot) {
- REG_WRITE(DSPBCNTR, dspcntr_val &
- ~DISPLAY_PLANE_ENABLE);
- DISP_PLANEB_STATUS = DISPLAY_PLANE_DISABLE;
- }
- } else {
- REG_WRITE(DSPBCNTR, dspcntr_val |
- DISPLAY_PLANE_ENABLE);
- DISP_PLANEB_STATUS = DISPLAY_PLANE_ENABLE;
- }
- } else {
- drm_helper_connector_dpms(connector, mode);
+ drm_helper_connector_dpms(connector, mode);
- if (mode != DRM_MODE_DPMS_ON)
- DISP_PLANEB_STATUS = DISPLAY_PLANE_DISABLE;
- else
- DISP_PLANEB_STATUS = DISPLAY_PLANE_ENABLE;
- }
+ if (mode != DRM_MODE_DPMS_ON)
+ DISP_PLANEB_STATUS = DISPLAY_PLANE_DISABLE;
+ else
+ DISP_PLANEB_STATUS = DISPLAY_PLANE_ENABLE;
#if (defined CONFIG_PM_RUNTIME) && (!defined MERRIFIELD) \
&& (defined CONFIG_SUPPORT_MIPI)