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/composers/GE2DComposer.cpp b/hwc2/common/composers/GE2DComposer.cpp
index 591b495..f18e7e8 100644
--- a/hwc2/common/composers/GE2DComposer.cpp
+++ b/hwc2/common/composers/GE2DComposer.cpp
@@ -1,6 +1,21 @@
/*
-// Copyright(c) 2016 Amlogic Corporation
+// Copyright (c) 2016 Amlogic
+//
+// 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 <HwcTrace.h>
#include <HwcFenceControl.h>
#include <GE2DComposer.h>
@@ -157,7 +172,7 @@ bool GE2DComposer::initialize(framebuffer_info_t* fbInfo)
if (ret < 0) {
DEINIT_AND_RETURN_FALSE("allocBuffer failed!");
}
- private_handle_t const *pHandle = reinterpret_cast<private_handle_t const*> (mGe2dBufHnd);
+ private_handle_t const *pHandle = private_handle_t::dynamicCast(mGe2dBufHnd);
if (pHandle) {
mSharedFd = pHandle->share_fd;
}
@@ -204,7 +219,7 @@ void GE2DComposer::deinitialize()
mSrcBufferInfo = NULL;
}
- private_handle_t const* hnd = reinterpret_cast<private_handle_t const*>(mGe2dBufHnd);
+ private_handle_t const* hnd = private_handle_t::dynamicCast(mGe2dBufHnd);
if (NULL != hnd) {
freeBuffer(hnd, mFbInfo->grallocModule);
mGe2dBufHnd = NULL;
@@ -448,7 +463,8 @@ void GE2DComposer::dumpLayers(
#if 1
int32_t base = 4 * (hnd->stride * (hnd->height / 2) + 10);
char* tmp = (char*)layerBuffer + base;
- DTRACE("[0x%x, 0x%x, 0x%x, 0x%x]\n"
+ ETRACE("GE2DComposer dump layer:\n"
+ "[0x%x, 0x%x, 0x%x, 0x%x]\n"
"[0x%x, 0x%x, 0x%x, 0x%x]\n"
"[0x%x, 0x%x, 0x%x, 0x%x]\n"
"[0x%x, 0x%x, 0x%x, 0x%x]\n",
@@ -463,7 +479,7 @@ void GE2DComposer::dumpLayers(
sprintf(path, "/data/local/tmp/layer_%" PRId64 ".bin", systemTime(SYSTEM_TIME_MONOTONIC));
fd = open(path, O_RDWR | O_CREAT);
if (-1 == fd) {
- ETRACE("Stark, open file failed!");
+ ETRACE("open file failed!");
return;
}
write(fd, layerBuffer, hnd->size);
@@ -471,7 +487,6 @@ void GE2DComposer::dumpLayers(
close(fd);
#endif
munmap(layerBuffer, hnd->size);
- DTRACE("dumpLayer ok");
} else {
ETRACE("layerBuffer mmap fail");
}
@@ -490,12 +505,12 @@ void GE2DComposer::runGE2DProcess(int32_t slot, Vector< LayerState* > &hwcLayers
layer[i] = hwcLayersState.itemAt(i);
sourceCrop[i] = layer[i]->mSourceCrop;
displayFrame[i] = layer[i]->mDisplayFrame;
- hnd[i] = reinterpret_cast<private_handle_t const*>(layer[i]->mBufferHnd);
+ hnd[i] = private_handle_t::dynamicCast(layer[i]->mBufferHnd);
DTRACE("layer[%d] zorder: %d, blend: %d, PlaneAlpha: %f, "
"mColor: [%d, %d, %d, %d], mDataSpace: %d, format hnd[%d]: %x",
i, layer[i]->mZ, layer[i]->mBlendMode, layer[i]->mPlaneAlpha,
layer[i]->mColor.r, layer[i]->mColor.g, layer[i]->mColor.b,
- layer[i]->mColor.a, layer[i]->mDataSpace, i, hnd[i]->format);
+ layer[i]->mColor.a, layer[i]->mDataSpace, i, hnd[i] ? hnd[i]->format : 0xff);
}
bool debugSameSize = Utils::checkBoolProp("sys.sf.debug.ss");
@@ -688,7 +703,7 @@ bool GE2DComposer::threadLoop()
// ge2d finished process, make sure fd close here.
for (int32_t i=0; i<layersState.size(); i++) {
LayerState* layer = layersState.itemAt(i);
- // ETRACE("close->layer:[%12" PRIxPTR ", %d]", layer->mBufferHnd, layer->mBufferFd);
+ // DTRACE("close->layer:[%12" PRIxPTR ", %d]", layer->mBufferHnd, layer->mBufferFd);
if (layer != NULL) {
Utils::closeFd(layer->mBufferFd);
layer->mBufferFd = -1;