liboverlay: change in overlay due to overlay HAL removal

-- remove overlay.cpp and overlayState.cpp
-- change setParameter to setTransform

Change-Id: I6ec591810cbfe53e51b0c88ef547a2e687ea69b3
This commit is contained in:
Jeykumar Sankaran 2011-11-16 19:32:18 -08:00 committed by Kinjal Bhavsar
parent cb2b8ef287
commit e61c2f0a86
7 changed files with 37 additions and 2373 deletions

View File

@ -1,7 +1,8 @@
# Build only new gralloc
#Enables the listed display HAL modules
display-hals := liboverlay
ifeq ($(TARGET_USES_ION),true)
display-hals := libgralloc
display-hals += libgralloc
include $(call all-named-subdir-makefiles,$(display-hals))
endif
include $(call all-named-subdir-makefiles,$(display-hals))

15
liboverlay/Android.mk Normal file → Executable file
View File

@ -1,5 +1,4 @@
# Copyright (C) 2008 The Android Open Source Project
# Copyright (c) 2011, Code Aurora Forum. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -37,17 +36,5 @@ ifeq ($(TARGET_USE_HDMI_AS_PRIMARY),true)
LOCAL_CFLAGS += -DHDMI_AS_PRIMARY
endif
LOCAL_MODULE := liboverlay
include $(BUILD_SHARED_LIBRARY)
# HAL module implemenation, not prelinked and stored in
# hw/<OVERLAY_HARDWARE_MODULE_ID>.<ro.product.board>.so
include $(CLEAR_VARS)
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
LOCAL_SHARED_LIBRARIES := liblog liboverlay libcutils
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
LOCAL_C_INCLUDES += hardware/qcom/display/libgralloc
LOCAL_SRC_FILES := overlay.cpp
LOCAL_MODULE := overlay.default
LOCAL_MODULE_TAGS := eng
include $(BUILD_SHARED_LIBRARY)

File diff suppressed because it is too large Load Diff

73
liboverlay/overlayLib.cpp Normal file → Executable file
View File

