techpack: display: fix div64 error for 32 bit build

use div_u64 instead of /, for 64 bit division.

Change-Id: I791e027beb6817810d63a6a2d0a1a29f88bdb5d5
Signed-off-by: Venkata Prahlad Valluru <vvalluru@codeaurora.org>
This commit is contained in:
Venkata Prahlad Valluru 2021-01-04 11:25:56 +05:30 • committed by Gerrit - the friendly Code Review server
commit 6eab43458e
2 changed files with 10 additions and 9 deletions

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2014-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "[drm:%s:%d]: " fmt, __func__, __LINE__
@ -299,8 +299,8 @@ static int _sde_power_data_bus_set_quota(
for (i = 0; i < paths; i++) {
if (pdbus->data_bus_hdl[i]) {
rc = icc_set_bw(pdbus->data_bus_hdl[i],
Bps_to_icc(in_ab_quota),
Bps_to_icc(in_ib_quota));
kBps_to_icc(div_u64(in_ab_quota, 1000)),
kBps_to_icc(div_u64(in_ib_quota, 1000)));
if (rc)
goto err;
}
@ -316,8 +316,8 @@ err:
for (; i >= 0; --i)
if (pdbus->data_bus_hdl[i])
icc_set_bw(pdbus->data_bus_hdl[i],
Bps_to_icc(pdbus->curr_val.ab),
Bps_to_icc(pdbus->curr_val.ib));
kBps_to_icc(div_u64(pdbus->curr_val.ab, 1000)),
kBps_to_icc(div_u64(pdbus->curr_val.ib, 1000)));
SDE_ATRACE_END("msm_bus_scale_req");
pr_err("failed to set data bus vote ab=%llu ib=%llu rc=%d\n",
@ -530,8 +530,9 @@ static int sde_power_reg_bus_update(struct sde_power_reg_bus_handle *reg_bus,
if (reg_bus->reg_bus_hdl) {
SDE_ATRACE_BEGIN("msm_bus_scale_req");
rc = icc_set_bw(reg_bus->reg_bus_hdl, Bps_to_icc(ab_quota),
Bps_to_icc(ib_quota));
rc = icc_set_bw(reg_bus->reg_bus_hdl,
kBps_to_icc(div_u64(ab_quota, 1000)),
kBps_to_icc(div_u64(ib_quota, 1000)));
SDE_ATRACE_END("msm_bus_scale_req");
}

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
*/
#include "msm_drv.h"
@ -550,7 +550,7 @@ static int sde_vdc_populate_core_params(struct msm_display_vdc_info *vdc_info,
temp = temp << 16;
vdc_info->ramp_bits = temp;
temp = vdc_info->ramp_bits / vdc_info->ramp_blocks;
temp = div_u64(vdc_info->ramp_bits, vdc_info->ramp_blocks);
vdc_info->rc_fullness_offset_slope = temp;
temp = (2 * SSM_MAX_SE_SIZE) - 2;