sdm: Default to C++11 standard and use clang toolchain
- Enable newer C++11 features to be used, including the updated standard library. - Enable better compiler diagnostics with clang. Change-Id: Ice550e866673ab57228ccb1f6f250e94a536e396
This commit is contained in:
committed by
Dileep Marchya
parent
32ffff042b
commit
b3b0a3305f
@@ -38,6 +38,7 @@
|
|||||||
#define UINT16(exp) static_cast<uint16_t>(exp)
|
#define UINT16(exp) static_cast<uint16_t>(exp)
|
||||||
#define UINT32(exp) static_cast<uint32_t>(exp)
|
#define UINT32(exp) static_cast<uint32_t>(exp)
|
||||||
#define INT32(exp) static_cast<int32_t>(exp)
|
#define INT32(exp) static_cast<int32_t>(exp)
|
||||||
|
#define UINT64(exp) static_cast<uint64_t>(exp)
|
||||||
|
|
||||||
#define STRUCT_VAR(struct_name, var_name) \
|
#define STRUCT_VAR(struct_name, var_name) \
|
||||||
struct struct_name var_name; \
|
struct struct_name var_name; \
|
||||||
|
|||||||
@@ -60,9 +60,9 @@ class Debug {
|
|||||||
debug_.debug_handler_ = debug_handler;
|
debug_.debug_handler_ = debug_handler;
|
||||||
}
|
}
|
||||||
static inline DebugHandler* Get() { return debug_.debug_handler_; }
|
static inline DebugHandler* Get() { return debug_.debug_handler_; }
|
||||||
static uint32_t GetSimulationFlag();
|
static int GetSimulationFlag();
|
||||||
static uint32_t GetHDMIResolution();
|
static int GetHDMIResolution();
|
||||||
static uint32_t GetIdleTimeoutMs();
|
static int GetIdleTimeoutMs();
|
||||||
static bool IsRotatorDownScaleDisabled();
|
static bool IsRotatorDownScaleDisabled();
|
||||||
static bool IsDecimationDisabled();
|
static bool IsDecimationDisabled();
|
||||||
static bool IsPartialUpdateEnabled();
|
static bool IsPartialUpdateEnabled();
|
||||||
@@ -83,7 +83,7 @@ class Debug {
|
|||||||
virtual void BeginTrace(const char */*class_name*/, const char */*function_name*/,
|
virtual void BeginTrace(const char */*class_name*/, const char */*function_name*/,
|
||||||
const char */*custom_string*/) { }
|
const char */*custom_string*/) { }
|
||||||
virtual void EndTrace() { }
|
virtual void EndTrace() { }
|
||||||
virtual DisplayError GetProperty(const char *property_name, int *value) {
|
virtual DisplayError GetProperty(const char */*property_name*/, int */*value*/) {
|
||||||
return kErrorNotSupported;
|
return kErrorNotSupported;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ LOCAL_MODULE_TAGS := optional
|
|||||||
LOCAL_C_INCLUDES := hardware/qcom/display/sdm/include/ \
|
LOCAL_C_INCLUDES := hardware/qcom/display/sdm/include/ \
|
||||||
$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
|
$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
|
||||||
LOCAL_CFLAGS := -Wno-missing-field-initializers -Wno-unused-parameter \
|
LOCAL_CFLAGS := -Wno-missing-field-initializers -Wno-unused-parameter \
|
||||||
-Wconversion -Wall -Werror \
|
-Wall -Werror -std=c++11 -fcolor-diagnostics\
|
||||||
-DLOG_TAG=\"SDM\"
|
-DLOG_TAG=\"SDM\"
|
||||||
|
LOCAL_CLANG := true
|
||||||
LOCAL_HW_INTF_PATH := fb
|
LOCAL_HW_INTF_PATH := fb
|
||||||
LOCAL_SHARED_LIBRARIES := libdl libsdmutils
|
LOCAL_SHARED_LIBRARIES := libdl libsdmutils
|
||||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
|
||||||
|
|||||||
@@ -561,7 +561,6 @@ bool DisplayBase::IsRotationRequired(HWLayers *hw_layers) {
|
|||||||
HWLayersInfo &layer_info = hw_layers->info;
|
HWLayersInfo &layer_info = hw_layers->info;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < layer_info.count; i++) {
|
for (uint32_t i = 0; i < layer_info.count; i++) {
|
||||||
Layer& layer = layer_info.stack->layers[layer_info.index[i]];
|
|
||||||
HWRotatorSession *hw_rotator_session = &hw_layers->config[i].hw_rotator_session;
|
HWRotatorSession *hw_rotator_session = &hw_layers->config[i].hw_rotator_session;
|
||||||
|
|
||||||
if (hw_rotator_session->hw_block_count) {
|
if (hw_rotator_session->hw_block_count) {
|
||||||
|
|||||||
@@ -247,8 +247,6 @@ DisplayError DisplayPrimary::IsScalingValid(const LayerRect &crop, const LayerRe
|
|||||||
DisplayError DisplayPrimary::SetRefreshRate(uint32_t refresh_rate) {
|
DisplayError DisplayPrimary::SetRefreshRate(uint32_t refresh_rate) {
|
||||||
SCOPE_LOCK(locker_);
|
SCOPE_LOCK(locker_);
|
||||||
|
|
||||||
DisplayError error = kErrorNone;
|
|
||||||
|
|
||||||
if (!hw_panel_info_.dynamic_fps) {
|
if (!hw_panel_info_.dynamic_fps) {
|
||||||
DLOGW("Dynamic fps feature is not supported");
|
DLOGW("Dynamic fps feature is not supported");
|
||||||
return kErrorNotSupported;
|
return kErrorNotSupported;
|
||||||
|
|||||||
@@ -215,7 +215,6 @@ DisplayError HWDevice::Validate(HWLayers *hw_layers) {
|
|||||||
HWPipeInfo *right_pipe = &hw_layers->config[i].right_pipe;
|
HWPipeInfo *right_pipe = &hw_layers->config[i].right_pipe;
|
||||||
HWRotatorSession *hw_rotator_session = &hw_layers->config[i].hw_rotator_session;
|
HWRotatorSession *hw_rotator_session = &hw_layers->config[i].hw_rotator_session;
|
||||||
bool is_rotator_used = (hw_rotator_session->hw_block_count != 0);
|
bool is_rotator_used = (hw_rotator_session->hw_block_count != 0);
|
||||||
mdp_input_layer mdp_layer;
|
|
||||||
|
|
||||||
for (uint32_t count = 0; count < 2; count++) {
|
for (uint32_t count = 0; count < 2; count++) {
|
||||||
HWPipeInfo *pipe_info = (count == 0) ? left_pipe : right_pipe;
|
HWPipeInfo *pipe_info = (count == 0) ? left_pipe : right_pipe;
|
||||||
@@ -728,7 +727,6 @@ void HWDevice::GetHWPanelInfoByNode(int device_node, HWPanelInfo *panel_info) {
|
|||||||
|
|
||||||
HWDisplayPort HWDevice::GetHWDisplayPort(int device_node) {
|
HWDisplayPort HWDevice::GetHWDisplayPort(int device_node) {
|
||||||
char stringbuffer[kMaxStringLength];
|
char stringbuffer[kMaxStringLength];
|
||||||
DisplayError error = kErrorNone;
|
|
||||||
char *line = NULL;
|
char *line = NULL;
|
||||||
size_t len = kMaxStringLength;
|
size_t len = kMaxStringLength;
|
||||||
ssize_t read;
|
ssize_t read;
|
||||||
@@ -767,7 +765,6 @@ HWDisplayPort HWDevice::GetHWDisplayPort(int device_node) {
|
|||||||
|
|
||||||
HWDisplayMode HWDevice::GetHWDisplayMode(int device_node) {
|
HWDisplayMode HWDevice::GetHWDisplayMode(int device_node) {
|
||||||
char stringbuffer[kMaxStringLength];
|
char stringbuffer[kMaxStringLength];
|
||||||
DisplayError error = kErrorNone;
|
|
||||||
char *line = NULL;
|
char *line = NULL;
|
||||||
size_t len = kMaxStringLength;
|
size_t len = kMaxStringLength;
|
||||||
ssize_t read;
|
ssize_t read;
|
||||||
|
|||||||
@@ -39,24 +39,6 @@
|
|||||||
|
|
||||||
namespace sdm {
|
namespace sdm {
|
||||||
|
|
||||||
static int ParseLine(char *input, char *tokens[], const uint32_t max_token, uint32_t *count) {
|
|
||||||
char *tmp_token = NULL;
|
|
||||||
char *temp_ptr;
|
|
||||||
uint32_t index = 0;
|
|
||||||
const char *delim = ", =\n";
|
|
||||||
if (!input) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
tmp_token = strtok_r(input, delim, &temp_ptr);
|
|
||||||
while (tmp_token && index < max_token) {
|
|
||||||
tokens[index++] = tmp_token;
|
|
||||||
tmp_token = strtok_r(NULL, delim, &temp_ptr);
|
|
||||||
}
|
|
||||||
*count = index;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool MapHDMIDisplayTiming(const msm_hdmi_mode_timing_info *mode,
|
static bool MapHDMIDisplayTiming(const msm_hdmi_mode_timing_info *mode,
|
||||||
fb_var_screeninfo *info) {
|
fb_var_screeninfo *info) {
|
||||||
if (!mode || !info) {
|
if (!mode || !info) {
|
||||||
@@ -245,8 +227,6 @@ DisplayError HWHDMI::GetDisplayAttributes(HWDisplayAttributes *display_attribute
|
|||||||
DisplayError HWHDMI::SetDisplayAttributes(uint32_t index) {
|
DisplayError HWHDMI::SetDisplayAttributes(uint32_t index) {
|
||||||
DTRACE_SCOPED();
|
DTRACE_SCOPED();
|
||||||
|
|
||||||
DisplayError error = kErrorNone;
|
|
||||||
|
|
||||||
// Variable screen info
|
// Variable screen info
|
||||||
STRUCT_VAR(fb_var_screeninfo, vscreeninfo);
|
STRUCT_VAR(fb_var_screeninfo, vscreeninfo);
|
||||||
if (ioctl_(device_fd_, FBIOGET_VSCREENINFO, &vscreeninfo) < 0) {
|
if (ioctl_(device_fd_, FBIOGET_VSCREENINFO, &vscreeninfo) < 0) {
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ DisplayError HWInfo::GetHWResourceInfo(HWResourceInfo *hw_resource) {
|
|||||||
// parse the line and update information accordingly
|
// parse the line and update information accordingly
|
||||||
if (!ParseLine(line, tokens, max_count, &token_count)) {
|
if (!ParseLine(line, tokens, max_count, &token_count)) {
|
||||||
if (!strncmp(tokens[0], "hw_rev", strlen("hw_rev"))) {
|
if (!strncmp(tokens[0], "hw_rev", strlen("hw_rev"))) {
|
||||||
hw_resource->hw_revision = atoi(tokens[1]); // HW Rev, v1/v2
|
hw_resource->hw_revision = UINT32(atoi(tokens[1])); // HW Rev, v1/v2
|
||||||
} else if (!strncmp(tokens[0], "rgb_pipes", strlen("rgb_pipes"))) {
|
} else if (!strncmp(tokens[0], "rgb_pipes", strlen("rgb_pipes"))) {
|
||||||
hw_resource->num_rgb_pipe = UINT8(atoi(tokens[1]));
|
hw_resource->num_rgb_pipe = UINT8(atoi(tokens[1]));
|
||||||
} else if (!strncmp(tokens[0], "vig_pipes", strlen("vig_pipes"))) {
|
} else if (!strncmp(tokens[0], "vig_pipes", strlen("vig_pipes"))) {
|
||||||
@@ -115,33 +115,33 @@ DisplayError HWInfo::GetHWResourceInfo(HWResourceInfo *hw_resource) {
|
|||||||
} else if (!strncmp(tokens[0], "blending_stages", strlen("blending_stages"))) {
|
} else if (!strncmp(tokens[0], "blending_stages", strlen("blending_stages"))) {
|
||||||
hw_resource->num_blending_stages = UINT8(atoi(tokens[1]));
|
hw_resource->num_blending_stages = UINT8(atoi(tokens[1]));
|
||||||
} else if (!strncmp(tokens[0], "max_downscale_ratio", strlen("max_downscale_ratio"))) {
|
} else if (!strncmp(tokens[0], "max_downscale_ratio", strlen("max_downscale_ratio"))) {
|
||||||
hw_resource->max_scale_down = atoi(tokens[1]);
|
hw_resource->max_scale_down = UINT32(atoi(tokens[1]));
|
||||||
} else if (!strncmp(tokens[0], "max_upscale_ratio", strlen("max_upscale_ratio"))) {
|
} else if (!strncmp(tokens[0], "max_upscale_ratio", strlen("max_upscale_ratio"))) {
|
||||||
hw_resource->max_scale_up = atoi(tokens[1]);
|
hw_resource->max_scale_up = UINT32(atoi(tokens[1]));
|
||||||
} else if (!strncmp(tokens[0], "max_bandwidth_low", strlen("max_bandwidth_low"))) {
|
} else if (!strncmp(tokens[0], "max_bandwidth_low", strlen("max_bandwidth_low"))) {
|
||||||
hw_resource->max_bandwidth_low = atol(tokens[1]);
|
hw_resource->max_bandwidth_low = UINT64(atol(tokens[1]));
|
||||||
} else if (!strncmp(tokens[0], "max_bandwidth_high", strlen("max_bandwidth_high"))) {
|
} else if (!strncmp(tokens[0], "max_bandwidth_high", strlen("max_bandwidth_high"))) {
|
||||||
hw_resource->max_bandwidth_high = atol(tokens[1]);
|
hw_resource->max_bandwidth_high = UINT64(atol(tokens[1]));
|
||||||
} else if (!strncmp(tokens[0], "max_mixer_width", strlen("max_mixer_width"))) {
|
} else if (!strncmp(tokens[0], "max_mixer_width", strlen("max_mixer_width"))) {
|
||||||
hw_resource->max_mixer_width = atoi(tokens[1]);
|
hw_resource->max_mixer_width = UINT32(atoi(tokens[1]));
|
||||||
} else if (!strncmp(tokens[0], "max_pipe_width", strlen("max_pipe_width"))) {
|
} else if (!strncmp(tokens[0], "max_pipe_width", strlen("max_pipe_width"))) {
|
||||||
hw_resource->max_pipe_width = atoi(tokens[1]);
|
hw_resource->max_pipe_width = UINT32(atoi(tokens[1]));
|
||||||
} else if (!strncmp(tokens[0], "max_pipe_bw", strlen("max_pipe_bw"))) {
|
} else if (!strncmp(tokens[0], "max_pipe_bw", strlen("max_pipe_bw"))) {
|
||||||
hw_resource->max_pipe_bw = atoi(tokens[1]);
|
hw_resource->max_pipe_bw = UINT32(atoi(tokens[1]));
|
||||||
} else if (!strncmp(tokens[0], "max_mdp_clk", strlen("max_mdp_clk"))) {
|
} else if (!strncmp(tokens[0], "max_mdp_clk", strlen("max_mdp_clk"))) {
|
||||||
hw_resource->max_sde_clk = atoi(tokens[1]);
|
hw_resource->max_sde_clk = UINT32(atoi(tokens[1]));
|
||||||
} else if (!strncmp(tokens[0], "clk_fudge_factor", strlen("clk_fudge_factor"))) {
|
} else if (!strncmp(tokens[0], "clk_fudge_factor", strlen("clk_fudge_factor"))) {
|
||||||
hw_resource->clk_fudge_factor = FLOAT(atoi(tokens[1])) / FLOAT(atoi(tokens[2]));
|
hw_resource->clk_fudge_factor = FLOAT(atoi(tokens[1])) / FLOAT(atoi(tokens[2]));
|
||||||
} else if (!strncmp(tokens[0], "fmt_mt_nv12_factor", strlen("fmt_mt_nv12_factor"))) {
|
} else if (!strncmp(tokens[0], "fmt_mt_nv12_factor", strlen("fmt_mt_nv12_factor"))) {
|
||||||
hw_resource->macrotile_nv12_factor = atoi(tokens[1]);
|
hw_resource->macrotile_nv12_factor = UINT32(atoi(tokens[1]));
|
||||||
} else if (!strncmp(tokens[0], "fmt_mt_factor", strlen("fmt_mt_factor"))) {
|
} else if (!strncmp(tokens[0], "fmt_mt_factor", strlen("fmt_mt_factor"))) {
|
||||||
hw_resource->macrotile_factor = atoi(tokens[1]);
|
hw_resource->macrotile_factor = UINT32(atoi(tokens[1]));
|
||||||
} else if (!strncmp(tokens[0], "fmt_linear_factor", strlen("fmt_linear_factor"))) {
|
} else if (!strncmp(tokens[0], "fmt_linear_factor", strlen("fmt_linear_factor"))) {
|
||||||
hw_resource->linear_factor = atoi(tokens[1]);
|
hw_resource->linear_factor = UINT32(atoi(tokens[1]));
|
||||||
} else if (!strncmp(tokens[0], "scale_factor", strlen("scale_factor"))) {
|
} else if (!strncmp(tokens[0], "scale_factor", strlen("scale_factor"))) {
|
||||||
hw_resource->scale_factor = atoi(tokens[1]);
|
hw_resource->scale_factor = UINT32(atoi(tokens[1]));
|
||||||
} else if (!strncmp(tokens[0], "xtra_ff_factor", strlen("xtra_ff_factor"))) {
|
} else if (!strncmp(tokens[0], "xtra_ff_factor", strlen("xtra_ff_factor"))) {
|
||||||
hw_resource->extra_fudge_factor = atoi(tokens[1]);
|
hw_resource->extra_fudge_factor = UINT32(atoi(tokens[1]));
|
||||||
} else if (!strncmp(tokens[0], "features", strlen("features"))) {
|
} else if (!strncmp(tokens[0], "features", strlen("features"))) {
|
||||||
for (uint32_t i = 0; i < token_count; i++) {
|
for (uint32_t i = 0; i < token_count; i++) {
|
||||||
if (!strncmp(tokens[i], "bwc", strlen("bwc"))) {
|
if (!strncmp(tokens[i], "bwc", strlen("bwc"))) {
|
||||||
@@ -172,9 +172,9 @@ DisplayError HWInfo::GetHWResourceInfo(HWResourceInfo *hw_resource) {
|
|||||||
hw_resource->has_decimation, hw_resource->has_macrotile,
|
hw_resource->has_decimation, hw_resource->has_macrotile,
|
||||||
hw_resource->has_rotator_downscale);
|
hw_resource->has_rotator_downscale);
|
||||||
DLOGI("SourceSplit = %d", hw_resource->is_src_split);
|
DLOGI("SourceSplit = %d", hw_resource->is_src_split);
|
||||||
DLOGI("MaxLowBw = %"PRIu64", MaxHighBw = %"PRIu64"", hw_resource->max_bandwidth_low,
|
DLOGI("MaxLowBw = %" PRIu64 " , MaxHighBw = % " PRIu64 "", hw_resource->max_bandwidth_low,
|
||||||
hw_resource->max_bandwidth_high);
|
hw_resource->max_bandwidth_high);
|
||||||
DLOGI("MaxPipeBw = %"PRIu64" KBps, MaxSDEClock = %"PRIu64" Hz, ClockFudgeFactor = %f",
|
DLOGI("MaxPipeBw = %" PRIu64 " KBps, MaxSDEClock = % " PRIu64 " Hz, ClockFudgeFactor = %f",
|
||||||
hw_resource->max_pipe_bw, hw_resource->max_sde_clk, hw_resource->clk_fudge_factor);
|
hw_resource->max_pipe_bw, hw_resource->max_sde_clk, hw_resource->clk_fudge_factor);
|
||||||
DLOGI("Prefill factors: Tiled_NV12 = %d, Tiled = %d, Linear = %d, Scale = %d, Fudge_factor = %d",
|
DLOGI("Prefill factors: Tiled_NV12 = %d, Tiled = %d, Linear = %d, Scale = %d, Fudge_factor = %d",
|
||||||
hw_resource->macrotile_nv12_factor, hw_resource->macrotile_factor,
|
hw_resource->macrotile_nv12_factor, hw_resource->macrotile_factor,
|
||||||
|
|||||||
@@ -471,7 +471,6 @@ DisplayError HWPrimary::SetVSyncState(bool enable) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DisplayError HWPrimary::SetDisplayMode(const HWDisplayMode hw_display_mode) {
|
DisplayError HWPrimary::SetDisplayMode(const HWDisplayMode hw_display_mode) {
|
||||||
DisplayError error = kErrorNone;
|
|
||||||
uint32_t mode = -1;
|
uint32_t mode = -1;
|
||||||
|
|
||||||
switch (hw_display_mode) {
|
switch (hw_display_mode) {
|
||||||
|
|||||||
@@ -295,7 +295,6 @@ DisplayError ResourceDefault::PostCommit(Handle display_ctx, HWLayers *hw_layers
|
|||||||
reinterpret_cast<DisplayResourceContext *>(display_ctx);
|
reinterpret_cast<DisplayResourceContext *>(display_ctx);
|
||||||
HWBlockType hw_block_id = display_resource_ctx->hw_block_id;
|
HWBlockType hw_block_id = display_resource_ctx->hw_block_id;
|
||||||
uint64_t frame_count = display_resource_ctx->frame_count;
|
uint64_t frame_count = display_resource_ctx->frame_count;
|
||||||
DisplayError error = kErrorNone;
|
|
||||||
|
|
||||||
DLOGV_IF(kTagResources, "Resource for hw_block = %d, frame_count = %d", hw_block_id, frame_count);
|
DLOGV_IF(kTagResources, "Resource for hw_block = %d, frame_count = %d", hw_block_id, frame_count);
|
||||||
|
|
||||||
@@ -457,8 +456,6 @@ DisplayError ResourceDefault::SrcSplitConfig(DisplayResourceContext *display_res
|
|||||||
HWPipeInfo *right_pipe = &layer_config->right_pipe;
|
HWPipeInfo *right_pipe = &layer_config->right_pipe;
|
||||||
float src_width = src_rect.right - src_rect.left;
|
float src_width = src_rect.right - src_rect.left;
|
||||||
float dst_width = dst_rect.right - dst_rect.left;
|
float dst_width = dst_rect.right - dst_rect.left;
|
||||||
float src_height = src_rect.bottom - src_rect.top;
|
|
||||||
float dst_height = dst_rect.bottom - dst_rect.top;
|
|
||||||
float left_mixer_width = FLOAT(display_attributes.split_left);
|
float left_mixer_width = FLOAT(display_attributes.split_left);
|
||||||
|
|
||||||
// Layer cannot qualify for SrcSplit if source or destination width exceeds max pipe width.
|
// Layer cannot qualify for SrcSplit if source or destination width exceeds max pipe width.
|
||||||
@@ -533,11 +530,8 @@ DisplayError ResourceDefault::DisplaySplitConfig(DisplayResourceContext *display
|
|||||||
|
|
||||||
DisplayError ResourceDefault::Config(DisplayResourceContext *display_resource_ctx,
|
DisplayError ResourceDefault::Config(DisplayResourceContext *display_resource_ctx,
|
||||||
HWLayers *hw_layers) {
|
HWLayers *hw_layers) {
|
||||||
HWDisplayAttributes &display_attributes = display_resource_ctx->display_attributes;
|
|
||||||
HWLayersInfo &layer_info = hw_layers->info;
|
HWLayersInfo &layer_info = hw_layers->info;
|
||||||
DisplayError error = kErrorNone;
|
DisplayError error = kErrorNone;
|
||||||
uint32_t z_order = 0;
|
|
||||||
|
|
||||||
Layer& layer = layer_info.stack->layers[layer_info.index[0]];
|
Layer& layer = layer_info.stack->layers[layer_info.index[0]];
|
||||||
|
|
||||||
error = ValidateLayerDimensions(layer);
|
error = ValidateLayerDimensions(layer);
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ LOCAL_C_INCLUDES := hardware/qcom/display/sdm/include/ \
|
|||||||
hardware/qcom/display/libcopybit/
|
hardware/qcom/display/libcopybit/
|
||||||
|
|
||||||
LOCAL_CFLAGS := -Wno-missing-field-initializers -Wno-unused-parameter \
|
LOCAL_CFLAGS := -Wno-missing-field-initializers -Wno-unused-parameter \
|
||||||
-Wconversion -Wall -Werror \
|
-Wall -Werror -std=c++11 -fcolor-diagnostics\
|
||||||
-DLOG_TAG=\"SDM\"
|
-DLOG_TAG=\"SDM\"
|
||||||
|
LOCAL_CLANG := true
|
||||||
|
|
||||||
# TODO: Move this to the common makefile
|
# TODO: Move this to the common makefile
|
||||||
ifeq ($(call is-board-platform-in-list, $(MASTER_SIDE_CP_TARGET_LIST)), true)
|
ifeq ($(call is-board-platform-in-list, $(MASTER_SIDE_CP_TARGET_LIST)), true)
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ DisplayError HWCBufferAllocator::AllocateBuffer(BufferInfo *buffer_info) {
|
|||||||
return kErrorMemory;
|
return kErrorMemory;
|
||||||
}
|
}
|
||||||
|
|
||||||
int alloc_flags = GRALLOC_USAGE_PRIVATE_IOMMU_HEAP;
|
int alloc_flags = INT(GRALLOC_USAGE_PRIVATE_IOMMU_HEAP);
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
int width = INT(buffer_config.width);
|
int width = INT(buffer_config.width);
|
||||||
@@ -64,8 +64,8 @@ DisplayError HWCBufferAllocator::AllocateBuffer(BufferInfo *buffer_info) {
|
|||||||
int format;
|
int format;
|
||||||
|
|
||||||
if (buffer_config.secure) {
|
if (buffer_config.secure) {
|
||||||
alloc_flags = GRALLOC_USAGE_PRIVATE_MM_HEAP;
|
alloc_flags = INT(GRALLOC_USAGE_PRIVATE_MM_HEAP);
|
||||||
alloc_flags |= GRALLOC_USAGE_PROTECTED;
|
alloc_flags |= INT(GRALLOC_USAGE_PROTECTED);
|
||||||
data.align = SECURE_ALIGN;
|
data.align = SECURE_ALIGN;
|
||||||
} else {
|
} else {
|
||||||
data.align = getpagesize();
|
data.align = getpagesize();
|
||||||
|
|||||||
@@ -475,10 +475,8 @@ int HWCDisplay::PrepareLayerStack(hwc_display_contents_1_t *content_list) {
|
|||||||
// Configure each layer
|
// Configure each layer
|
||||||
for (size_t i = 0; i < num_hw_layers; i++) {
|
for (size_t i = 0; i < num_hw_layers; i++) {
|
||||||
hwc_layer_1_t &hwc_layer = content_list->hwLayers[i];
|
hwc_layer_1_t &hwc_layer = content_list->hwLayers[i];
|
||||||
const private_handle_t *pvt_handle = static_cast<const private_handle_t *>(hwc_layer.handle);
|
|
||||||
|
|
||||||
Layer &layer = layer_stack_.layers[i];
|
Layer &layer = layer_stack_.layers[i];
|
||||||
LayerBuffer *layer_buffer = layer.input_buffer;
|
|
||||||
|
|
||||||
ret = PrepareLayerParams(&content_list->hwLayers[i], &layer_stack_.layers[i],
|
ret = PrepareLayerParams(&content_list->hwLayers[i], &layer_stack_.layers[i],
|
||||||
active_config.fps);
|
active_config.fps);
|
||||||
@@ -1114,7 +1112,7 @@ uint32_t HWCDisplay::RoundToStandardFPS(uint32_t fps) {
|
|||||||
|
|
||||||
int count = INT(sizeof(standard_fps) / sizeof(standard_fps[0]));
|
int count = INT(sizeof(standard_fps) / sizeof(standard_fps[0]));
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
if (abs(standard_fps[i] - fps) < 2) {
|
if ((standard_fps[i] - fps) < 2) {
|
||||||
// Most likely used for video, the fps can fluctuate
|
// Most likely used for video, the fps can fluctuate
|
||||||
// Ex: b/w 29 and 30 for 30 fps clip
|
// Ex: b/w 29 and 30 for 30 fps clip
|
||||||
return standard_fps[i];
|
return standard_fps[i];
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ int HWCDisplayExternal::Create(CoreInterface *core_intf, hwc_procs_t const **hwc
|
|||||||
HWCDisplay **hwc_display) {
|
HWCDisplay **hwc_display) {
|
||||||
uint32_t external_width = 0;
|
uint32_t external_width = 0;
|
||||||
uint32_t external_height = 0;
|
uint32_t external_height = 0;
|
||||||
char property[PROPERTY_VALUE_MAX];
|
|
||||||
|
|
||||||
HWCDisplay *hwc_display_external = new HWCDisplayExternal(core_intf, hwc_procs);
|
HWCDisplay *hwc_display_external = new HWCDisplayExternal(core_intf, hwc_procs);
|
||||||
int status = hwc_display_external->Init();
|
int status = hwc_display_external->Init();
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ int HWCDisplayPrimary::Create(CoreInterface *core_intf, hwc_procs_t const **hwc_
|
|||||||
int status = 0;
|
int status = 0;
|
||||||
uint32_t primary_width = 0;
|
uint32_t primary_width = 0;
|
||||||
uint32_t primary_height = 0;
|
uint32_t primary_height = 0;
|
||||||
char property[PROPERTY_VALUE_MAX];
|
|
||||||
|
|
||||||
HWCDisplay *hwc_display_primary = new HWCDisplayPrimary(core_intf, hwc_procs);
|
HWCDisplay *hwc_display_primary = new HWCDisplayPrimary(core_intf, hwc_procs);
|
||||||
status = hwc_display_primary->Init();
|
status = hwc_display_primary->Init();
|
||||||
@@ -140,7 +139,7 @@ int HWCDisplayPrimary::Commit(hwc_display_contents_1_t *content_list) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int HWCDisplayPrimary::SetActiveConfig(uint32_t index) {
|
int HWCDisplayPrimary::SetActiveConfig(int index) {
|
||||||
DisplayError error = kErrorNone;
|
DisplayError error = kErrorNone;
|
||||||
|
|
||||||
if (display_intf_) {
|
if (display_intf_) {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class HWCDisplayPrimary : public HWCDisplay {
|
|||||||
static void Destroy(HWCDisplay *hwc_display);
|
static void Destroy(HWCDisplay *hwc_display);
|
||||||
virtual int Prepare(hwc_display_contents_1_t *content_list);
|
virtual int Prepare(hwc_display_contents_1_t *content_list);
|
||||||
virtual int Commit(hwc_display_contents_1_t *content_list);
|
virtual int Commit(hwc_display_contents_1_t *content_list);
|
||||||
virtual int SetActiveConfig(uint32_t index);
|
virtual int SetActiveConfig(int index);
|
||||||
virtual int SetRefreshRate(uint32_t refresh_rate);
|
virtual int SetRefreshRate(uint32_t refresh_rate);
|
||||||
virtual int Perform(uint32_t operation, ...);
|
virtual int Perform(uint32_t operation, ...);
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ HWCDisplayVirtual::HWCDisplayVirtual(CoreInterface *core_intf, hwc_procs_t const
|
|||||||
}
|
}
|
||||||
|
|
||||||
int HWCDisplayVirtual::Init() {
|
int HWCDisplayVirtual::Init() {
|
||||||
int status = 0;
|
|
||||||
|
|
||||||
output_buffer_ = new LayerBuffer();
|
output_buffer_ = new LayerBuffer();
|
||||||
if (!output_buffer_) {
|
if (!output_buffer_) {
|
||||||
|
|||||||
@@ -57,16 +57,16 @@
|
|||||||
static sdm::HWCSession::HWCModuleMethods g_hwc_module_methods;
|
static sdm::HWCSession::HWCModuleMethods g_hwc_module_methods;
|
||||||
|
|
||||||
hwc_module_t HAL_MODULE_INFO_SYM = {
|
hwc_module_t HAL_MODULE_INFO_SYM = {
|
||||||
common: {
|
.common = {
|
||||||
tag: HARDWARE_MODULE_TAG,
|
.tag = HARDWARE_MODULE_TAG,
|
||||||
version_major: 2,
|
.version_major = 2,
|
||||||
version_minor: 0,
|
.version_minor = 0,
|
||||||
id: HWC_HARDWARE_MODULE_ID,
|
.id = HWC_HARDWARE_MODULE_ID,
|
||||||
name: "QTI Hardware Composer Module",
|
.name = "QTI Hardware Composer Module",
|
||||||
author: "CodeAurora Forum",
|
.author = "CodeAurora Forum",
|
||||||
methods: &g_hwc_module_methods,
|
.methods = &g_hwc_module_methods,
|
||||||
dso: 0,
|
.dso = 0,
|
||||||
reserved: {0},
|
.reserved = {0},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ int HWCSession::Init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pthread_create(&uevent_thread_, NULL, &HWCUeventThread, this) < 0) {
|
if (pthread_create(&uevent_thread_, NULL, &HWCUeventThread, this) < 0) {
|
||||||
DLOGE("Failed to start = %s, error = %s", uevent_thread_name_);
|
DLOGE("Failed to start = %s, error = %s", uevent_thread_name_, strerror(errno));
|
||||||
HWCDisplayPrimary::Destroy(hwc_display_[HWC_DISPLAY_PRIMARY]);
|
HWCDisplayPrimary::Destroy(hwc_display_[HWC_DISPLAY_PRIMARY]);
|
||||||
hwc_display_[HWC_DISPLAY_PRIMARY] = 0;
|
hwc_display_[HWC_DISPLAY_PRIMARY] = 0;
|
||||||
CoreInterface::DestroyCore();
|
CoreInterface::DestroyCore();
|
||||||
@@ -227,7 +227,7 @@ int HWCSession::Prepare(hwc_composer_device_1 *device, size_t num_displays,
|
|||||||
hwc_session->ResetPanel();
|
hwc_session->ResetPanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ssize_t dpy = (num_displays - 1); dpy >= 0; dpy--) {
|
for (ssize_t dpy = static_cast<ssize_t>(num_displays - 1); dpy >= 0; dpy--) {
|
||||||
hwc_display_contents_1_t *content_list = displays[dpy];
|
hwc_display_contents_1_t *content_list = displays[dpy];
|
||||||
if (dpy == HWC_DISPLAY_VIRTUAL) {
|
if (dpy == HWC_DISPLAY_VIRTUAL) {
|
||||||
if (hwc_session->hwc_display_[HWC_DISPLAY_EXTERNAL]) {
|
if (hwc_session->hwc_display_[HWC_DISPLAY_EXTERNAL]) {
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ include $(CLEAR_VARS)
|
|||||||
LOCAL_MODULE := libsdmutils
|
LOCAL_MODULE := libsdmutils
|
||||||
LOCAL_MODULE_TAGS := optional
|
LOCAL_MODULE_TAGS := optional
|
||||||
LOCAL_C_INCLUDES := hardware/qcom/display/sdm/include/
|
LOCAL_C_INCLUDES := hardware/qcom/display/sdm/include/
|
||||||
LOCAL_CFLAGS := -Wno-missing-field-initializers -Wno-unused-parameter \
|
LOCAL_CFLAGS := -Wno-missing-field-initializers \
|
||||||
-Wconversion -Wall -Werror \
|
-Wall -Werror -std=c++11 -fcolor-diagnostics\
|
||||||
-DLOG_TAG=\"SDM\"
|
-DLOG_TAG=\"SDM\"
|
||||||
|
LOCAL_CLANG := true
|
||||||
LOCAL_SRC_FILES := debug.cpp rect.cpp
|
LOCAL_SRC_FILES := debug.cpp rect.cpp
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|||||||
@@ -38,21 +38,21 @@ Debug Debug::debug_;
|
|||||||
Debug::Debug() : debug_handler_(&default_debug_handler_) {
|
Debug::Debug() : debug_handler_(&default_debug_handler_) {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Debug::GetSimulationFlag() {
|
int Debug::GetSimulationFlag() {
|
||||||
int value = 0;
|
int value = 0;
|
||||||
debug_.debug_handler_->GetProperty("sdm.composition_simulation", &value);
|
debug_.debug_handler_->GetProperty("sdm.composition_simulation", &value);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Debug::GetHDMIResolution() {
|
int Debug::GetHDMIResolution() {
|
||||||
int value = 0;
|
int value = 0;
|
||||||
debug_.debug_handler_->GetProperty("hw.hdmi.resolution", &value);
|
debug_.debug_handler_->GetProperty("hw.hdmi.resolution", &value);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Debug::GetIdleTimeoutMs() {
|
int Debug::GetIdleTimeoutMs() {
|
||||||
int value = IDLE_TIMEOUT_DEFAULT_MS;
|
int value = IDLE_TIMEOUT_DEFAULT_MS;
|
||||||
debug_.debug_handler_->GetProperty("sdm.idle_time", &value);
|
debug_.debug_handler_->GetProperty("sdm.idle_time", &value);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user