summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/etnaviv/etnaviv_gpu.h
diff options
context:
space:
mode:
authorRussell King2017-03-12 20:00:59 +0100
committerLucas Stach2017-03-29 15:53:53 +0200
commitbcdfb5e56dc539506f72e8087c993af1f7ff06eb (patch)
treeb01232ce0b4e7a46e2fe60df346b602882c82954 /drivers/gpu/drm/etnaviv/etnaviv_gpu.h
parentdrm/etnaviv: switch to postclose (diff)
downloadkernel-qcow2-linux-bcdfb5e56dc539506f72e8087c993af1f7ff06eb.tar.gz
kernel-qcow2-linux-bcdfb5e56dc539506f72e8087c993af1f7ff06eb.tar.xz
kernel-qcow2-linux-bcdfb5e56dc539506f72e8087c993af1f7ff06eb.zip
drm/etnaviv: add etnaviv cooling device
Each Vivante GPU contains a clock divider which can divide the GPU clock by 2^n, which can lower the power dissipation from the GPU. It has been suggested that the GC600 on Dove is responsible for 20-30% of the power dissipation from the SoC, so lowering the GPU clock rate provides a way to throttle the power dissiptation, and reduce the temperature when the SoC gets hot. This patch hooks the Etnaviv driver into the kernel's thermal management to allow the GPUs to be throttled when necessary, allowing a reduction in GPU clock rate from /1 to /64 in power of 2 steps. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/etnaviv/etnaviv_gpu.h')
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gpu.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.h b/drivers/gpu/drm/etnaviv/etnaviv_gpu.h
index 1c0606ea7d5e..6a1e68eec24c 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.h
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.h
@@ -97,6 +97,7 @@ struct etnaviv_cmdbuf;
struct etnaviv_gpu {
struct drm_device *drm;
+ struct thermal_cooling_device *cooling;
struct device *dev;
struct mutex lock;
struct etnaviv_chip_identity identity;
@@ -150,6 +151,7 @@ struct etnaviv_gpu {
u32 hangcheck_fence;
u32 hangcheck_dma_addr;
struct work_struct recover_work;
+ unsigned int freq_scale;
};
static inline void gpu_write(struct etnaviv_gpu *gpu, u32 reg, u32 data)