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

Commit 3df7f60d authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Don't send same bus vote repeatedly"

parents e96549e8 47d025c3
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -15,9 +15,17 @@ static int interconnect_bus_set(struct kgsl_device *device, int level,
{
{
	struct kgsl_pwrctrl *pwr = &device->pwrctrl;
	struct kgsl_pwrctrl *pwr = &device->pwrctrl;


	if ((level == pwr->cur_buslevel) && (ab == pwr->cur_ab))
		return 0;

	pwr->cur_buslevel = level;
	pwr->cur_ab = ab;

	icc_set_bw(pwr->icc_path, MBps_to_icc(ab),
	icc_set_bw(pwr->icc_path, MBps_to_icc(ab),
		kBps_to_icc(pwr->ddr_table[level]));
		kBps_to_icc(pwr->ddr_table[level]));


	trace_kgsl_buslevel(device, pwr->active_pwrlevel, level);

	return 0;
	return 0;
}
}


@@ -63,8 +71,6 @@ void kgsl_bus_update(struct kgsl_device *device, bool on)
		pwr->bus_percent_ab = 0;
		pwr->bus_percent_ab = 0;
		pwr->bus_ab_mbytes = 0;
		pwr->bus_ab_mbytes = 0;
	}
	}
	trace_kgsl_buslevel(device, pwr->active_pwrlevel, buslevel);
	pwr->cur_buslevel = buslevel;


	/* buslevel is the IB vote, update the AB */
	/* buslevel is the IB vote, update the AB */
	ab = _ab_buslevel_update(pwr, pwr->ddr_table[buslevel]);
	ab = _ab_buslevel_update(pwr, pwr->ddr_table[buslevel]);
+14 −3
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@
#include "kgsl_bus.h"
#include "kgsl_bus.h"
#include "kgsl_device.h"
#include "kgsl_device.h"
#include "kgsl_gmu.h"
#include "kgsl_gmu.h"
#include "kgsl_trace.h"
#include "kgsl_util.h"
#include "kgsl_util.h"


struct gmu_iommu_context {
struct gmu_iommu_context {
@@ -1264,12 +1265,22 @@ static int gmu_bus_set(struct kgsl_device *device, int buslevel,
	u32 ab)
	u32 ab)
{
{
	struct kgsl_pwrctrl *pwr = &device->pwrctrl;
	struct kgsl_pwrctrl *pwr = &device->pwrctrl;
	int ret;
	int ret = 0;


	if (buslevel != pwr->cur_buslevel) {
		ret = gmu_core_dcvs_set(device, INVALID_DCVS_IDX, buslevel);
		ret = gmu_core_dcvs_set(device, INVALID_DCVS_IDX, buslevel);
		if (ret)
			return ret;


	if (!ret)
		pwr->cur_buslevel = buslevel;

		trace_kgsl_buslevel(device, pwr->active_pwrlevel, buslevel);
	}

	if (ab != pwr->cur_ab) {
		icc_set_bw(pwr->icc_path, MBps_to_icc(ab), 0);
		icc_set_bw(pwr->icc_path, MBps_to_icc(ab), 0);
		pwr->cur_ab = ab;
	}


	return ret;
	return ret;
}
}
+3 −1
Original line number Original line Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/* SPDX-License-Identifier: GPL-2.0-only */
/*
/*
 * Copyright (c) 2010-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2010-2020, The Linux Foundation. All rights reserved.
 */
 */
#ifndef __KGSL_PWRCTRL_H
#ifndef __KGSL_PWRCTRL_H
#define __KGSL_PWRCTRL_H
#define __KGSL_PWRCTRL_H
@@ -163,6 +163,8 @@ struct kgsl_pwrctrl {
	const char *tzone_name;
	const char *tzone_name;
	/** @icc_path: Interconnect path for the GPU (if applicable) */
	/** @icc_path: Interconnect path for the GPU (if applicable) */
	struct icc_path *icc_path;
	struct icc_path *icc_path;
	/** cur_ab: The last ab voted by the driver */
	u32 cur_ab;
};
};


int kgsl_pwrctrl_init(struct kgsl_device *device);
int kgsl_pwrctrl_init(struct kgsl_device *device);