summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2012-09-18 11:39:40 -0700
committerJesse Hall <jessehall@google.com>2012-09-18 11:39:40 -0700
commitd3d35f18345c3ef93217313a583ace473b5a47ad (patch)
treef975d283015a087e9462e53ad5c18e2f8bb5e6c5 /services
parent8dfa92fef9759a881e96ee58d59875d35023aab9 (diff)
downloadframeworks_native-d3d35f18345c3ef93217313a583ace473b5a47ad.zip
frameworks_native-d3d35f18345c3ef93217313a583ace473b5a47ad.tar.gz
frameworks_native-d3d35f18345c3ef93217313a583ace473b5a47ad.tar.bz2
Check that HWC exists before trying to use it
Bug: 7185810 Change-Id: I1271d6ba397f3abf0ef166b8d03b9b26b72e28d7
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/DisplayHardware/HWComposer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index 9c04fc0..8d07722 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -648,7 +648,7 @@ status_t HWComposer::acquire() const {
}
int HWComposer::getVisualID() const {
- if (hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_1)) {
+ if (mHwc && hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_1)) {
// FIXME: temporary hack until HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED
// is supported by the implementation. we can only be in this case
// if we have HWC 1.1
@@ -665,7 +665,7 @@ bool HWComposer::supportsFramebufferTarget() const {
int HWComposer::fbPost(int32_t id,
const sp<Fence>& acquireFence, const sp<GraphicBuffer>& buffer) {
- if (hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_1)) {
+ if (mHwc && hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_1)) {
return setFramebufferTarget(id, acquireFence, buffer);
} else {
if (acquireFence != NULL) {
@@ -676,7 +676,7 @@ int HWComposer::fbPost(int32_t id,
}
int HWComposer::fbCompositionComplete() {
- if (hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_1))
+ if (mHwc && hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_1))
return NO_ERROR;
if (mFbDev->compositionComplete) {