diff options
-rw-r--r-- | sdm/libs/core/display_base.cpp | 6 | ||||
-rw-r--r-- | sdm/libs/core/drm/hw_device_drm.cpp | 2 | ||||
-rw-r--r-- | sdm/libs/core/drm/hw_tv_drm.cpp | 4 | ||||
-rw-r--r-- | sdm/libs/core/fb/hw_device.cpp | 2 | ||||
-rw-r--r-- | sdm/libs/core/resource_default.cpp | 3 | ||||
-rw-r--r-- | sdm/libs/core/strategy.cpp | 4 | ||||
-rw-r--r-- | sdm/libs/hwc2/hwc_display.cpp | 7 | ||||
-rw-r--r-- | sdm/libs/hwc2/hwc_display_external.cpp | 4 | ||||
-rw-r--r-- | sdm/libs/hwc2/hwc_display_external_test.cpp | 3 |
9 files changed, 19 insertions, 16 deletions
diff --git a/sdm/libs/core/display_base.cpp b/sdm/libs/core/display_base.cpp index f0efc2d5..d096f24e 100644 --- a/sdm/libs/core/display_base.cpp +++ b/sdm/libs/core/display_base.cpp @@ -204,8 +204,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); @@ -1173,7 +1173,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/sdm/libs/core/drm/hw_device_drm.cpp b/sdm/libs/core/drm/hw_device_drm.cpp index 5d6dfde5..aa0e13c5 100644 --- a/sdm/libs/core/drm/hw_device_drm.cpp +++ b/sdm/libs/core/drm/hw_device_drm.cpp @@ -1521,7 +1521,7 @@ DisplayError HWDeviceDRM::SetMixerAttributes(const HWMixerAttributes &mixer_attr float scale_x = FLOAT(display_attributes_[index].x_pixels) / FLOAT(mixer_attributes.width); float scale_y = FLOAT(display_attributes_[index].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/sdm/libs/core/drm/hw_tv_drm.cpp b/sdm/libs/core/drm/hw_tv_drm.cpp index 8e141e32..da1a1797 100644 --- a/sdm/libs/core/drm/hw_tv_drm.cpp +++ b/sdm/libs/core/drm/hw_tv_drm.cpp @@ -261,8 +261,8 @@ DisplayError HWTVDRM::UpdateHDRMetaData(HWLayers *hw_layers) { // metadata. This will be replaced with an idle timer implementation in the future. if (reset_hdr_flag) { gettimeofday(&hdr_reset_end, NULL); - float hdr_reset_time_start = ((hdr_reset_start.tv_sec*1000) + (hdr_reset_start.tv_usec/1000)); - float hdr_reset_time_end = ((hdr_reset_end.tv_sec*1000) + (hdr_reset_end.tv_usec/1000)); + float hdr_reset_time_start = FLOAT((hdr_reset_start.tv_sec*1000) + (hdr_reset_start.tv_usec/1000)); + float hdr_reset_time_end = FLOAT((hdr_reset_end.tv_sec*1000) + (hdr_reset_end.tv_usec/1000)); if (((hdr_reset_time_end-hdr_reset_time_start)/1000) >= MIN_HDR_RESET_WAITTIME) { memset(&hdr_metadata_, 0, sizeof(hdr_metadata_)); diff --git a/sdm/libs/core/fb/hw_device.cpp b/sdm/libs/core/fb/hw_device.cpp index 148f866e..c7a004c5 100644 --- a/sdm/libs/core/fb/hw_device.cpp +++ b/sdm/libs/core/fb/hw_device.cpp @@ -1325,7 +1325,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/sdm/libs/core/resource_default.cpp b/sdm/libs/core/resource_default.cpp index e8cce43f..6dd70266 100644 --- a/sdm/libs/core/resource_default.cpp +++ b/sdm/libs/core/resource_default.cpp @@ -467,9 +467,10 @@ DisplayError ResourceDefault::SrcSplitConfig(DisplayResourceContext *display_res HWPipeInfo *right_pipe = &layer_config->right_pipe; float src_width = src_rect.right - src_rect.left; float dst_width = dst_rect.right - dst_rect.left; + float fmax_pipe_width = FLOAT(hw_res_info_.max_pipe_width); // 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 > fmax_pipe_width) || (dst_width > fmax_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/sdm/libs/core/strategy.cpp b/sdm/libs/core/strategy.cpp index d6820704..a2a3ba2c 100644 --- a/sdm/libs/core/strategy.cpp +++ b/sdm/libs/core/strategy.cpp @@ -159,8 +159,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/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp index 45effc06..4ba4a274 100644 --- a/sdm/libs/hwc2/hwc_display.cpp +++ b/sdm/libs/hwc2/hwc_display.cpp @@ -281,7 +281,8 @@ void WhiteCompensation::CalculateRGBRatio() { // g_ratio = g/kCompensatedMaxRGB // b_ratio = b/kCompensatedMaxRGB auto rgb_ratio = [=](int rgb, float c2, float c1, float c0) { - return ((c2 * rgb * rgb + c1 * rgb + c0) / kCompensatedMaxRGB); + float frgb = FLOAT(rgb); + return ((c2 * frgb * frgb + c1 * frgb + c0) / kCompensatedMaxRGB); }; compensated_red_ratio_ = @@ -802,8 +803,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 (hwc_layer->HasMetaDataRefreshRate() && layer->frame_rate > metadata_refresh_rate_) { diff --git a/sdm/libs/hwc2/hwc_display_external.cpp b/sdm/libs/hwc2/hwc_display_external.cpp index 21a9284a..90dd2143 100644 --- a/sdm/libs/hwc2/hwc_display_external.cpp +++ b/sdm/libs/hwc2/hwc_display_external.cpp @@ -166,8 +166,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/sdm/libs/hwc2/hwc_display_external_test.cpp b/sdm/libs/hwc2/hwc_display_external_test.cpp index 8551854c..a6fcb08e 100644 --- a/sdm/libs/hwc2/hwc_display_external_test.cpp +++ b/sdm/libs/hwc2/hwc_display_external_test.cpp @@ -625,7 +625,8 @@ int HWCDisplayExternalTest::InitLayer(Layer *layer) { GetDisplayAttributesForConfig(INT32(active_config), &var_info); layer->flags.updating = 1; - layer->src_rect = LayerRect(0, 0, var_info.x_pixels, var_info.y_pixels); + layer->src_rect = LayerRect(0, 0, FLOAT(var_info.x_pixels), + FLOAT(var_info.y_pixels)); layer->dst_rect = layer->src_rect; layer->frame_rate = var_info.fps; layer->blending = kBlendingPremultiplied; |