summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Layher <layhertony@gmail.com>2014-12-20 00:41:21 -0500
committerSteve Kondik <shade@chemlab.org>2014-12-27 12:42:34 +0000
commit40872c931b3dce43c22870ccd0079fca25d5bf70 (patch)
tree353f5c3062d451d1b85270430d7db8d7bee8b57f
parentc682fa83e3da5971b23ecca838f3cf2755fa6d79 (diff)
downloadandroid_frameworks_native-40872c931b3dce43c22870ccd0079fca25d5bf70.tar.gz
android_frameworks_native-40872c931b3dce43c22870ccd0079fca25d5bf70.tar.bz2
android_frameworks_native-40872c931b3dce43c22870ccd0079fca25d5bf70.zip
SurfaceFlinger: Make secure display ifdefs more narrow.
* apq8084 target hals do not export display attrs the same as previous platforms (8974, 8960 etc) but continue the use of QCOM_BSP. * Due to this difference secure content is non-visible on apq8084 platforms because SF pushes the rendering to GLES vice the secure buffer of HWC and MDP. Change-Id: Ie078638b1e22d1c9f73441e290c2882b4081b294
-rw-r--r--services/surfaceflinger/Android.mk4
-rw-r--r--services/surfaceflinger/DisplayHardware/HWComposer.cpp10
-rw-r--r--services/surfaceflinger/DisplayHardware/HWComposer.h4
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp6
4 files changed, 14 insertions, 10 deletions
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index 1abcbed88..39cc4b446 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -47,6 +47,10 @@ ifeq ($(TARGET_BOARD_PLATFORM),s5pc110)
LOCAL_CFLAGS += -DHAS_CONTEXT_PRIORITY
endif
+ifeq ($(TARGET_BOARD_PLATFORM),apq8084)
+ LOCAL_CFLAGS += -DAPQ8084
+endif
+
ifeq ($(TARGET_DISABLE_TRIPLE_BUFFERING),true)
LOCAL_CFLAGS += -DTARGET_DISABLE_TRIPLE_BUFFERING
endif
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index b2b07a185..6fde6e9c2 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -179,7 +179,7 @@ HWComposer::HWComposer(
config.height = mFbDev->height;
config.xdpi = mFbDev->xdpi;
config.ydpi = mFbDev->ydpi;
-#ifdef QCOM_BSP
+#if defined(QCOM_BSP) && !defined(APQ8084)
config.secure = true; //XXX: Assuming primary is always true
#endif
config.refresh = nsecs_t(1e9 / mFbDev->fps);
@@ -353,7 +353,7 @@ static const uint32_t DISPLAY_ATTRIBUTES[] = {
HWC_DISPLAY_HEIGHT,
HWC_DISPLAY_DPI_X,
HWC_DISPLAY_DPI_Y,
-#ifdef QCOM_BSP
+#if defined(QCOM_BSP) && !defined(APQ8084)
//To specify if display is secure
//Primary is considered as secure always
//HDMI can be secure based on HDCP
@@ -414,7 +414,7 @@ status_t HWComposer::queryDisplayProperties(int disp) {
case HWC_DISPLAY_DPI_Y:
config.ydpi = values[i] / 1000.0f;
break;
-#ifdef QCOM_BSP
+#if defined(QCOM_BSP) && !defined(APQ8084)
case HWC_DISPLAY_SECURE:
config.secure = values[i];
break;
@@ -530,7 +530,7 @@ float HWComposer::getDpiY(int disp) const {
return mDisplayData[disp].configs[currentConfig].ydpi;
}
-#ifdef QCOM_BSP
+#if defined(QCOM_BSP) && !defined(APQ8084)
bool HWComposer::isSecure(int disp) const {
size_t currentConfig = mDisplayData[disp].currentConfig;
return mDisplayData[disp].configs[currentConfig].secure;
@@ -1266,7 +1266,7 @@ void HWComposer::dump(String8& result) const {
result.appendFormat(" Display[%zd] configurations (* current):\n", i);
for (size_t c = 0; c < disp.configs.size(); ++c) {
const DisplayConfig& config(disp.configs[c]);
-#ifdef QCOM_BSP
+#if defined(QCOM_BSP) && !defined(APQ8084)
result.appendFormat(" %s%zd: %ux%u, xdpi=%f, ydpi=%f, secure=%d refresh=%" PRId64 "\n",
c == disp.currentConfig ? "* " : "", c, config.width, config.height,
config.xdpi, config.ydpi, config.secure, config.refresh);
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h
index 4e3d1d114..857c3ac8a 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.h
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.h
@@ -276,7 +276,7 @@ public:
uint32_t height;
float xdpi;
float ydpi;
-#ifdef QCOM_BSP
+#if defined(QCOM_BSP) && !defined(APQ8084)
bool secure;
#endif
nsecs_t refresh;
@@ -288,7 +288,7 @@ public:
sp<Fence> getDisplayFence(int disp) const;
uint32_t getFormat(int disp) const;
bool isConnected(int disp) const;
-#ifdef QCOM_BSP
+#if defined(QCOM_BSP) && !defined(APQ8084)
bool isSecure(int disp) const;
#endif
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index bbe5e9091..708e205d0 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -447,7 +447,7 @@ void SurfaceFlinger::init() {
DisplayDevice::DisplayType type((DisplayDevice::DisplayType)i);
// set-up the displays that are already connected
if (mHwc->isConnected(i) || type==DisplayDevice::DISPLAY_PRIMARY) {
-#ifdef QCOM_BSP
+#if defined(QCOM_BSP) && !defined(APQ8084)
// query from hwc if the non-virtual display is secure.
bool isSecure = mHwc->isSecure(i);;
#else
@@ -643,7 +643,7 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& display,
info.presentationDeadline =
hwConfig.refresh - SF_VSYNC_EVENT_PHASE_OFFSET_NS + 1000000;
-#ifdef QCOM_BSP
+#if defined(QCOM_BSP) && !defined(APQ8084)
// set secure info based on the hwcConfig
info.secure = hwConfig.secure;
#else
@@ -861,7 +861,7 @@ void SurfaceFlinger::onHotplugReceived(int type, bool connected) {
if (uint32_t(type) < DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES) {
Mutex::Autolock _l(mStateLock);
if (connected) {
-#ifdef QCOM_BSP
+#if defined(QCOM_BSP) && !defined(APQ8084)
// query from hwc if the connected display is secure
bool secure = mHwc->isSecure(type);;
#else