summaryrefslogtreecommitdiff
authorStark Li <stark.li@amlogic.com>2017-12-18 09:33:36 (GMT)
committer Luan Yuan <luan.yuan@amlogic.com>2017-12-22 06:40:13 (GMT)
commite16b144a4a5d1b78596d1998ccf4fb6fcb95c185 (patch)
treed25dec8d898cb993ae235ca67f588f8df5eeeb7d
parent4f076260d9c8c2649ab0526d04b3727e77eec1be (diff)
downloadhwcomposer-e16b144a4a5d1b78596d1998ccf4fb6fcb95c185.zip
hwcomposer-e16b144a4a5d1b78596d1998ccf4fb6fcb95c185.tar.gz
hwcomposer-e16b144a4a5d1b78596d1998ccf4fb6fcb95c185.tar.bz2
hwc2: Fix hdmi uevent and refresh sf after hotplug complete.
PD#157039 Change-Id: Ibf2e07b5d256664f4d15494427e20cad4aa0d65e
Diffstat
-rw-r--r--hwc2/common/devices/PrimaryDevice.cpp20
-rw-r--r--hwc2/common/utils/Utils.cpp2
-rw-r--r--hwc2/include/PrimaryDevice.h1
3 files changed, 18 insertions, 5 deletions
diff --git a/hwc2/common/devices/PrimaryDevice.cpp b/hwc2/common/devices/PrimaryDevice.cpp
index 377db74..797f9ff 100644
--- a/hwc2/common/devices/PrimaryDevice.cpp
+++ b/hwc2/common/devices/PrimaryDevice.cpp
@@ -49,6 +49,8 @@ bool PrimaryDevice::initialize()
DEINIT_AND_RETURN_FALSE("failed to initialize physical device");
}
+ mSignalHpd = false;
+
UeventObserver *observer = Hwcomposer::getInstance().getUeventObserver();
if (observer) {
observer->registerListener(
@@ -75,7 +77,8 @@ void PrimaryDevice::hotplugEventListener(void *data, bool status)
{
PrimaryDevice *pThis = (PrimaryDevice*)data;
if (pThis) {
- pThis->hotplugListener(status);
+ pThis->hotplugListener(0);
+ if (status) pThis->mSignalHpd = true;
}
}
@@ -83,6 +86,7 @@ void PrimaryDevice::modeChangeEventListener(void *data, bool status)
{
PrimaryDevice *pThis = (PrimaryDevice*)data;
DTRACE("mode change event: %d", status);
+
if (status && pThis) {
pThis->changeModeDetectThread();
}
@@ -96,7 +100,10 @@ void PrimaryDevice::hotplugListener(bool connected)
updateHotplugState(connected);
// update display configs
- onHotplug(getDisplayId(), connected);
+ // onHotplug(getDisplayId(), connected);
+
+ // notify sf to refresh.
+ getDevice().refresh(getDisplayId());
}
int PrimaryDevice::parseConfigFile()
@@ -152,9 +159,14 @@ void* PrimaryDevice::changeModeDetect(void* data)
Utils::getSysfsStr(SYSFS_DISPLAY_MODE, lastMode);
do {
modeChanged = Utils::checkSysfsStatus(SYSFS_DISPLAY_MODE, lastMode, 32);
- usleep(1000 * 1000);
+ usleep(500 * 1000);
} while (!modeChanged);
- pThis->setOsdMouse();
+
+ if (pThis->mSignalHpd) {
+ pThis->setOsdMouse();
+ pThis->hotplugListener(1);
+ pThis->mSignalHpd = false;
+ }
return NULL;
}
diff --git a/hwc2/common/utils/Utils.cpp b/hwc2/common/utils/Utils.cpp
index deae89c..4bccd50 100644
--- a/hwc2/common/utils/Utils.cpp
+++ b/hwc2/common/utils/Utils.cpp
@@ -203,7 +203,7 @@ bool Utils::checkSysfsStatus(const char* sysfstr, char* lastr, int32_t size) {
const char* Utils::getHotplugUeventEnvelope()
{
- return "change@/devices/virtual/switch/hdmi_delay";
+ return "change@/devices/virtual/amhdmitx/amhdmitx0/hdmi";
}
const char* Utils::getHdcpUeventEnvelope()
diff --git a/hwc2/include/PrimaryDevice.h b/hwc2/include/PrimaryDevice.h
index 7cb8fef..216f404 100644
--- a/hwc2/include/PrimaryDevice.h
+++ b/hwc2/include/PrimaryDevice.h
@@ -58,6 +58,7 @@ private:
const char* pConfigPath;
int mDisplayType;
+ bool mSignalHpd;
};
}