@ -663,43 +663,38 @@ bool Overlay::setChannelCrop(uint32_t x, uint32_t y, uint32_t w, uint32_t h, int
return objOvDataChannel[channel].setCrop(x, y, w, h);
}
bool Overlay::setParameter(int param, int value) {
int currentOrientation = -1;
getOrientation(currentOrientation);
bool Overlay::setTransform(int value) {
int barrier = 0;
switch (mState) {
case OV_UI_MIRROR_TV:
case OV_2D_VIDEO_ON_PANEL:
case OV_3D_VIDEO_2D_PANEL:
return objOvCtrlChannel[VG0_PIPE].setParameter(param, value);
return objOvCtrlChannel[VG0_PIPE].setTransform(value);
break;
case OV_2D_VIDEO_ON_TV:
case OV_3D_VIDEO_2D_TV:
case OV_3D_VIDEO_3D_TV:
for (int i=0; i<NUM_CHANNELS; i++) {
if(!objOvCtrlChannel[i].setParameter(param, value)) {
if(!objOvCtrlChannel[i].setTransform(value)) {
LOGE("%s:failed for channel %d", __FUNCTION__, i);
return false;
}
}
break;
case OV_3D_VIDEO_3D_PANEL:
if (!sHDMIAsPrimary && param == OVERLAY_TRANSFORM) {
int barrier = 0;
switch (value) {
case HAL_TRANSFORM_ROT_90:
case HAL_TRANSFORM_ROT_270:
barrier = BARRIER_LANDSCAPE;
break;
default:
barrier = BARRIER_PORTRAIT;
break;
}
if(!enableBarrier(barrier))
LOGE("%s:failed to enable barriers for 3D video", __FUNCTION__);
switch (value) {
case HAL_TRANSFORM_ROT_90:
case HAL_TRANSFORM_ROT_270:
barrier = BARRIER_LANDSCAPE;
break;
default:
barrier = BARRIER_PORTRAIT;
break;
if(!enableBarrier(barrier))
LOGE("%s:failed to enable barriers for 3D video", __FUNCTION__);
}
for (int i=0; i<NUM_CHANNELS; i++) {
if(!objOvCtrlChannel[i].setParameter(param, value)) {
if(!objOvCtrlChannel[i].setTransform(value)) {
LOGE("%s:failed for channel %d", __FUNCTION__, i);
return false;
}
@ -712,10 +707,6 @@ bool Overlay::setParameter(int param, int value) {
return true;
}
bool Overlay::setOrientation(int value, int channel) {
return objOvCtrlChannel[channel].setParameter(OVERLAY_TRANSFORM, value);
}
bool Overlay::setFd(int fd, int channel) {
return objOvDataChannel[channel].setFd(fd);
}
@ -1211,7 +1202,7 @@ bool OverlayControlChannel::useVirtualFB() {
return true;
}
bool OverlayControlChannel::setParameter(int param, int value, bool fetch) {
bool OverlayControlChannel::setTransform(int value, bool fetch) {
if (!isChannelUP()) {
LOGE("%s: channel is not up", __FUNCTION__);
return false;
@ -1223,7 +1214,7 @@ bool OverlayControlChannel::setParameter(int param, int value, bool fetch) {
return false;
}
mOVInfo = ov;
if (!mIsChannelUpdated && (OVERLAY_TRANSFORM == param)) {
if (!mIsChannelUpdated) {
int orientation = get_mdp_orientation(value);
if (orientation == mOVInfo.user_data[0]) {
return true;
@ -1231,18 +1222,13 @@ bool OverlayControlChannel::setParameter(int param, int value, bool fetch) {
}
mIsChannelUpdated = false;
switch (param) {
case OVERLAY_DITHER:
break;
case OVERLAY_TRANSFORM:
{
int val = mOVInfo.user_data[0];
if (mNoRot)
return true;
int val = mOVInfo.user_data[0];
if (mNoRot)
return true;
int rot = value;
int rot = value;
switch(rot) {
switch(rot) {
case 0:
case HAL_TRANSFORM_FLIP_H:
case HAL_TRANSFORM_FLIP_V:
@ -1319,6 +1305,7 @@ bool OverlayControlChannel::setParameter(int param, int value, bool fetch) {
}
default: return false;
}
int mdp_rotation = get_mdp_orientation(rot);
if (mdp_rotation == -1)
return false;
@ -1329,7 +1316,6 @@ bool OverlayControlChannel::setParameter(int param, int value, bool fetch) {
/* Rotator always outputs non-tiled formats.
If rotator is used, set Overlay input to non-tiled
Else, overlay input remains tiled */
if (mOVInfo.user_data[0]) {
if (mRotInfo.src.format == MDP_Y_CRCB_H2V2_TILE)
mOVInfo.src.format = MDP_Y_CRCB_H2V2;
@ -1338,12 +1324,15 @@ bool OverlayControlChannel::setParameter(int param, int value, bool fetch) {
else {
if(mRotInfo.src.format == MDP_Y_CRCB_H2V2_TILE)
mOVInfo.src.format = MDP_Y_CRCB_H2V2_TILE;
mRotInfo.enable = 0;
//Always enable rotation for UI mirror usecase
if(mUIChannel)
mRotInfo.enable = 1;
}
if (ioctl(mRotFD, MSM_ROTATOR_IOCTL_START, &mRotInfo)) {
reportError("setParameter, rotator start failed");
reportError("setTransform, rotator start failed");
return false;
}
@ -1354,15 +1343,9 @@ bool OverlayControlChannel::setParameter(int param, int value, bool fetch) {
mOVInfo.flags &= ~MDP_SOURCE_ROTATED_90;
if (ioctl(mFD, MSMFB_OVERLAY_SET, &mOVInfo)) {
reportError("setParameter, overlay set failed");
reportError("setTransform, overlay set failed");
dump(mOVInfo);
return false;
}
break;
}
default:
reportError("Unsupproted param");
return false;
}
return true;

5
liboverlay/overlayLib.h Normal file → Executable file
View File

@ -39,7 +39,6 @@
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <hardware/overlay.h>
#include <utils/RefBase.h>
#include <alloc_controller.h>
#include <memalloc.h>
@ -182,7 +181,7 @@ public:
bool ignoreFB = false);
bool closeControlChannel();
bool setPosition(int x, int y, uint32_t w, uint32_t h);
bool setParameter(int param, int value, bool fetch = true);
bool setTransform(int value, bool fetch = true);
void setSize (int size) { mSize = size; }
bool getPosition(int& x, int& y, uint32_t& w, uint32_t& h);
bool getOvSessionID(int& sessionID) const;
@ -271,7 +270,7 @@ public:
int num_buffers = 2);
bool closeChannel();
bool setPosition(int x, int y, uint32_t w, uint32_t h);
bool setParameter(int param, int value);
bool setTransform(int value);
bool setOrientation(int value, int channel = 0);
bool setFd(int fd, int channel = 0);
bool queueBuffer(uint32_t offset, int channel = 0);

4
liboverlay/overlayLibUI.cpp Normal file → Executable file
View File

@ -28,8 +28,8 @@ namespace {
bool checkOVState(int w, int h, int format, int orientation,
int zorder, const mdp_overlay& ov) {
switch(orientation) {
case OVERLAY_TRANSFORM_ROT_90:
case OVERLAY_TRANSFORM_ROT_270: {
case HAL_TRANSFORM_ROT_90:
case HAL_TRANSFORM_ROT_270: {
int tmp = w;
w = h;
h = tmp;

File diff suppressed because it is too large Load Diff