sdm: LLVM SA enablement

CRs-Fixed: 2077191
Change-Id: I23066befa5034523788a78edac9b335494d43019
This commit is contained in:
Ramakant Singh
2017-07-14 13:52:15 +05:30
committed by Gerrit - the friendly Code Review server
parent 78b2086266
commit 80a15d7484
9 changed files with 32 additions and 12 deletions

View File

@@ -36,6 +36,10 @@ ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
common_flags += -DUSER_DEBUG
endif
ifeq ($(LLVM_SA), true)
common_flags += --compile-and-analyze --analyzer-perf --analyzer-Werror
endif
common_includes := system/core/base/include
CHECK_VERSION_LE = $(shell if [ $(1) -le $(2) ] ; then echo true ; else echo false ; fi)
PLATFORM_SDK_NOUGAT = 25

View File

@@ -9,4 +9,8 @@ LOCAL_SRC_FILES := DisplayConfig.cpp
LOCAL_SHARED_LIBRARIES := libhidlbase libhidltransport libutils \
vendor.display.config@1.0 android.hidl.base@1.0
ifeq ($(LLVM_SA), true)
LOCAL_CFLAGS += --compile-and-analyze --analyzer-perf --analyzer-Werror
endif
include $(BUILD_SHARED_LIBRARY)

View File

@@ -24,6 +24,9 @@ LOCAL_SRC_FILES := lights.c lights_prv.cpp
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SHARED_LIBRARIES := liblog libcutils libsdm-disp-vndapis
LOCAL_CFLAGS := -DLOG_TAG=\"qdlights\"
ifeq ($(LLVM_SA), true)
LOCAL_CFLAGS += --compile-and-analyze --analyzer-perf --analyzer-Werror
endif
LOCAL_CLANG := true
LOCAL_MODULE := lights.$(TARGET_BOARD_PLATFORM)
LOCAL_MODULE_TAGS := optional

View File

@@ -264,10 +264,12 @@ int getDPTestConfig(uint32_t *panelBpp, uint32_t *patternType) {
while (getline(&line, &len, configFile) != -1) {
if (!parseLine(line, tokens, maxCount, &tokenCount)) {
if (!strncmp(tokens[0], "bpp", strlen("bpp"))) {
if (tokens[0] != NULL) {
if (!strncmp(tokens[0], "bpp", strlen("bpp"))) {
*panelBpp = static_cast<uint32_t>(atoi(tokens[1]));
} else if (!strncmp(tokens[0], "pattern", strlen("pattern"))) {
} else if (!strncmp(tokens[0], "pattern", strlen("pattern"))) {
*patternType = static_cast<uint32_t>(atoi(tokens[1]));
}
}
}
}

View File

@@ -619,14 +619,15 @@ void DisplayBase::AppendDump(char *buffer, uint32_t length) {
HWRotateInfo &rotate = hw_rotator_session.hw_rotate_info[count];
LayerRect &src_roi = rotate.src_roi;
LayerRect &dst_roi = rotate.dst_roi;
const char *rotate_split[2] = { "Rot-1", "Rot-2" };
char rot[8] = { 0 };
int pipe_id = 0;
if (hw_rotator_session.mode == kRotatorOffline) {
snprintf(writeback_id, sizeof(writeback_id), "%d", rotate.writeback_id);
pipe_id = rotate.pipe_id;
}
DumpImpl::AppendString(buffer, length, format, idx, comp_type, rotate_split[count],
snprintf(rot, sizeof(rot), "Rot-%d", count + 1);
DumpImpl::AppendString(buffer, length, format, idx, comp_type, rot,
writeback_id, pipe_id, input_buffer->width,
input_buffer->height, buffer_format, INT(src_roi.left),
INT(src_roi.top), INT(src_roi.right), INT(src_roi.bottom),

View File

@@ -861,7 +861,7 @@ DisplayError HWColorManagerDrm::GetDrmGamut(const PPFeatureInfo &in_data,
break;
default:
DLOGE("Invalid gamut mode %d", sde_gamut->mode);
free(mdp_gamut);
delete mdp_gamut;
return kErrorParameters;
}

View File

@@ -813,9 +813,11 @@ void HWDevice::GetHWPanelNameByNode(int device_node, HWPanelInfo *panel_info) {
const uint32_t max_count = 10;
char *tokens[max_count] = { NULL };
if (!ParseLine(line.c_str(), "=\n", tokens, max_count, &token_count)) {
if (!strncmp(tokens[0], "panel_name", strlen("panel_name"))) {
snprintf(panel_info->panel_name, sizeof(panel_info->panel_name), "%s", tokens[1]);
break;
if (tokens[0] != NULL) {
if (!strncmp(tokens[0], "panel_name", strlen("panel_name"))) {
snprintf(panel_info->panel_name, sizeof(panel_info->panel_name), "%s", tokens[1]);
break;
}
}
}
}

View File

@@ -411,10 +411,12 @@ DisplayError HWInfo::GetV4L2RotatorInfo(HWResourceInfo *hw_resource) {
string caps;
while (Sys::getline_(caps_fs, caps)) {
if (!ParseString(caps.c_str(), tokens, max_count, ":, =\n", &token_count)) {
if (!strncmp(tokens[0], "downscale_compression", strlen("downscale_compression"))) {
hw_resource->hw_rot_info.downscale_compression = UINT8(atoi(tokens[1]));
} else if (!strncmp(tokens[0], "min_downscale", strlen("min_downscale"))) {
hw_resource->hw_rot_info.min_downscale = FLOAT(atof(tokens[1]));
if (tokens[0] != NULL) {
if (!strncmp(tokens[0], "downscale_compression", strlen("downscale_compression"))) {
hw_resource->hw_rot_info.downscale_compression = UINT8(atoi(tokens[1]));
} else if (!strncmp(tokens[0], "min_downscale", strlen("min_downscale"))) {
hw_resource->hw_rot_info.min_downscale = FLOAT(atof(tokens[1]));
}
}
}
}

View File

@@ -271,6 +271,8 @@ int HWCSession::Open(const hw_module_t *module, const char *name, hw_device_t **
int status = hwc_session->Init();
if (status != 0) {
delete hwc_session;
hwc_session = NULL;
return status;
}