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

Commit 88dcd535 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: kgsl: Make a device specific scales_bandwidth function



To make it easier for the upcoming change to move GMU to a component
device make a real function to test if the target is capable of
scaling the bus bandwidth on the GMU.

Change-Id: Ic0dedbad255622428de2ac01a5833a9e28c9c3ac
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 9ee27267
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1748,6 +1748,13 @@ static int a6xx_gmu_wait_for_active_transition(
	return -ETIMEDOUT;
}

static bool a6xx_gmu_scales_bandwidth(struct kgsl_device *device)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);

	return (ADRENO_GPUREV(adreno_dev) >= ADRENO_REV_A640);
}

struct gmu_dev_ops adreno_a6xx_gmudev = {
	.load_firmware = a6xx_gmu_load_firmware,
	.oob_set = a6xx_gmu_oob_set,
@@ -1767,4 +1774,5 @@ struct gmu_dev_ops adreno_a6xx_gmudev = {
	.wait_for_active_transition = a6xx_gmu_wait_for_active_transition,
	.gmu2host_intr_mask = HFI_IRQ_MASK,
	.gmu_ao_intr_mask = GMU_AO_INT_MASK,
	.scales_bandwidth = a6xx_gmu_scales_bandwidth,
};
+5 −6
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/of.h>
@@ -98,13 +98,12 @@ bool gmu_core_gpmu_isenabled(struct kgsl_device *device)

bool gmu_core_scales_bandwidth(struct kgsl_device *device)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	struct gmu_dev_ops *ops = GMU_DEVICE_OPS(device);

	if (device->gmu_core.type == GMU_CORE_TYPE_PCC)
		return false;
	if (ops && ops->scales_bandwidth)
		return ops->scales_bandwidth(device);

	return gmu_core_gpmu_isenabled(device) &&
		   (ADRENO_GPUREV(adreno_dev) >= ADRENO_REV_A640);
	return false;
}

int gmu_core_init(struct kgsl_device *device)
+2 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 */
#ifndef __KGSL_GMU_CORE_H
#define __KGSL_GMU_CORE_H
@@ -144,6 +144,7 @@ struct gmu_dev_ops {
	void (*cooperative_reset)(struct kgsl_device *device);
	void (*halt_execution)(struct kgsl_device *device);
	int (*wait_for_active_transition)(struct kgsl_device *device);
	bool (*scales_bandwidth)(struct kgsl_device *device);
	const unsigned int gmu2host_intr_mask;
	const unsigned int gmu_ao_intr_mask;
};