From ef64b75a936ffd194673dbce6766995f86b42ba9 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Mon, 18 Mar 2013 11:28:50 -0700 Subject: [PATCH] Don't log an error on HWC1.1+ devices with no FB HAL Change-Id: I015e5a1a1f926181e51f82525f69beff71bd70cd --- .../DisplayHardware/HWComposer.cpp | 18 ++++++++---------- .../DisplayHardware/HWComposer.h | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index eeb1fef4c..96cfc14d6 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -99,7 +99,7 @@ HWComposer::HWComposer( bool needVSyncThread = true; // Note: some devices may insist that the FB HAL be opened before HWC. - loadFbHalModule(); + int fberr = loadFbHalModule(); loadHwcModule(); if (mFbDev && mHwc && hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_1)) { @@ -113,7 +113,8 @@ HWComposer::HWComposer( // If we have no HWC, or a pre-1.1 HWC, an FB dev is mandatory. if ((!mHwc || !hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_1)) && !mFbDev) { - ALOGE("ERROR: failed to open framebuffer, aborting"); + ALOGE("ERROR: failed to open framebuffer (%s), aborting", + strerror(-fberr)); abort(); } @@ -234,20 +235,17 @@ void HWComposer::loadHwcModule() } // Load and prepare the FB HAL, which uses the gralloc module. Sets mFbDev. -void HWComposer::loadFbHalModule() +int HWComposer::loadFbHalModule() { hw_module_t const* module; - if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module) != 0) { + int err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module); + if (err != 0) { ALOGE("%s module not found", GRALLOC_HARDWARE_MODULE_ID); - return; + return err; } - int err = framebuffer_open(module, &mFbDev); - if (err) { - ALOGE("framebuffer_open failed (%s)", strerror(-err)); - return; - } + return framebuffer_open(module, &mFbDev); } status_t HWComposer::initCheck() const { diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h index 92e4cbf65..fdbd2d962 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.h +++ b/services/surfaceflinger/DisplayHardware/HWComposer.h @@ -265,7 +265,7 @@ public: private: void loadHwcModule(); - void loadFbHalModule(); + int loadFbHalModule(); LayerListIterator getLayerIterator(int32_t id, size_t index);