Merge "msm: kgsl: Make a device specific scales_bandwidth function"

This commit is contained in:
qctecmdr 2020-03-02 18:28:27 -08:00 • committed by Gerrit - the friendly Code Review server
commit 59c71da3d6
3 changed files with 15 additions and 7 deletions

View file

@ -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,
};

View file

@ -1,6 +1,6 @@
// 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)

View file

@ -1,6 +1,6 @@
/* 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;
};