HWComposer: Set the transform value correctly
When using the bypass, read only last 4 bits of the transfrom value regarding the change of transform value in Layer::setGeometry(). (cherry picked from commit 7689940bec6440b78418cb15a9888312ab96ea04) Change-Id: Ida5781e3e92929b8024947a41e5521f83164a4f7 Conflicts: libhwcomposer/hwcomposer.cpp
This commit is contained in:
parent
1ded1767f9
commit
e1ea460dc4
@ -28,6 +28,7 @@
|
||||
#include <cutils/atomic.h>
|
||||
#include <cutils/properties.h>
|
||||
|
||||
#include <gralloc_priv.h>
|
||||
#include <hardware/hwcomposer.h>
|
||||
#include <overlayLib.h>
|
||||
#include <overlayLibUI.h>
|
||||
@ -36,7 +37,6 @@
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#include <ui/android_native_buffer.h>
|
||||
#include <gralloc_priv.h>
|
||||
#include <genlock.h>
|
||||
#include <qcom_ui.h>
|
||||
#include <gr.h>
|
||||
@ -149,7 +149,7 @@ struct private_hwc_module_t HAL_MODULE_INFO_SYM = {
|
||||
|
||||
static void dump_layer(hwc_layer_t const* l) {
|
||||
LOGD("\ttype=%d, flags=%08x, handle=%p, tr=%02x, blend=%04x, {%d,%d,%d,%d}, {%d,%d,%d,%d}",
|
||||
l->compositionType, l->flags, l->handle, l->transform, l->blending,
|
||||
l->compositionType, l->flags, l->handle, l->transform & FINAL_TRANSFORM_MASK, l->blending,
|
||||
l->sourceCrop.left,
|
||||
l->sourceCrop.top,
|
||||
l->sourceCrop.right,
|
||||
@ -391,7 +391,7 @@ static int prepareBypass(hwc_context_t *ctx, hwc_layer_t *layer,
|
||||
info.size = hnd->size;
|
||||
|
||||
int fbnum = 0;
|
||||
int orientation = layer->transform;
|
||||
int orientation = layer->transform & FINAL_TRANSFORM_MASK;
|
||||
const bool useVGPipe =
|
||||
#ifdef NO_BYPASS_CROPPING
|
||||
(nPipeIndex != (MAX_BYPASS_LAYERS - 2));
|
||||
@ -490,7 +490,7 @@ inline static bool isBypassDoable(hwc_composer_device_t *dev, const int yuvCount
|
||||
|
||||
//Bypass is not efficient if rotation or asynchronous mode is needed.
|
||||
for(int i = 0; i < list->numHwLayers; ++i) {
|
||||
if(list->hwLayers[i].transform) {
|
||||
if(list->hwLayers[i].transform & FINAL_TRANSFORM_MASK) {
|
||||
return false;
|
||||
}
|
||||
if(list->hwLayers[i].flags & HWC_LAYER_ASYNCHRONOUS) {
|
||||
|
1
liboverlay/Android.mk
Executable file → Normal file
1
liboverlay/Android.mk
Executable file → Normal file
@ -20,6 +20,7 @@ LOCAL_PRELINK_MODULE := false
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)
|
||||
LOCAL_SHARED_LIBRARIES := liblog libcutils libutils libmemalloc
|
||||
LOCAL_C_INCLUDES += hardware/qcom/display/libgralloc
|
||||
LOCAL_C_INCLUDES += hardware/qcom/display/libqcomui
|
||||
LOCAL_SRC_FILES := \
|
||||
overlayLib.cpp \
|
||||
overlayLibUI.cpp \
|
||||
|
7
liboverlay/overlayLib.h
Executable file → Normal file
7
liboverlay/overlayLib.h
Executable file → Normal file
@ -43,6 +43,7 @@
|
||||
#include <utils/RefBase.h>
|
||||
#include <alloc_controller.h>
|
||||
#include <memalloc.h>
|
||||
#include <qcom_ui.h>
|
||||
|
||||
#ifdef USES_POST_PROCESSING
|
||||
#include "lib-postproc.h"
|
||||
@ -61,12 +62,6 @@
|
||||
#define FRAMEBUFFER_1 1
|
||||
#define FRAMEBUFFER_2 2
|
||||
|
||||
// To extract the src buffer transform
|
||||
#define SHIFT_SRC_TRANSFORM 4
|
||||
#define SRC_TRANSFORM_MASK 0x00F0
|
||||
#define FINAL_TRANSFORM_MASK 0x000F
|
||||
|
||||
|
||||
#define NUM_SHARPNESS_VALS 256
|
||||
#define SHARPNESS_RANGE 1.0f
|
||||
#define HUE_RANGE 180
|
||||
|
@ -713,6 +713,7 @@ void dumpLayer(int moduleCompositionType, int listFlags, size_t layerIndex,
|
||||
hwc_rect_t displayFrame = layer->displayFrame;
|
||||
private_handle_t *hnd = (private_handle_t *)layer->handle;
|
||||
char pixelformatstr[32] = "None";
|
||||
uint32_t transform = layer->transform & FINAL_TRANSFORM_MASK;
|
||||
|
||||
if (hnd)
|
||||
getHalPixelFormatStr(hnd->format, pixelformatstr);
|
||||
@ -737,13 +738,13 @@ void dumpLayer(int moduleCompositionType, int listFlags, size_t layerIndex,
|
||||
(layer->compositionType == HWC_OVERLAY)? "Overlay":
|
||||
(layer->compositionType == HWC_USE_COPYBIT)? "Copybit": "???",
|
||||
pixelformatstr,
|
||||
(layer->transform == Transform::ROT_0)? "ROT_0":
|
||||
(layer->transform == Transform::FLIP_H)? "FLIP_H":
|
||||
(layer->transform == Transform::FLIP_V)? "FLIP_V":
|
||||
(layer->transform == Transform::ROT_90)? "ROT_90":
|
||||
(layer->transform == Transform::ROT_180)? "ROT_180":
|
||||
(layer->transform == Transform::ROT_270)? "ROT_270":
|
||||
(layer->transform == Transform::ROT_INVALID)? "ROT_INVALID":"???",
|
||||
(transform == Transform::ROT_0)? "ROT_0":
|
||||
(transform == Transform::FLIP_H)? "FLIP_H":
|
||||
(transform == Transform::FLIP_V)? "FLIP_V":
|
||||
(transform == Transform::ROT_90)? "ROT_90":
|
||||
(transform == Transform::ROT_180)? "ROT_180":
|
||||
(transform == Transform::ROT_270)? "ROT_270":
|
||||
(transform == Transform::ROT_INVALID)? "ROT_INVALID":"???",
|
||||
(layer->flags == 0)? "[None]":"",
|
||||
(layer->flags & HWC_SKIP_LAYER)? "[Skip layer]":"",
|
||||
(layer->flags & HWC_LAYER_NOT_UPDATING)? "[Layer not updating]":"",
|
||||
|
@ -79,6 +79,13 @@ enum {
|
||||
LAYER_ASYNCHRONOUS = 1<<1,
|
||||
};
|
||||
|
||||
/*
|
||||
* Layer Transformation - refers to Layer::setGeometry()
|
||||
*/
|
||||
#define SHIFT_SRC_TRANSFORM 4
|
||||
#define SRC_TRANSFORM_MASK 0x00F0
|
||||
#define FINAL_TRANSFORM_MASK 0x000F
|
||||
|
||||
/*
|
||||
* Flags set by the layer and sent to HWC
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user