From 7b2c91efe3668f88c4af3840044fe67f4d1466f6 Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Sat, 26 Dec 2020 13:31:31 -0800 Subject: [PATCH] drm/msm/sde: Remove unneeded PM QoS requests These are blocking some CPUs in the LITTLE cluster from entering deep idle because the driver assumes that display rendering work occurs on a hardcoded set of CPUs, which is false. The scope of this is also quite large, which increases power consumption. Signed-off-by: Sultan Alsawaf Signed-off-by: Ruchit --- drivers/gpu/drm/msm/sde/sde_encoder.c | 46 --------------------------- 1 file changed, 46 deletions(-) diff --git a/drivers/gpu/drm/msm/sde/sde_encoder.c b/drivers/gpu/drm/msm/sde/sde_encoder.c index b4f3e78d0eff..002524288add 100755 --- a/drivers/gpu/drm/msm/sde/sde_encoder.c +++ b/drivers/gpu/drm/msm/sde/sde_encoder.c @@ -234,7 +234,6 @@ enum sde_enc_rc_states { * @recovery_events_enabled: status of hw recovery feature enable by client * @elevated_ahb_vote: increase AHB bus speed for the first frame * after power collapse - * @pm_qos_cpu_req: pm_qos request for cpu frequency */ struct sde_encoder_virt { struct drm_encoder base; @@ -297,49 +296,10 @@ struct sde_encoder_virt { bool recovery_events_enabled; bool elevated_ahb_vote; - struct pm_qos_request pm_qos_cpu_req; }; #define to_sde_encoder_virt(x) container_of(x, struct sde_encoder_virt, base) -static void _sde_encoder_pm_qos_add_request(struct drm_encoder *drm_enc, - struct sde_kms *sde_kms) -{ - struct sde_encoder_virt *sde_enc = to_sde_encoder_virt(drm_enc); - struct pm_qos_request *req; - u32 cpu_mask; - u32 cpu_dma_latency; - int cpu; - - if (!sde_kms->catalog || !sde_kms->catalog->perf.cpu_mask) - return; - - cpu_mask = sde_kms->catalog->perf.cpu_mask; - cpu_dma_latency = sde_kms->catalog->perf.cpu_dma_latency; - - req = &sde_enc->pm_qos_cpu_req; - req->type = PM_QOS_REQ_AFFINE_CORES; - cpumask_empty(&req->cpus_affine); - for_each_possible_cpu(cpu) { - if ((1 << cpu) & cpu_mask) - cpumask_set_cpu(cpu, &req->cpus_affine); - } - pm_qos_add_request(req, PM_QOS_CPU_DMA_LATENCY, cpu_dma_latency); - - SDE_EVT32_VERBOSE(DRMID(drm_enc), cpu_mask, cpu_dma_latency); -} - -static void _sde_encoder_pm_qos_remove_request(struct drm_encoder *drm_enc, - struct sde_kms *sde_kms) -{ - struct sde_encoder_virt *sde_enc = to_sde_encoder_virt(drm_enc); - - if (!sde_kms->catalog || !sde_kms->catalog->perf.cpu_mask) - return; - - pm_qos_remove_request(&sde_enc->pm_qos_cpu_req); -} - static struct drm_connector_state *_sde_encoder_get_conn_state( struct drm_encoder *drm_enc) { @@ -2302,13 +2262,7 @@ static int _sde_encoder_resource_control_helper(struct drm_encoder *drm_enc, /* enable all the irq */ _sde_encoder_irq_control(drm_enc, true); - if (is_cmd_mode) - _sde_encoder_pm_qos_add_request(drm_enc, sde_kms); - } else { - if (is_cmd_mode) - _sde_encoder_pm_qos_remove_request(drm_enc, sde_kms); - /* disable all the irq */ _sde_encoder_irq_control(drm_enc, false);