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

Commit 67420e60 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Put OPP reference count" into msm-4.14

parents 04fd0709 48e5c602
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1399,8 +1399,10 @@ static uint32_t _write_voltage_table(struct adreno_device *adreno_dev,
		opp = dev_pm_opp_find_freq_exact(&device->pdev->dev,
				pwr->pwrlevels[i].gpu_freq, true);
		/* _opp_get returns uV, convert to mV */
		if (!IS_ERR(opp))
		if (!IS_ERR(opp)) {
			mvolt = dev_pm_opp_get_voltage(opp) / 1000;
			dev_pm_opp_put(opp);
		}
		kgsl_regwrite(device, addr++, mvolt);
		kgsl_regwrite(device, addr++,
				pwr->pwrlevels[i].gpu_freq / 1000000);
+1 −0
Original line number Diff line number Diff line
@@ -661,6 +661,7 @@ static int rpmh_arc_votes_init(struct gmu_device *gmu,

		/* Values from OPP framework are offset by 1 */
		vlvl_tbl[i] = dev_pm_opp_get_voltage(opp) - 1;
		dev_pm_opp_put(opp);
	}

	ret = setup_volt_dependency_tbl(votes,
+1 −3
Original line number Diff line number Diff line
@@ -2209,16 +2209,14 @@ static void kgsl_pwrctrl_disable_unused_opp(struct kgsl_device *device)
		return;

	while (1) {
		rcu_read_lock();
		opp = dev_pm_opp_find_freq_ceil(dev, &freq);
		rcu_read_unlock();

		if (IS_ERR(opp))
			break;

		if (!_gpu_freq_supported(&device->pwrctrl, freq))
			dev_pm_opp_disable(dev, freq);

		dev_pm_opp_put(opp);
		freq++;
	}
}
+4 −4
Original line number Diff line number Diff line
@@ -886,19 +886,19 @@ static int opp_notify(struct notifier_block *nb,
	if (type != OPP_EVENT_ENABLE && type != OPP_EVENT_DISABLE)
		return result;

	rcu_read_lock();
	opp = dev_pm_opp_find_freq_floor(dev, &max_freq);
	dev_pm_opp_put(opp);

	if (IS_ERR(opp)) {
		rcu_read_unlock();
		return PTR_ERR(opp);
	}

	opp = dev_pm_opp_find_freq_ceil(dev, &min_freq);
	dev_pm_opp_put(opp);

	if (IS_ERR(opp))
		min_freq = pwr->pwrlevels[pwr->min_pwrlevel].gpu_freq;

	rcu_read_unlock();

	mutex_lock(&device->mutex);

	max_level = pwr->thermal_pwrlevel;