mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
msm: kgsl: Remove L2PC PM QoS feature
KGSL already has PM QoS covering what matters. The L2PC PM QoS code is not only unneeded, but also unused, so remove it. It's poorly designed anyway since it uses a timeout with PM QoS, which is drastically bad for power consumption. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
This commit is contained in:
parent
14d2aa7353
commit
c303f5b5a9
@ -194,13 +194,6 @@ Optional Properties:
|
||||
Specify the number of macrotiling channels for this chip.
|
||||
This is programmed into certain registers and also pass to
|
||||
the user as a property.
|
||||
- qcom,l2pc-cpu-mask:
|
||||
Disables L2PC on masked CPUs when any of Graphics
|
||||
rendering thread is running on masked CPUs.
|
||||
Bit 0 is for CPU-0, bit 1 is for CPU-1...
|
||||
|
||||
- qcom,l2pc-update-queue:
|
||||
Disables L2PC on masked CPUs at queue time when it's true.
|
||||
|
||||
- qcom,snapshot-size:
|
||||
Specify the size of snapshot in bytes. This will override
|
||||
|
@ -1007,11 +1007,6 @@ static int adreno_of_get_power(struct adreno_device *adreno_dev,
|
||||
&device->pwrctrl.pm_qos_active_latency))
|
||||
device->pwrctrl.pm_qos_active_latency = 501;
|
||||
|
||||
/* get pm-qos-cpu-mask-latency, set it to default if not found */
|
||||
if (of_property_read_u32(node, "qcom,l2pc-cpu-mask-latency",
|
||||
&device->pwrctrl.pm_qos_cpu_mask_latency))
|
||||
device->pwrctrl.pm_qos_cpu_mask_latency = 501;
|
||||
|
||||
/* get pm-qos-wakeup-latency, set it to default if not found */
|
||||
if (of_property_read_u32(node, "qcom,pm-qos-wakeup-latency",
|
||||
&device->pwrctrl.pm_qos_wakeup_latency))
|
||||
@ -1755,10 +1750,6 @@ static int _adreno_start(struct adreno_device *adreno_dev)
|
||||
/* make sure ADRENO_DEVICE_STARTED is not set here */
|
||||
WARN_ON(test_bit(ADRENO_DEVICE_STARTED, &adreno_dev->priv));
|
||||
|
||||
/* disallow l2pc during wake up to improve GPU wake up time */
|
||||
kgsl_pwrctrl_update_l2pc(&adreno_dev->dev,
|
||||
KGSL_L2PC_WAKEUP_TIMEOUT);
|
||||
|
||||
pm_qos_update_request(&device->pwrctrl.pm_qos_req_dma,
|
||||
pmqos_wakeup_vote);
|
||||
|
||||
|
@ -1447,10 +1447,6 @@ int adreno_dispatcher_queue_cmds(struct kgsl_device_private *dev_priv,
|
||||
|
||||
spin_unlock(&drawctxt->lock);
|
||||
|
||||
if (device->pwrctrl.l2pc_update_queue)
|
||||
kgsl_pwrctrl_update_l2pc(&adreno_dev->dev,
|
||||
KGSL_L2PC_QUEUE_TIMEOUT);
|
||||
|
||||
/* Add the context to the dispatcher pending list */
|
||||
dispatcher_queue_context(adreno_dev, drawctxt);
|
||||
|
||||
|
@ -4972,7 +4972,6 @@ int kgsl_device_platform_probe(struct kgsl_device *device)
|
||||
{
|
||||
int status = -EINVAL;
|
||||
struct resource *res;
|
||||
int cpu;
|
||||
|
||||
status = _register_device(device);
|
||||
if (status)
|
||||
@ -5102,22 +5101,6 @@ int kgsl_device_platform_probe(struct kgsl_device *device)
|
||||
PM_QOS_CPU_DMA_LATENCY,
|
||||
PM_QOS_DEFAULT_VALUE);
|
||||
|
||||
if (device->pwrctrl.l2pc_cpus_mask) {
|
||||
struct pm_qos_request *qos = &device->pwrctrl.l2pc_cpus_qos;
|
||||
|
||||
qos->type = PM_QOS_REQ_AFFINE_CORES;
|
||||
|
||||
cpumask_empty(&qos->cpus_affine);
|
||||
for_each_possible_cpu(cpu) {
|
||||
if ((1 << cpu) & device->pwrctrl.l2pc_cpus_mask)
|
||||
cpumask_set_cpu(cpu, &qos->cpus_affine);
|
||||
}
|
||||
|
||||
pm_qos_add_request(&device->pwrctrl.l2pc_cpus_qos,
|
||||
PM_QOS_CPU_DMA_LATENCY,
|
||||
PM_QOS_DEFAULT_VALUE);
|
||||
}
|
||||
|
||||
device->events_wq = alloc_workqueue("kgsl-events",
|
||||
WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
|
||||
|
||||
@ -5154,8 +5137,6 @@ void kgsl_device_platform_remove(struct kgsl_device *device)
|
||||
kgsl_pwrctrl_uninit_sysfs(device);
|
||||
|
||||
pm_qos_remove_request(&device->pwrctrl.pm_qos_req_dma);
|
||||
if (device->pwrctrl.l2pc_cpus_mask)
|
||||
pm_qos_remove_request(&device->pwrctrl.l2pc_cpus_qos);
|
||||
|
||||
idr_destroy(&device->context_idr);
|
||||
|
||||
|
@ -572,35 +572,6 @@ void kgsl_pwrctrl_set_constraint(struct kgsl_device *device,
|
||||
}
|
||||
EXPORT_SYMBOL(kgsl_pwrctrl_set_constraint);
|
||||
|
||||
/**
|
||||
* kgsl_pwrctrl_update_l2pc() - Update existing qos request
|
||||
* @device: Pointer to the kgsl_device struct
|
||||
* @timeout_us: the effective duration of qos request in usecs.
|
||||
*
|
||||
* Updates an existing qos request to avoid L2PC on the
|
||||
* CPUs (which are selected through dtsi) on which GPU
|
||||
* thread is running. This would help for performance.
|
||||
*/
|
||||
void kgsl_pwrctrl_update_l2pc(struct kgsl_device *device,
|
||||
unsigned long timeout_us)
|
||||
{
|
||||
int cpu;
|
||||
|
||||
if (device->pwrctrl.l2pc_cpus_mask == 0)
|
||||
return;
|
||||
|
||||
cpu = get_cpu();
|
||||
put_cpu();
|
||||
|
||||
if ((1 << cpu) & device->pwrctrl.l2pc_cpus_mask) {
|
||||
pm_qos_update_request_timeout(
|
||||
&device->pwrctrl.l2pc_cpus_qos,
|
||||
device->pwrctrl.pm_qos_cpu_mask_latency,
|
||||
timeout_us);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(kgsl_pwrctrl_update_l2pc);
|
||||
|
||||
static ssize_t kgsl_pwrctrl_thermal_pwrlevel_store(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
@ -2229,13 +2200,6 @@ int kgsl_pwrctrl_init(struct kgsl_device *device)
|
||||
|
||||
pwr->power_flags = 0;
|
||||
|
||||
kgsl_property_read_u32(device, "qcom,l2pc-cpu-mask",
|
||||
&pwr->l2pc_cpus_mask);
|
||||
|
||||
pwr->l2pc_update_queue = of_property_read_bool(
|
||||
device->pdev->dev.of_node,
|
||||
"qcom,l2pc-update-queue");
|
||||
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
|
||||
ocmem_bus_node = of_find_node_by_name(
|
||||
@ -2904,10 +2868,6 @@ _slumber(struct kgsl_device *device)
|
||||
kgsl_pwrctrl_set_state(device, KGSL_STATE_SLUMBER);
|
||||
pm_qos_update_request(&device->pwrctrl.pm_qos_req_dma,
|
||||
PM_QOS_DEFAULT_VALUE);
|
||||
if (device->pwrctrl.l2pc_cpus_mask)
|
||||
pm_qos_update_request(
|
||||
&device->pwrctrl.l2pc_cpus_qos,
|
||||
PM_QOS_DEFAULT_VALUE);
|
||||
break;
|
||||
case KGSL_STATE_SUSPEND:
|
||||
complete_all(&device->hwaccess_gate);
|
||||
|
@ -57,19 +57,6 @@
|
||||
#define KGSL_PWR_DEL_LIMIT 1
|
||||
#define KGSL_PWR_SET_LIMIT 2
|
||||
|
||||
/*
|
||||
* The effective duration of qos request in usecs at queue time.
|
||||
* After timeout, qos request is cancelled automatically.
|
||||
* Kept 80ms default, inline with default GPU idle time.
|
||||
*/
|
||||
#define KGSL_L2PC_QUEUE_TIMEOUT (80 * 1000)
|
||||
|
||||
/*
|
||||
* The effective duration of qos request in usecs at wakeup time.
|
||||
* After timeout, qos request is cancelled automatically.
|
||||
*/
|
||||
#define KGSL_L2PC_WAKEUP_TIMEOUT (10 * 1000)
|
||||
|
||||
enum kgsl_pwrctrl_timer_type {
|
||||
KGSL_PWR_IDLE_TIMER,
|
||||
};
|
||||
@ -149,9 +136,6 @@ struct kgsl_regulator {
|
||||
* @ahbpath_pcl - CPU to AHB path bus scale identifier
|
||||
* @irq_name - resource name for the IRQ
|
||||
* @clk_stats - structure of clock statistics
|
||||
* @l2pc_cpus_mask - mask to avoid L2PC on masked CPUs
|
||||
* @l2pc_update_queue - Boolean flag to avoid L2PC on masked CPUs at queue time
|
||||
* @l2pc_cpus_qos - qos structure to avoid L2PC on CPUs
|
||||
* @pm_qos_req_dma - the power management quality of service structure
|
||||
* @pm_qos_active_latency - allowed CPU latency in microseconds when active
|
||||
* @pm_qos_cpu_mask_latency - allowed CPU mask latency in microseconds
|
||||
@ -208,9 +192,6 @@ struct kgsl_pwrctrl {
|
||||
uint32_t ahbpath_pcl;
|
||||
const char *irq_name;
|
||||
struct kgsl_clk_stats clk_stats;
|
||||
unsigned int l2pc_cpus_mask;
|
||||
bool l2pc_update_queue;
|
||||
struct pm_qos_request l2pc_cpus_qos;
|
||||
struct pm_qos_request pm_qos_req_dma;
|
||||
unsigned int pm_qos_active_latency;
|
||||
unsigned int pm_qos_cpu_mask_latency;
|
||||
@ -282,7 +263,5 @@ int kgsl_active_count_wait(struct kgsl_device *device, int count);
|
||||
void kgsl_pwrctrl_busy_time(struct kgsl_device *device, u64 time, u64 busy);
|
||||
void kgsl_pwrctrl_set_constraint(struct kgsl_device *device,
|
||||
struct kgsl_pwr_constraint *pwrc, uint32_t id);
|
||||
void kgsl_pwrctrl_update_l2pc(struct kgsl_device *device,
|
||||
unsigned long timeout_us);
|
||||
void kgsl_pwrctrl_set_default_gpu_pwrlevel(struct kgsl_device *device);
|
||||
#endif /* __KGSL_PWRCTRL_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user