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/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index 2bf421f..fd3bb69 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.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.
@@ -255,7 +255,7 @@
hwc_context_t* ctx = (hwc_context_t*)(dev);
const int dpy = HWC_DISPLAY_PRIMARY;
bool fbComp = false;
- if (LIKELY(list && list->numHwLayers > 1) &&
+ if (LIKELY(list && list->numHwLayers > 1) && ctx->dpyAttr[dpy].connected &&
(ctx->dpyAttr[dpy].isActive ||
ctx->mHDMIDisplay->isHDMIPrimaryDisplay())
&& !ctx->dpyAttr[dpy].isPause) {
@@ -814,7 +814,8 @@
if (hotPluggable) {
ret = ctx->mHDMIDisplay->getAttrForConfig(config, xres, yres, refresh);
if(ret < 0) {
- ALOGE("%s Error getting attributes for config %d", config);
+ ALOGE("%s Error getting attributes for config %d",
+ __FUNCTION__, config);
return ret;
}
}