libexternal: enable HPD if target supports HDMI
enable HPD only on targets that has valid HDMI fb device. Change-Id: Ia43d9138167b6ab3a887f7663a05831a2fcc09ea CRs-fixed: 506363
This commit is contained in:
@@ -670,26 +670,28 @@ int ExternalDisplay::getExtFbNum(int &fbNum) {
|
|||||||
bool ExternalDisplay::writeHPDOption(int userOption) const
|
bool ExternalDisplay::writeHPDOption(int userOption) const
|
||||||
{
|
{
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
char sysFsHPDFilePath[MAX_SYSFS_FILE_PATH];
|
if(mHdmiFbNum != -1) {
|
||||||
snprintf(sysFsHPDFilePath ,sizeof(sysFsHPDFilePath),
|
char sysFsHPDFilePath[MAX_SYSFS_FILE_PATH];
|
||||||
"/sys/devices/virtual/graphics/fb%d/hpd", mHdmiFbNum);
|
snprintf(sysFsHPDFilePath ,sizeof(sysFsHPDFilePath),
|
||||||
int hdmiHPDFile = open(sysFsHPDFilePath,O_RDWR, 0);
|
"/sys/devices/virtual/graphics/fb%d/hpd", mHdmiFbNum);
|
||||||
if (hdmiHPDFile < 0) {
|
int hdmiHPDFile = open(sysFsHPDFilePath,O_RDWR, 0);
|
||||||
ALOGE("%s: state file '%s' not found : ret%d err str: %s", __FUNCTION__,
|
if (hdmiHPDFile < 0) {
|
||||||
sysFsHPDFilePath, hdmiHPDFile, strerror(errno));
|
ALOGE("%s: state file '%s' not found : ret%d err str: %s", __FUNCTION__,
|
||||||
ret = false;
|
sysFsHPDFilePath, hdmiHPDFile, strerror(errno));
|
||||||
} else {
|
|
||||||
int err = -1;
|
|
||||||
ALOGD_IF(DEBUG, "%s: option = %d", __FUNCTION__, userOption);
|
|
||||||
if(userOption)
|
|
||||||
err = write(hdmiHPDFile, "1", 2);
|
|
||||||
else
|
|
||||||
err = write(hdmiHPDFile, "0" , 2);
|
|
||||||
if (err <= 0) {
|
|
||||||
ALOGE("%s: file write failed '%s'", __FUNCTION__, sysFsHPDFilePath);
|
|
||||||
ret = false;
|
ret = false;
|
||||||
|
} else {
|
||||||
|
int err = -1;
|
||||||
|
ALOGD_IF(DEBUG, "%s: option = %d", __FUNCTION__, userOption);
|
||||||
|
if(userOption)
|
||||||
|
err = write(hdmiHPDFile, "1", 2);
|
||||||
|
else
|
||||||
|
err = write(hdmiHPDFile, "0" , 2);
|
||||||
|
if (err <= 0) {
|
||||||
|
ALOGE("%s: file write failed '%s'", __FUNCTION__, sysFsHPDFilePath);
|
||||||
|
ret = false;
|
||||||
|
}
|
||||||
|
close(hdmiHPDFile);
|
||||||
}
|
}
|
||||||
close(hdmiHPDFile);
|
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user