summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tim Murray <timmurray@google.com> 2017-12-13 13:46:40 -0800
committer Tim Murray <timmurray@google.com> 2017-12-13 15:43:58 -0800
commit2c3217576fda79c0fc8113f157fa7f32ff81d844 (patch)
treed34c5a10f5a39836a4f5fa3daa22f5d7991ee28d
parentf49c189d6b20a1c72d0079b418b7050e0a9a1ef2 (diff)
surfaceflinger: remove vsync hint
The vsync hint isn't actually useful. Test: used taimen bug 69982006 Change-Id: Ic64577901f95f31beb50e96b7a0570e4068a33b4
-rw-r--r--services/surfaceflinger/Android.mk2
-rw-r--r--services/surfaceflinger/DisplayHardware/PowerHAL.cpp55
-rw-r--r--services/surfaceflinger/DisplayHardware/PowerHAL.h43
-rw-r--r--services/surfaceflinger/EventThread.cpp35
-rw-r--r--services/surfaceflinger/EventThread.h6
5 files changed, 0 insertions, 141 deletions
diff --git a/services/surfaceflinger/Android.mk b/services/surfaceflinger/Android.mk
index deead06b6d..56bdd5abc4 100644
--- a/services/surfaceflinger/Android.mk
+++ b/services/surfaceflinger/Android.mk
@@ -30,7 +30,6 @@ LOCAL_SRC_FILES := \
DisplayHardware/HWC2.cpp \
DisplayHardware/HWComposer.cpp \
DisplayHardware/HWComposerBufferCache.cpp \
- DisplayHardware/PowerHAL.cpp \
DisplayHardware/VirtualDisplaySurface.cpp \
Effects/Daltonizer.cpp \
EventLog/EventLogTags.logtags \
@@ -89,7 +88,6 @@ LOCAL_SHARED_LIBRARIES := \
libbinder \
libui \
libgui \
- libpowermanager \
libvulkan \
libsync \
libprotobuf-cpp-lite \
diff --git a/services/surfaceflinger/DisplayHardware/PowerHAL.cpp b/services/surfaceflinger/DisplayHardware/PowerHAL.cpp
deleted file mode 100644
index a6f076e74f..0000000000
--- a/services/surfaceflinger/DisplayHardware/PowerHAL.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <android/hardware/power/1.0/IPower.h>
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <android/log.h>
-#include <utils/Errors.h>
-
-#include <binder/IServiceManager.h>
-#include <powermanager/IPowerManager.h>
-#include <powermanager/PowerManager.h>
-
-#include "PowerHAL.h"
-
-using android::hardware::power::V1_0::PowerHint;
-namespace android {
-// ---------------------------------------------------------------------------
-
-status_t PowerHAL::vsyncHint(bool enabled) {
- Mutex::Autolock _l(mlock);
- if (mPowerManager == NULL) {
- const String16 serviceName("power");
- sp<IBinder> bs = defaultServiceManager()->checkService(serviceName);
- if (bs == NULL) {
- return NAME_NOT_FOUND;
- }
- mPowerManager = interface_cast<IPowerManager>(bs);
- }
- status_t status;
- status = mPowerManager->powerHint(static_cast<int>(PowerHint::VSYNC),
- enabled ? 1 : 0);
- if(status == DEAD_OBJECT) {
- mPowerManager = NULL;
- }
- return status;
-}
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
diff --git a/services/surfaceflinger/DisplayHardware/PowerHAL.h b/services/surfaceflinger/DisplayHardware/PowerHAL.h
deleted file mode 100644
index e5f82a97fc..0000000000
--- a/services/surfaceflinger/DisplayHardware/PowerHAL.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_SF_POWER_HAL_H
-#define ANDROID_SF_POWER_HAL_H
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <utils/Mutex.h>
-
-#include <powermanager/IPowerManager.h>
-#include <hardware/power.h>
-
-namespace android {
-// ---------------------------------------------------------------------------
-
-class PowerHAL
-{
-public:
- status_t vsyncHint(bool enabled);
-
-private:
- sp<IPowerManager> mPowerManager;
- Mutex mlock;
-};
-
-// ---------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_SF_POWER_HAL_H
diff --git a/services/surfaceflinger/EventThread.cpp b/services/surfaceflinger/EventThread.cpp
index f647742e2c..a1a042039c 100644
--- a/services/surfaceflinger/EventThread.cpp
+++ b/services/surfaceflinger/EventThread.cpp
@@ -34,14 +34,6 @@
// ---------------------------------------------------------------------------
namespace android {
// ---------------------------------------------------------------------------
-// time to wait between VSYNC requests before sending a VSYNC OFF power hint: 40msec.
-const long vsyncHintOffDelay = 40000000;
-
-static void vsyncOffCallback(union sigval val) {
- EventThread *ev = (EventThread *)val.sival_ptr;
- ev->sendVsyncHintOff();
- return;
-}
EventThread::EventThread(const sp<VSyncSource>& src, SurfaceFlinger& flinger, bool interceptVSyncs)
: mVSyncSource(src),
@@ -49,7 +41,6 @@ EventThread::EventThread(const sp<VSyncSource>& src, SurfaceFlinger& flinger, bo
mUseSoftwareVSync(false),
mVsyncEnabled(false),
mDebugVsyncEnabled(false),
- mVsyncHintSent(false),
mInterceptVSyncs(interceptVSyncs) {
for (int32_t i=0 ; i<DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES ; i++) {
@@ -58,18 +49,6 @@ EventThread::EventThread(const sp<VSyncSource>& src, SurfaceFlinger& flinger, bo
mVSyncEvent[i].header.timestamp = 0;
mVSyncEvent[i].vsync.count = 0;
}
- struct sigevent se;
- se.sigev_notify = SIGEV_THREAD;
- se.sigev_value.sival_ptr = this;
- se.sigev_notify_function = vsyncOffCallback;
- se.sigev_notify_attributes = NULL;
- timer_create(CLOCK_MONOTONIC, &se, &mTimerId);
-}
-
-void EventThread::sendVsyncHintOff() {
- Mutex::Autolock _l(mLock);
- mPowerHAL.vsyncHint(false);
- mVsyncHintSent = false;
}
void EventThread::setPhaseOffset(nsecs_t phaseOffset) {
@@ -77,19 +56,6 @@ void EventThread::setPhaseOffset(nsecs_t phaseOffset) {
mVSyncSource->setPhaseOffset(phaseOffset);
}
-void EventThread::sendVsyncHintOnLocked() {
- struct itimerspec ts;
- if(!mVsyncHintSent) {
- mPowerHAL.vsyncHint(true);
- mVsyncHintSent = true;
- }
- ts.it_value.tv_sec = 0;
- ts.it_value.tv_nsec = vsyncHintOffDelay;
- ts.it_interval.tv_sec = 0;
- ts.it_interval.tv_nsec = 0;
- timer_settime(mTimerId, 0, &ts, NULL);
-}
-
void EventThread::onFirstRef() {
run("EventThread", PRIORITY_URGENT_DISPLAY + PRIORITY_MORE_FAVORABLE);
}
@@ -357,7 +323,6 @@ void EventThread::enableVSyncLocked() {
}
}
mDebugVsyncEnabled = true;
- sendVsyncHintOnLocked();
}
void EventThread::disableVSyncLocked() {
diff --git a/services/surfaceflinger/EventThread.h b/services/surfaceflinger/EventThread.h
index 6a59fbbf42..0823839ee7 100644
--- a/services/surfaceflinger/EventThread.h
+++ b/services/surfaceflinger/EventThread.h
@@ -29,7 +29,6 @@
#include <utils/SortedVector.h>
#include "DisplayDevice.h"
-#include "DisplayHardware/PowerHAL.h"
// ---------------------------------------------------------------------------
namespace android {
@@ -99,7 +98,6 @@ public:
DisplayEventReceiver::Event* event);
void dump(String8& result) const;
- void sendVsyncHintOff();
void setPhaseOffset(nsecs_t phaseOffset);
@@ -112,11 +110,9 @@ private:
void removeDisplayEventConnection(const wp<Connection>& connection);
void enableVSyncLocked();
void disableVSyncLocked();
- void sendVsyncHintOnLocked();
// constants
sp<VSyncSource> mVSyncSource;
- PowerHAL mPowerHAL;
SurfaceFlinger& mFlinger;
mutable Mutex mLock;
@@ -132,9 +128,7 @@ private:
// for debugging
bool mDebugVsyncEnabled;
- bool mVsyncHintSent;
const bool mInterceptVSyncs;
- timer_t mTimerId;
};
// ---------------------------------------------------------------------------