diff options
author | Xin Li <delphij@google.com> | 2020-08-27 10:16:43 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2020-08-27 10:16:43 -0700 |
commit | 5166e282945972a9e670bb248efd45cf36cec65b (patch) | |
tree | 024b11fc20d73fbebd2120180a1b299cfb9b53e0 | |
parent | 427cda410f238ff6e31aac0c9f300e5315d5bd52 (diff) | |
parent | 8c1f99f915a4426ff74eeee7e67a5a7a277410ce (diff) | |
download | display-5166e282945972a9e670bb248efd45cf36cec65b.tar.gz |
Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)temp_sam_168057903
Bug: 166295507
Merged-In: Ic197ecf19452f269ca31bb3b3b563dccb0719296
Change-Id: Ib76a3f938a240498c6201b01f8b1281624618038
-rw-r--r-- | msm8909/gpu_tonemapper/Android.mk | 2 | ||||
-rw-r--r-- | msm8909/sdm/libs/hwc/Android.mk | 2 | ||||
-rw-r--r-- | msm8909/sdm/libs/hwc2/Android.mk | 2 | ||||
-rw-r--r-- | msm8909w_3100/gpu_tonemapper/Android.mk | 2 | ||||
-rw-r--r-- | msm8909w_3100/sdm/libs/hwc/Android.mk | 2 | ||||
-rw-r--r-- | msm8909w_3100/sdm/libs/hwc2/Android.mk | 2 | ||||
-rw-r--r-- | msm8998/gpu_tonemapper/Android.mk | 2 | ||||
-rw-r--r-- | msm8998/libqdutils/profiler.cpp | 2 | ||||
-rw-r--r-- | msm8998/sdm/libs/core/display_base.cpp | 6 | ||||
-rw-r--r-- | msm8998/sdm/libs/core/display_primary.cpp | 4 | ||||
-rw-r--r-- | msm8998/sdm/libs/core/drm/hw_device_drm.cpp | 2 | ||||
-rw-r--r-- | msm8998/sdm/libs/core/fb/hw_device.cpp | 2 | ||||
-rw-r--r-- | msm8998/sdm/libs/core/resource_default.cpp | 2 | ||||
-rw-r--r-- | msm8998/sdm/libs/core/strategy.cpp | 4 | ||||
-rw-r--r-- | msm8998/sdm/libs/hwc2/hwc_callbacks.cpp | 18 | ||||
-rw-r--r-- | msm8998/sdm/libs/hwc2/hwc_callbacks.h | 6 | ||||
-rw-r--r-- | msm8998/sdm/libs/hwc2/hwc_display.cpp | 8 | ||||
-rw-r--r-- | msm8998/sdm/libs/hwc2/hwc_display_external.cpp | 4 | ||||
-rw-r--r-- | msm8998/sdm/libs/hwc2/hwc_layers.cpp | 5 | ||||
-rw-r--r-- | msm8998/sdm/libs/hwc2/hwc_session.cpp | 2 |
20 files changed, 46 insertions, 33 deletions
diff --git a/msm8909/gpu_tonemapper/Android.mk b/msm8909/gpu_tonemapper/Android.mk index 8b7a8668..8da06286 100644 --- a/msm8909/gpu_tonemapper/Android.mk +++ b/msm8909/gpu_tonemapper/Android.mk @@ -17,7 +17,7 @@ LOCAL_SHARED_LIBRARIES := libEGL libGLESv2 libGLESv3 libui libutils liblog LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps) $(kernel_deps) LOCAL_CFLAGS := $(version_flag) -Wno-missing-field-initializers -Wall \ - -Wno-unused-parameter -std=c++11 -DLOG_TAG=\"GPU_TONEMAPPER\" + -Wno-unused-parameter -DLOG_TAG=\"GPU_TONEMAPPER\" LOCAL_SRC_FILES := TonemapFactory.cpp \ glengine.cpp \ diff --git a/msm8909/sdm/libs/hwc/Android.mk b/msm8909/sdm/libs/hwc/Android.mk index 4e524240..6b7aa6c2 100644 --- a/msm8909/sdm/libs/hwc/Android.mk +++ b/msm8909/sdm/libs/hwc/Android.mk @@ -11,7 +11,7 @@ LOCAL_C_INCLUDES := $(common_includes) LOCAL_HEADER_LIBRARIES := display_headers LOCAL_CFLAGS := $(common_flags) -Wno-missing-field-initializers -Wno-unused-parameter \ - -std=c++11 -fcolor-diagnostics -Wno-sign-conversion -DLOG_TAG=\"SDM\" + -fcolor-diagnostics -Wno-sign-conversion -DLOG_TAG=\"SDM\" LOCAL_CLANG := true LOCAL_SHARED_LIBRARIES := libsdmcore libqservice libbinder libhardware libhardware_legacy \ diff --git a/msm8909/sdm/libs/hwc2/Android.mk b/msm8909/sdm/libs/hwc2/Android.mk index cd842149..22e101b9 100644 --- a/msm8909/sdm/libs/hwc2/Android.mk +++ b/msm8909/sdm/libs/hwc2/Android.mk @@ -12,7 +12,7 @@ LOCAL_C_INCLUDES := $(common_includes) LOCAL_HEADER_LIBRARIES := display_headers LOCAL_CFLAGS := -Wno-missing-field-initializers -Wno-unused-parameter \ - -std=c++11 -fcolor-diagnostics\ + -fcolor-diagnostics\ -DLOG_TAG=\"SDM\" $(common_flags) \ -I $(display_top)/sdm/libs/hwc ifeq ($(TARGET_EXCLUDES_DISPLAY_PP), true) diff --git a/msm8909w_3100/gpu_tonemapper/Android.mk b/msm8909w_3100/gpu_tonemapper/Android.mk index a2471e53..20e86b10 100644 --- a/msm8909w_3100/gpu_tonemapper/Android.mk +++ b/msm8909w_3100/gpu_tonemapper/Android.mk @@ -15,7 +15,7 @@ LOCAL_SHARED_LIBRARIES := libEGL libGLESv2 libui libutils liblog LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps) $(kernel_deps) LOCAL_CFLAGS := $(version_flag) -Wno-missing-field-initializers -Wall \ - -Wno-unused-parameter -std=c++11 -DLOG_TAG=\"GPU_TONEMAPPER\" + -Wno-unused-parameter -DLOG_TAG=\"GPU_TONEMAPPER\" LOCAL_SRC_FILES := TonemapFactory.cpp \ glengine.cpp \ diff --git a/msm8909w_3100/sdm/libs/hwc/Android.mk b/msm8909w_3100/sdm/libs/hwc/Android.mk index 4e524240..6b7aa6c2 100644 --- a/msm8909w_3100/sdm/libs/hwc/Android.mk +++ b/msm8909w_3100/sdm/libs/hwc/Android.mk @@ -11,7 +11,7 @@ LOCAL_C_INCLUDES := $(common_includes) LOCAL_HEADER_LIBRARIES := display_headers LOCAL_CFLAGS := $(common_flags) -Wno-missing-field-initializers -Wno-unused-parameter \ - -std=c++11 -fcolor-diagnostics -Wno-sign-conversion -DLOG_TAG=\"SDM\" + -fcolor-diagnostics -Wno-sign-conversion -DLOG_TAG=\"SDM\" LOCAL_CLANG := true LOCAL_SHARED_LIBRARIES := libsdmcore libqservice libbinder libhardware libhardware_legacy \ diff --git a/msm8909w_3100/sdm/libs/hwc2/Android.mk b/msm8909w_3100/sdm/libs/hwc2/Android.mk index ea929d36..beec1a8b 100644 --- a/msm8909w_3100/sdm/libs/hwc2/Android.mk +++ b/msm8909w_3100/sdm/libs/hwc2/Android.mk @@ -12,7 +12,7 @@ LOCAL_C_INCLUDES := $(common_includes) LOCAL_HEADER_LIBRARIES := display_headers LOCAL_CFLAGS := -Wno-missing-field-initializers -Wno-unused-parameter \ - -std=c++11 -fcolor-diagnostics\ + -fcolor-diagnostics\ -DLOG_TAG=\"SDM\" $(common_flags) \ -I $(display_top)/sdm/libs/hwc diff --git a/msm8998/gpu_tonemapper/Android.mk b/msm8998/gpu_tonemapper/Android.mk index fcb66cb6..ea1d2e94 100644 --- a/msm8998/gpu_tonemapper/Android.mk +++ b/msm8998/gpu_tonemapper/Android.mk @@ -17,7 +17,7 @@ LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include LOCAL_SHARED_LIBRARIES := libEGL libGLESv2 libGLESv3 libui libutils liblog LOCAL_CFLAGS := $(version_flag) -Wno-missing-field-initializers -Wall \ - -Wno-unused-parameter -std=c++11 -DLOG_TAG=\"GPU_TONEMAPPER\" + -Wno-unused-parameter -DLOG_TAG=\"GPU_TONEMAPPER\" LOCAL_SRC_FILES := TonemapFactory.cpp \ glengine.cpp \ diff --git a/msm8998/libqdutils/profiler.cpp b/msm8998/libqdutils/profiler.cpp index 810b0198..83f549d4 100644 --- a/msm8998/libqdutils/profiler.cpp +++ b/msm8998/libqdutils/profiler.cpp @@ -185,7 +185,7 @@ void CalcFps::calc_fps(nsecs_t currtime_us) } else if (debug_fps_metadata_t::DFM_TIME == debug_fps_metadata.type) { debug_fps_metadata.time_elapsed += (float)((float)diff/1000.0); - if (debug_fps_metadata.time_elapsed >= debug_fps_metadata.time_period) { + if (debug_fps_metadata.time_elapsed >= (float)debug_fps_metadata.time_period) { float fps = float(1000.0 * debug_fps_metadata.curr_frame/ debug_fps_metadata.time_elapsed); print_fps(fps); diff --git a/msm8998/sdm/libs/core/display_base.cpp b/msm8998/sdm/libs/core/display_base.cpp index 6f2966f4..257d4629 100644 --- a/msm8998/sdm/libs/core/display_base.cpp +++ b/msm8998/sdm/libs/core/display_base.cpp @@ -201,8 +201,8 @@ DisplayError DisplayBase::ValidateGPUTargetParams() { auto gpu_target_layer_dst_xpixels = out_rect.right - out_rect.left; auto gpu_target_layer_dst_ypixels = out_rect.bottom - out_rect.top; - if (gpu_target_layer_dst_xpixels > mixer_attributes_.width || - gpu_target_layer_dst_ypixels > mixer_attributes_.height) { + if (gpu_target_layer_dst_xpixels > layer_mixer_width || + gpu_target_layer_dst_ypixels > layer_mixer_height) { DLOGE("GPU target layer dst rect is not with in limits gpu wxh %fx%f, mixer wxh %dx%d", gpu_target_layer_dst_xpixels, gpu_target_layer_dst_ypixels, mixer_attributes_.width, mixer_attributes_.height); @@ -1179,7 +1179,7 @@ bool DisplayBase::NeedsMixerReconfiguration(LayerStack *layer_stack, uint32_t *n // Align the width and height according to fb's aspect ratio *new_mixer_width = FloorToMultipleOf(UINT32((FLOAT(fb_width) / FLOAT(fb_height)) * - layer_height), align_x); + FLOAT(layer_height)), align_x); *new_mixer_height = FloorToMultipleOf(layer_height, align_y); LayerRect dst_domain = {0.0f, 0.0f, FLOAT(*new_mixer_width), FLOAT(*new_mixer_height)}; diff --git a/msm8998/sdm/libs/core/display_primary.cpp b/msm8998/sdm/libs/core/display_primary.cpp index 572dd004..35fdfb01 100644 --- a/msm8998/sdm/libs/core/display_primary.cpp +++ b/msm8998/sdm/libs/core/display_primary.cpp @@ -94,8 +94,8 @@ DisplayError DisplayPrimary::Prepare(LayerStack *layer_stack) { if (needs_hv_flip) { DisplayBase::GetFrameBufferConfig(&variable_info); - src_domain.right = variable_info.x_pixels; - src_domain.bottom = variable_info.y_pixels; + src_domain.right = static_cast<float>(variable_info.x_pixels); + src_domain.bottom = static_cast<float>(variable_info.y_pixels); panel_transform.flip_horizontal = hw_panel_info_.panel_orientation.flip_horizontal; panel_transform.flip_vertical = hw_panel_info_.panel_orientation.flip_vertical; diff --git a/msm8998/sdm/libs/core/drm/hw_device_drm.cpp b/msm8998/sdm/libs/core/drm/hw_device_drm.cpp index af7ce6e5..f8bf7628 100644 --- a/msm8998/sdm/libs/core/drm/hw_device_drm.cpp +++ b/msm8998/sdm/libs/core/drm/hw_device_drm.cpp @@ -760,7 +760,7 @@ DisplayError HWDeviceDRM::SetMixerAttributes(const HWMixerAttributes &mixer_attr float scale_x = FLOAT(display_attributes_.x_pixels) / FLOAT(mixer_attributes.width); float scale_y = FLOAT(display_attributes_.y_pixels) / FLOAT(mixer_attributes.height); - float max_scale_up = hw_resource_.hw_dest_scalar_info.max_scale_up; + float max_scale_up = FLOAT(hw_resource_.hw_dest_scalar_info.max_scale_up); if (scale_x > max_scale_up || scale_y > max_scale_up) { DLOGW( "Up scaling ratio exceeds for destination scalar upscale limit scale_x %f scale_y %f " diff --git a/msm8998/sdm/libs/core/fb/hw_device.cpp b/msm8998/sdm/libs/core/fb/hw_device.cpp index 92dd826a..c62917d8 100644 --- a/msm8998/sdm/libs/core/fb/hw_device.cpp +++ b/msm8998/sdm/libs/core/fb/hw_device.cpp @@ -1333,7 +1333,7 @@ DisplayError HWDevice::SetMixerAttributes(const HWMixerAttributes &mixer_attribu float scale_x = FLOAT(display_attributes_.x_pixels) / FLOAT(mixer_attributes.width); float scale_y = FLOAT(display_attributes_.y_pixels) / FLOAT(mixer_attributes.height); - float max_scale_up = hw_resource_.hw_dest_scalar_info.max_scale_up; + float max_scale_up = FLOAT(hw_resource_.hw_dest_scalar_info.max_scale_up); if (scale_x > max_scale_up || scale_y > max_scale_up) { DLOGW_IF(kTagDriverConfig, "Up scaling ratio exceeds for destination scalar upscale " \ "limit scale_x %f scale_y %f max_scale_up %f", scale_x, scale_y, max_scale_up); diff --git a/msm8998/sdm/libs/core/resource_default.cpp b/msm8998/sdm/libs/core/resource_default.cpp index 31d8704e..bf06153f 100644 --- a/msm8998/sdm/libs/core/resource_default.cpp +++ b/msm8998/sdm/libs/core/resource_default.cpp @@ -469,7 +469,7 @@ DisplayError ResourceDefault::SrcSplitConfig(DisplayResourceContext *display_res float dst_width = dst_rect.right - dst_rect.left; // Layer cannot qualify for SrcSplit if source or destination width exceeds max pipe width. - if ((src_width > hw_res_info_.max_pipe_width) || (dst_width > hw_res_info_.max_pipe_width)) { + if ((src_width > FLOAT(hw_res_info_.max_pipe_width)) || (dst_width > FLOAT(hw_res_info_.max_pipe_width))) { SplitRect(src_rect, dst_rect, &left_pipe->src_roi, &left_pipe->dst_roi, &right_pipe->src_roi, &right_pipe->dst_roi); left_pipe->valid = true; diff --git a/msm8998/sdm/libs/core/strategy.cpp b/msm8998/sdm/libs/core/strategy.cpp index 8398bbd4..6cf40b85 100644 --- a/msm8998/sdm/libs/core/strategy.cpp +++ b/msm8998/sdm/libs/core/strategy.cpp @@ -174,8 +174,8 @@ void Strategy::GenerateROI() { return; } - float layer_mixer_width = mixer_attributes_.width; - float layer_mixer_height = mixer_attributes_.height; + float layer_mixer_width = FLOAT(mixer_attributes_.width); + float layer_mixer_height = FLOAT(mixer_attributes_.height); if (!hw_resource_info_.is_src_split && display_attributes_.is_device_split) { split_display = true; diff --git a/msm8998/sdm/libs/hwc2/hwc_callbacks.cpp b/msm8998/sdm/libs/hwc2/hwc_callbacks.cpp index c52632a5..e12e0574 100644 --- a/msm8998/sdm/libs/hwc2/hwc_callbacks.cpp +++ b/msm8998/sdm/libs/hwc2/hwc_callbacks.cpp @@ -35,18 +35,21 @@ namespace sdm { void HWCCallbacks::Hotplug(hwc2_display_t display, HWC2::Connection state) { + std::lock_guard<std::mutex> hotplug_lock(hotplug_mutex_); if (hotplug_) { hotplug_(hotplug_data_, display, INT32(state)); } } void HWCCallbacks::Refresh(hwc2_display_t display) { + std::lock_guard<std::mutex> refresh_lock(refresh_mutex_); if (refresh_) { refresh_(refresh_data_, display); } } void HWCCallbacks::Vsync(hwc2_display_t display, int64_t timestamp) { + std::lock_guard<std::mutex> vsync_lock(vsync_mutex_); if (vsync_) { DTRACE_SCOPED(); vsync_(vsync_data_, display, timestamp); @@ -56,18 +59,21 @@ void HWCCallbacks::Vsync(hwc2_display_t display, int64_t timestamp) { HWC2::Error HWCCallbacks::Register(HWC2::Callback descriptor, hwc2_callback_data_t callback_data, hwc2_function_pointer_t pointer) { switch (descriptor) { - case HWC2::Callback::Hotplug: + case HWC2::Callback::Hotplug: { + std::lock_guard<std::mutex> hotplug_lock(hotplug_mutex_); hotplug_data_ = callback_data; hotplug_ = reinterpret_cast<HWC2_PFN_HOTPLUG>(pointer); - break; - case HWC2::Callback::Refresh: + } break; + case HWC2::Callback::Refresh: { + std::lock_guard<std::mutex> refresh_lock(refresh_mutex_); refresh_data_ = callback_data; refresh_ = reinterpret_cast<HWC2_PFN_REFRESH>(pointer); - break; - case HWC2::Callback::Vsync: + } break; + case HWC2::Callback::Vsync: { + std::lock_guard<std::mutex> vsync_lock(vsync_mutex_); vsync_data_ = callback_data; vsync_ = reinterpret_cast<HWC2_PFN_VSYNC>(pointer); - break; + } break; default: return HWC2::Error::BadParameter; } diff --git a/msm8998/sdm/libs/hwc2/hwc_callbacks.h b/msm8998/sdm/libs/hwc2/hwc_callbacks.h index 015bf5d5..6c1e6965 100644 --- a/msm8998/sdm/libs/hwc2/hwc_callbacks.h +++ b/msm8998/sdm/libs/hwc2/hwc_callbacks.h @@ -36,6 +36,8 @@ #undef HWC2_INCLUDE_STRINGIFICATION #undef HWC2_USE_CPP11 +#include <mutex> + namespace sdm { class HWCCallbacks { @@ -56,6 +58,10 @@ class HWCCallbacks { HWC2_PFN_HOTPLUG hotplug_ = nullptr; HWC2_PFN_REFRESH refresh_ = nullptr; HWC2_PFN_VSYNC vsync_ = nullptr; + + std::mutex hotplug_mutex_; + std::mutex refresh_mutex_; + std::mutex vsync_mutex_; }; } // namespace sdm diff --git a/msm8998/sdm/libs/hwc2/hwc_display.cpp b/msm8998/sdm/libs/hwc2/hwc_display.cpp index 498c05d1..46abc14f 100644 --- a/msm8998/sdm/libs/hwc2/hwc_display.cpp +++ b/msm8998/sdm/libs/hwc2/hwc_display.cpp @@ -545,8 +545,8 @@ void HWCDisplay::BuildLayerStack() { layer_buffer->release_fence_fd = -1; layer->src_rect.left = 0; layer->src_rect.top = 0; - layer->src_rect.right = layer_buffer->width; - layer->src_rect.bottom = layer_buffer->height; + layer->src_rect.right = FLOAT(layer_buffer->width); + layer->src_rect.bottom = FLOAT(layer_buffer->height); } if (layer->frame_rate > metadata_refresh_rate_) { @@ -1715,8 +1715,8 @@ void HWCDisplay::SolidFillPrepare() { LayerRect rect; rect.top = 0; rect.left = 0; - rect.right = primary_width; - rect.bottom = primary_height; + rect.right = FLOAT(primary_width); + rect.bottom = FLOAT(primary_height); solid_fill_layer_->composition = kCompositionGPU; solid_fill_layer_->src_rect = rect; diff --git a/msm8998/sdm/libs/hwc2/hwc_display_external.cpp b/msm8998/sdm/libs/hwc2/hwc_display_external.cpp index f4878c82..14a5dd85 100644 --- a/msm8998/sdm/libs/hwc2/hwc_display_external.cpp +++ b/msm8998/sdm/libs/hwc2/hwc_display_external.cpp @@ -154,8 +154,8 @@ void HWCDisplayExternal::ApplyScanAdjustment(hwc_rect_t *display_frame) { return; } - uint32_t new_mixer_width = UINT32(mixer_width * FLOAT(1.0f - width_ratio)); - uint32_t new_mixer_height = UINT32(mixer_height * FLOAT(1.0f - height_ratio)); + uint32_t new_mixer_width = UINT32(FLOAT(mixer_width) * (1.0f - width_ratio)); + uint32_t new_mixer_height = UINT32(FLOAT(mixer_height) * (1.0f - height_ratio)); int x_offset = INT((FLOAT(mixer_width) * width_ratio) / 2.0f); int y_offset = INT((FLOAT(mixer_height) * height_ratio) / 2.0f); diff --git a/msm8998/sdm/libs/hwc2/hwc_layers.cpp b/msm8998/sdm/libs/hwc2/hwc_layers.cpp index ea8841bd..ee145f5e 100644 --- a/msm8998/sdm/libs/hwc2/hwc_layers.cpp +++ b/msm8998/sdm/libs/hwc2/hwc_layers.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2017, 2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2017, 2019-2020, The Linux Foundation. All rights reserved. * Not a Contribution. * * Copyright 2015 The Android Open Source Project @@ -592,6 +592,7 @@ LayerBufferFormat HWCLayer::GetSDMFormat(const int32_t &source, const int flags) format = kFormatYCrCb420PlanarStride16; break; case HAL_PIXEL_FORMAT_YCrCb_420_SP: + case HAL_PIXEL_FORMAT_NV21_ZSL: format = kFormatYCrCb420SemiPlanar; break; case HAL_PIXEL_FORMAT_YCbCr_420_SP: @@ -679,7 +680,7 @@ DisplayError HWCLayer::SetMetaData(const private_handle_t *pvt_handle, Layer *la uint32_t fps = 0; uint32_t frame_rate = layer->frame_rate; if (getMetaData(handle, GET_REFRESH_RATE, &fps) == 0) { - frame_rate = RoundToStandardFPS(fps); + frame_rate = RoundToStandardFPS(FLOAT(fps)); } int32_t interlaced = 0; diff --git a/msm8998/sdm/libs/hwc2/hwc_session.cpp b/msm8998/sdm/libs/hwc2/hwc_session.cpp index f0776678..13316866 100644 --- a/msm8998/sdm/libs/hwc2/hwc_session.cpp +++ b/msm8998/sdm/libs/hwc2/hwc_session.cpp @@ -437,7 +437,7 @@ int32_t HWCSession::RegisterCallback(hwc2_device_t *device, int32_t descriptor, } auto desc = static_cast<HWC2::Callback>(descriptor); auto error = hwc_session->callbacks_.Register(desc, callback_data, pointer); - DLOGD("Registering callback: %s", to_string(desc).c_str()); + DLOGD("%s callback: %s", pointer ? "Registering" : "Deregistering", to_string(desc).c_str()); if (descriptor == HWC2_CALLBACK_HOTPLUG) hwc_session->callbacks_.Hotplug(HWC_DISPLAY_PRIMARY, HWC2::Connection::Connected); return INT32(error); |