drm/nouveau: Add support for basic clockgating on Kepler1
authorLyude Paul <lyude@redhat.com>
Thu, 1 Feb 2018 18:13:55 +0000 (13:13 -0500)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 2 Feb 2018 05:24:08 +0000 (15:24 +1000)
commitb138eca661ccee2b43f8ef3cfd952a5c71c1dc90
tree3f423a690a37041f9e062c8c35804a3d4fc05ae7
parentf4778f08a038d48ab8528416a51bf7ad231f9cc1
drm/nouveau: Add support for basic clockgating on Kepler1

This adds support for enabling automatic clockgating on nvidia GPUs for
Kepler1. While this is not technically a clockgating level, it does
enable clockgating using the clockgating values initially set by the
vbios (which should be safe to use).

This introduces two therm helpers for controlling basic clockgating:
nvkm_therm_clkgate_enable() - enables clockgating through
CG_CTRL, done after initializing the GPU fully
nvkm_therm_clkgate_fini() - prepares clockgating for suspend or
driver unload

A lot of this code was originally going to be based off of fermi;
however it turns out that while Fermi's the first line of GPUs that
introduced this kind of power saving, Fermi requires more fine tuned
control of the CG_CTRL registers from the driver while reclocking that
we don't entirely understand yet.

For the simple parts we will be sharing with Fermi for certain however,
we at least add those into a new subdev/therm/gf100.h header.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/subdev/therm.h
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/therm/Kbuild
drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c
drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf100.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf119.c
drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/subdev/therm/priv.h