libqcomui: convert *FormatInHW to a switch and ifdef it

caf removed this hack when the mdp driver was updated
for the YAMATO format. We dont have that yet so keep it around
but make it optional.
depends on BOARD_ADRENO_DECIDE_TEXTURE_TARGET
enable with BOARD_ADRENO_AVOID_EXTERNAL_TEXTURE:= true

Change-Id: I99b9a60d76d4515682db9717e3cb68bc17aff800
This commit is contained in:
Andrew Sutherland 2012-06-04 21:18:29 -05:00
parent 9af084283a
commit 7493d7c6cc
3 changed files with 28 additions and 26 deletions

View File

@ -6,16 +6,6 @@ LOCAL_SRC_FILES := \
utils/profiler.cpp \
utils/IdleTimer.cpp
LOCAL_CFLAGS := -DLOG_TAG=\"libQcomUI\"
ifeq ($(TARGET_BOARD_PLATFORM),qsd8k) # these are originally for 7x27a
LOCAL_CFLAGS += -DCHECK_FOR_EXTERNAL_FORMAT
endif
ifeq ($(BOARD_ADRENO_DECIDE_TEXTURE_TARGET),true)
LOCAL_CFLAGS += -DDECIDE_TEXTURE_TARGET
endif
LOCAL_SHARED_LIBRARIES := \
libutils \
libcutils \
@ -29,7 +19,17 @@ LOCAL_C_INCLUDES := $(TOP)/hardware/qcom/display/libgralloc \
$(TOP)/external/skia/include/core \
$(TOP)/external/skia/include/images
LOCAL_CFLAGS := -DLOG_TAG=\"libQcomUI\"
LOCAL_CFLAGS += -DDEBUG_CALC_FPS
# Hacks for broken mdp versions
ifeq ($(BOARD_ADRENO_DECIDE_TEXTURE_TARGET),true)
LOCAL_CFLAGS += -DDECIDE_TEXTURE_TARGET
ifeq ($(BOARD_ADRENO_AVOID_EXTERNAL_TEXTURE),true)
LOCAL_CFLAGS += -DCHECK_FOR_EXTERNAL_FORMAT
endif
endif
LOCAL_MODULE := libQcomUI
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)

View File

@ -190,25 +190,25 @@ int decideTextureTarget(int pixel_format)
*
* @return true if the format is supported by the GPU.
*/
bool isGPUSupportedFormatInHW(int format) {
// For 7x27A bypass creating EGL image for formats not natively supported
// in GPU.
// This is done to save CPU utilization by SurfaceFlinger thread
#ifdef CHECK_FOR_EXTERNAL_FORMAT
if (format == HAL_PIXEL_FORMAT_YV12){
return false;
} else if (format == HAL_PIXEL_FORMAT_YCrCb_420_SP) {
return false;
} else if (format == HAL_PIXEL_FORMAT_YCbCr_420_SP) {
return false;
} else if (format == HAL_PIXEL_FORMAT_NV12_ENCODEABLE) {
return false;
bool isGPUSupportedFormatInHW(int format) {
// For 7x27A bypass creating EGL image for formats not natively supported in GPU.
// This is done to save CPU utilization by SurfaceFlinger thread
bool retVal = true;
switch(format) {
case HAL_PIXEL_FORMAT_YV12:
case HAL_PIXEL_FORMAT_YCrCb_420_SP:
case HAL_PIXEL_FORMAT_YCbCr_420_SP:
case HAL_PIXEL_FORMAT_NV12_ENCODEABLE:
retVal = false;
break;
default:
retVal = true;
break;
}
#endif
return true;
return retVal;
}
#endif
/*

View File

@ -211,7 +211,9 @@ bool isGPUSupportedFormat(int format);
*
* @return true if the format is supported by the GPU.
*/
#ifdef CHECK_FOR_EXTERNAL_FORMAT
bool isGPUSupportedFormatInHW(int format);
#endif
/*
* Adreno is not optimized for GL_TEXTURE_EXTERNAL_OES