hwc: Fixes for HDMI primary/external use cases
1. Do not process the display list when the display is not connected.
This is applicable mainly in the HDMI as primary use case since we
want to activate the display only when the cable is connected.
2. Do not write to HPD when HDMI is primary
HPD is always enabled when HDMI is primary, and so we rely on the
connected state (read from sysfs) to determine if the cable is
connected or not.
3. Initialize the down scale feature switch
Initialize down scale feature switch when HDMI is connected but
before we make the call to modify display attributes.
Change-Id: If2a7c8d7af105a9bbd1b6aeef030ac22b51bd3ef
diff --git a/libhdmi/hdmi.cpp b/libhdmi/hdmi.cpp
index 1aee664..7d709cb 100644
--- a/libhdmi/hdmi.cpp
+++ b/libhdmi/hdmi.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 The Android Open Source Project
- * Copyright (C) 2012-2014, The Linux Foundation. All rights reserved.
+ * Copyright (C) 2012-2015, The Linux Foundation. All rights reserved.
*
* Not a Contribution, Apache license notifications and license are
* retained for attribution purposes only.
@@ -109,11 +109,6 @@
//Get the best mode and set
mActiveConfig = getBestConfig();
}
- // Set the mode corresponding to the active index
- mCurrentMode = mEDIDModes[mActiveConfig];
- setAttributes();
- // set system property
- property_set("hw.hdmiON", "1");
// Read the system property to determine if downscale feature is enabled.
char value[PROPERTY_VALUE_MAX];
@@ -123,6 +118,12 @@
mMDPDownscaleEnabled = true;
}
+ // Set the mode corresponding to the active index
+ mCurrentMode = mEDIDModes[mActiveConfig];
+ setAttributes();
+ // set system property
+ property_set("hw.hdmiON", "1");
+
// XXX: A debug property can be used to enable resolution change for
// testing purposes: debug.hwc.enable_resolution_change
mEnableResolutionChange = false;
@@ -148,7 +149,7 @@
HDMIDisplay::HDMIDisplay():mFd(-1),
mCurrentMode(-1), mModeCount(0), mPrimaryWidth(0), mPrimaryHeight(0),
- mUnderscanSupported(false)
+ mUnderscanSupported(false), mMDPDownscaleEnabled(false)
{
memset(&mVInfo, 0, sizeof(mVInfo));
@@ -159,10 +160,12 @@
}
mFbNum = overlay::Overlay::getInstance()->getFbForDpy(mDisplayId);
- // disable HPD at start, it will be enabled later
+ // Disable HPD at start if HDMI is external, it will be enabled later
// when the display powers on
// This helps for framework reboot or adb shell stop/start
- writeHPDOption(0);
+ if (mDisplayId) {
+ writeHPDOption(0);
+ }
// for HDMI - retreive all the modes supported by the driver
if(mFbNum != -1) {