diff options
author | Laurentiu Palcu <laurentiu.palcu@nxp.com> | 2018-07-12 10:29:38 +0300 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 7b9f0fe46c8469d156f1aabe997e1462f890edbf (patch) | |
tree | d74bd2a1cbce167b823a93ad2dd30d36142c25a9 /drivers/gpu/imx | |
parent | 3f9f3f2d38ab2709ee957bf2e09113ab8d76f060 (diff) |
MLK-18873: drm: imx: dcss: request PM QoS only when VBLANK is on
DCSS needs PM QoS in order to keep interrupt latency low. Otherwise,
page flipping will not work smooth enough because CTXLD will not be
triggered in time.
Currently, PM QoS is requested all the time but that does not allow the
CPUs to go idle. Hence, this leads to increased power consumption.
This patch will change how PM QoS is requested by doing it only when
VBLANK is enabled/disabled. The VBLANK interrupt is enabled just before
a commit takes place and disabled after one second after last commit.
This will allow DCSS to function properly and, also, allow CPUs to go
idle whenever there's no buffer submitted.
Exception to this is when DTRC is used (when DCSS is passed tiled
buffers). In this case, PM QoS will always be active, even if no buffer
is submitted, because DTRC banks need to be switched in CTXLD ISR, so
that DCSS does not underrun. DTRC does not have the REPEAT feature, as
the rest of DCSS does.
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
Diffstat (limited to 'drivers/gpu/imx')
-rw-r--r-- | drivers/gpu/imx/dcss/dcss-common.c | 25 | ||||
-rw-r--r-- | drivers/gpu/imx/dcss/dcss-prv.h | 1 |
2 files changed, 18 insertions, 8 deletions
diff --git a/drivers/gpu/imx/dcss/dcss-common.c b/drivers/gpu/imx/dcss/dcss-common.c index 2a4c4064fe25..6aeb99340b4e 100644 --- a/drivers/gpu/imx/dcss/dcss-common.c +++ b/drivers/gpu/imx/dcss/dcss-common.c @@ -611,6 +611,23 @@ static int dcss_remove(struct platform_device *pdev) return 0; } +void dcss_req_pm_qos(struct dcss_soc *dcss, bool en) +{ + if (en && !dcss->pm_req_active) { + pm_qos_add_request(&dcss->pm_qos_req, + PM_QOS_CPU_DMA_LATENCY, 0); + dcss->pm_req_active = true; + return; + } + + if (dcss_dtrc_is_running(dcss, 1) || dcss_dtrc_is_running(dcss, 2)) + return; + + pm_qos_remove_request(&dcss->pm_qos_req); + dcss->pm_req_active = false; +} +EXPORT_SYMBOL(dcss_req_pm_qos); + #ifdef CONFIG_PM_SLEEP static int dcss_suspend(struct device *dev) { @@ -627,8 +644,6 @@ static int dcss_suspend(struct device *dev) dcss_clocks_enable(dcss, false); - pm_qos_remove_request(&dcss->pm_qos_req); - dcss_bus_freq(dcss, false); return 0; @@ -644,8 +659,6 @@ static int dcss_resume(struct device *dev) dcss_bus_freq(dcss, true); - pm_qos_add_request(&dcss->pm_qos_req, PM_QOS_CPU_DMA_LATENCY, 0); - dcss_clocks_enable(dcss, true); dcss_blkctl_cfg(dcss); @@ -669,8 +682,6 @@ static int dcss_runtime_suspend(struct device *dev) dcss_clocks_enable(dcss, false); - pm_qos_remove_request(&dcss->pm_qos_req); - dcss_bus_freq(dcss, false); return 0; @@ -683,8 +694,6 @@ static int dcss_runtime_resume(struct device *dev) dcss_bus_freq(dcss, true); - pm_qos_add_request(&dcss->pm_qos_req, PM_QOS_CPU_DMA_LATENCY, 0); - dcss_clocks_enable(dcss, true); dcss_blkctl_cfg(dcss); diff --git a/drivers/gpu/imx/dcss/dcss-prv.h b/drivers/gpu/imx/dcss/dcss-prv.h index e8c6f08f5184..4e5ddc2622d5 100644 --- a/drivers/gpu/imx/dcss/dcss-prv.h +++ b/drivers/gpu/imx/dcss/dcss-prv.h @@ -61,6 +61,7 @@ struct dcss_soc { bool clks_on; struct pm_qos_request pm_qos_req; + bool pm_req_active; }; /* BLKCTL */ |