summaryrefslogtreecommitdiff
Diffstat
-rw-r--r--hwc2/common/base/HwcFenceControl.cpp22
-rw-r--r--hwc2/common/base/HwcLayer.cpp61
-rw-r--r--hwc2/common/base/HwcLayer.h7
-rw-r--r--hwc2/common/base/Hwcomposer.cpp3
-rw-r--r--hwc2/common/composers/Composers.cpp16
-rw-r--r--hwc2/common/composers/Composers.h15
-rw-r--r--hwc2/common/composers/GE2DComposer.cpp33
-rw-r--r--hwc2/common/composers/GE2DComposer.h22
-rw-r--r--hwc2/common/devices/PhysicalDevice.cpp598
-rw-r--r--hwc2/common/devices/PrimaryDevice.cpp13
-rw-r--r--hwc2/common/devices/VirtualDevice.cpp14
-rw-r--r--hwc2/common/hdmi/DisplayHdmi.cpp853
-rw-r--r--hwc2/common/hdmi/DisplayHdmi.h202
-rw-r--r--hwc2/common/observers/SoftVsyncObserver.cpp18
-rw-r--r--hwc2/common/observers/SoftVsyncObserver.h3
-rw-r--r--hwc2/common/observers/UeventObserver.cpp2
-rw-r--r--hwc2/common/utils/AmVideo.cpp109
-rw-r--r--hwc2/common/utils/AmVinfo.cpp928
-rw-r--r--hwc2/common/utils/Utils.cpp89
-rw-r--r--hwc2/common/utils/Utils.h30
-rw-r--r--hwc2/include/AmVideo.h45
-rw-r--r--hwc2/include/AmVinfo.h221
-rw-r--r--hwc2/include/HwcFenceControl.h15
-rw-r--r--hwc2/include/IComposer.h16
-rw-r--r--hwc2/include/IComposerFactory.h16
-rw-r--r--hwc2/include/IDisplayDevice.h16
-rw-r--r--hwc2/include/PhysicalDevice.h33
-rw-r--r--hwc2/include/VirtualDevice.h1
-rw-r--r--hwc2/platforms/Android.mk6
-rw-r--r--tvp/LICENSE23
-rw-r--r--tvp/OmxUtil.cpp48
-rw-r--r--tvp/OmxUtil.h13
32 files changed, 2617 insertions, 874 deletions
diff --git a/hwc2/common/observers/SoftVsyncObserver.cpp b/hwc2/common/observers/SoftVsyncObserver.cpp
index 6347b8d..f739add 100644
--- a/hwc2/common/observers/SoftVsyncObserver.cpp
+++ b/hwc2/common/observers/SoftVsyncObserver.cpp
@@ -31,7 +31,6 @@ namespace amlogic {
SoftVsyncObserver::SoftVsyncObserver(IDisplayDevice& disp)
: mDisplayDevice(disp),
mEnabled(false),
- mRefreshRate(60), // default 60 frames per second
mRefreshPeriod(0),
mLock(),
mCondition(),
@@ -55,8 +54,7 @@ bool SoftVsyncObserver::initialize()
mExitThread = false;
mEnabled = false;
- mRefreshRate = 60;
- mRefreshPeriod = nsecs_t(1e9 / mRefreshRate);
+ mRefreshPeriod = nsecs_t(1e9 / 60);
mThread = new VsyncEventPollThread(this);
if (!mThread.get()) {
DEINIT_AND_RETURN_FALSE("failed to create vsync event poll thread.");
@@ -83,16 +81,15 @@ void SoftVsyncObserver::deinitialize()
mInitialized = false;
}
-void SoftVsyncObserver::setRefreshRate(int rate)
+void SoftVsyncObserver::setRefreshPeriod(nsecs_t period)
{
Mutex::Autolock _l(mLock);
- if (rate < 1 || rate > 120) {
- WTRACE("invalid refresh rate %d", rate);
- } else if (mRefreshRate != rate) {
- mRefreshRate = rate;
+ if (period <= 0) {
+ WTRACE("invalid refresh period %lld", period);
+ } else if (mRefreshPeriod != period) {
+ mRefreshPeriod = period;
if (mEnabled) {
- mRefreshPeriod = nsecs_t(1e9 / mRefreshRate);
mNextFakeVSync = systemTime(CLOCK_MONOTONIC) + mRefreshPeriod;
}
}
@@ -108,7 +105,6 @@ bool SoftVsyncObserver::control(bool enabled)
}
if (enabled) {
- mRefreshPeriod = nsecs_t(1e9 / mRefreshRate);
mNextFakeVSync = systemTime(CLOCK_MONOTONIC) + mRefreshPeriod;
}
mEnabled = enabled;
@@ -129,11 +125,11 @@ bool SoftVsyncObserver::threadLoop()
}
}
-
const nsecs_t period = mRefreshPeriod;
const nsecs_t now = systemTime(CLOCK_MONOTONIC);
nsecs_t next_vsync = mNextFakeVSync;
nsecs_t sleep = next_vsync - now;
+ //DTRACE("Softvync (%lld), refresh (%lld)", period, nsecs_t(1e9/period));
if (sleep < 0) {
// we missed, find where the next vsync should be
sleep = (period - ((now - next_vsync) % period));