Merge "drm/msm: Disable clocks when GPU is inactive"
This commit is contained in:
commit
b9b46f3610
2 changed files with 26 additions and 1 deletions
|
@ -15,6 +15,7 @@
|
||||||
#include "msm_iommu.h"
|
#include "msm_iommu.h"
|
||||||
#include "msm_trace.h"
|
#include "msm_trace.h"
|
||||||
#include "a5xx_gpu.h"
|
#include "a5xx_gpu.h"
|
||||||
|
#include <linux/clk/msm-clk.h>
|
||||||
|
|
||||||
#define SECURE_VA_START 0xc0000000
|
#define SECURE_VA_START 0xc0000000
|
||||||
#define SECURE_VA_SIZE SZ_256M
|
#define SECURE_VA_SIZE SZ_256M
|
||||||
|
@ -1169,6 +1170,17 @@ static int a5xx_pm_resume(struct msm_gpu *gpu)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Between suspend/resumes the GPU clocks need to be turned off
|
||||||
|
* but not a complete power down, typically between frames. Set the
|
||||||
|
* memory retention flags on the GPU core clock to retain memory
|
||||||
|
* across clock toggles.
|
||||||
|
*/
|
||||||
|
if (gpu->core_clk) {
|
||||||
|
clk_set_flags(gpu->core_clk, CLKFLAG_RETAIN_PERIPH);
|
||||||
|
clk_set_flags(gpu->core_clk, CLKFLAG_RETAIN_MEM);
|
||||||
|
}
|
||||||
|
|
||||||
/* Turn on the core power */
|
/* Turn on the core power */
|
||||||
ret = msm_gpu_pm_resume(gpu);
|
ret = msm_gpu_pm_resume(gpu);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -1208,6 +1220,12 @@ static int a5xx_pm_suspend(struct msm_gpu *gpu)
|
||||||
{
|
{
|
||||||
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
|
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
|
||||||
|
|
||||||
|
/* Turn off the memory retention flag when not necessary */
|
||||||
|
if (gpu->core_clk) {
|
||||||
|
clk_set_flags(gpu->core_clk, CLKFLAG_NORETAIN_PERIPH);
|
||||||
|
clk_set_flags(gpu->core_clk, CLKFLAG_NORETAIN_MEM);
|
||||||
|
}
|
||||||
|
|
||||||
/* Only do this next bit if we are about to go down */
|
/* Only do this next bit if we are about to go down */
|
||||||
if (gpu->active_cnt == 1) {
|
if (gpu->active_cnt == 1) {
|
||||||
/* Clear the VBIF pipe before shutting down */
|
/* Clear the VBIF pipe before shutting down */
|
||||||
|
|
|
@ -863,7 +863,14 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
|
||||||
gpu->dev = drm;
|
gpu->dev = drm;
|
||||||
gpu->funcs = funcs;
|
gpu->funcs = funcs;
|
||||||
gpu->name = name;
|
gpu->name = name;
|
||||||
gpu->inactive = true;
|
/*
|
||||||
|
* Set the inactive flag to false, so that when the retire worker
|
||||||
|
* kicks in from the init path, it knows that it has to turn off the
|
||||||
|
* clocks. This should be fine to do since this is the init sequence
|
||||||
|
* and we have an init_lock in msm_open() to protect against bad things
|
||||||
|
* from happening.
|
||||||
|
*/
|
||||||
|
gpu->inactive = false;
|
||||||
|
|
||||||
INIT_LIST_HEAD(&gpu->active_list);
|
INIT_LIST_HEAD(&gpu->active_list);
|
||||||
INIT_WORK(&gpu->retire_work, retire_worker);
|
INIT_WORK(&gpu->retire_work, retire_worker);
|
||||||
|
|
Loading…
Add table
Reference in a new issue