Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6eab4345 authored by Venkata Prahlad Valluru's avatar Venkata Prahlad Valluru Committed by Gerrit - the friendly Code Review server
Browse files

techpack: display: fix div64 error for 32 bit build



use div_u64 instead of /, for 64 bit division.

Change-Id: I791e027beb6817810d63a6a2d0a1a29f88bdb5d5
Signed-off-by: default avatarVenkata Prahlad Valluru <vvalluru@codeaurora.org>
parent 41c8fc3c
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
// 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 @@ static int _sde_power_data_bus_set_quota(
	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");
	}

+2 −2
Original line number Diff line number Diff line
// 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;