Re: [Nouveau] [RFC PATCH 12/13] clk: parse thermal policies for throttling thresholds

2017-07-21 Thread Karol Herbst
On Sat, Jul 22, 2017 at 2:23 AM, Ilia Mirkin wrote: > On Fri, Jul 21, 2017 at 5:55 PM, Karol Herbst wrote: >> Signed-off-by: Karol Herbst >> --- >> drm/nouveau/include/nvkm/subdev/clk.h | 2 ++ >>

Re: [Nouveau] [RFC PATCH 12/13] clk: parse thermal policies for throttling thresholds

2017-07-21 Thread Ilia Mirkin
On Fri, Jul 21, 2017 at 5:55 PM, Karol Herbst wrote: > Signed-off-by: Karol Herbst > --- > drm/nouveau/include/nvkm/subdev/clk.h | 2 ++ > drm/nouveau/nvkm/subdev/clk/base.c| 42 > +++ > 2 files changed, 44

[Nouveau] [RFC PATCH 12/13] clk: parse thermal policies for throttling thresholds

2017-07-21 Thread Karol Herbst
Signed-off-by: Karol Herbst --- drm/nouveau/include/nvkm/subdev/clk.h | 2 ++ drm/nouveau/nvkm/subdev/clk/base.c| 42 +++ 2 files changed, 44 insertions(+) diff --git a/drm/nouveau/include/nvkm/subdev/clk.h

[Nouveau] [RFC PATCH 10/13] therm: Trigger reclock in temperature daemon

2017-07-21 Thread Karol Herbst
Depending on the temperature, cstates might become unreachable or the maped voltage of a cstate changes. We want to adjust to that. Signed-off-by: Karol Herbst Reviewed-by: Martin Peres --- drm/nouveau/nvkm/subdev/therm/base.c | 7 +++ 1 file

[Nouveau] [RFC PATCH 09/13] therm: Move the temp readout into the alarm

2017-07-21 Thread Karol Herbst
It makes more sense to read out the temperature in the alarm, because we want to do various things with it: 1. adjust the fans 2. notify the clk subdev about the changed temperature Signed-off-by: Karol Herbst --- drm/nouveau/include/nvkm/subdev/therm.h | 1 +

[Nouveau] [RFC PATCH 08/13] therm: Don't cancel the timer

2017-07-21 Thread Karol Herbst
We will need a always running therm daemon to adjust the voltage/clocks on the fly. Signed-off-by: Karol Herbst Reviewed-by: Martin Peres --- drm/nouveau/nvkm/subdev/therm/base.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff

[Nouveau] [RFC PATCH 06/13] clk: Set clocks to pre suspend state after suspend

2017-07-21 Thread Karol Herbst
The idea is to clear out the saved state, because after a resume we can't know what the GPU is clocked to. The reclock is triggered by the call to nvkm_clk_update later in nvkm_clk_init. v2: convert to C style comments Signed-off-by: Karol Herbst Reviewed-by: Martin Peres

[Nouveau] [RFC PATCH 01/13] clk: Rename nvkm_pstate_calc to nvkm_clk_update and export it

2017-07-21 Thread Karol Herbst
This function will be used to update the current clock state. This will happen for various reasons: * Temperature changes * User changes clocking state * Load changes v2: remove parameter name Signed-off-by: Karol Herbst --- drm/nouveau/include/nvkm/subdev/clk.h |

[Nouveau] [RFC PATCH 03/13] clk: Make pstate a pointer to nvkm_pstate

2017-07-21 Thread Karol Herbst
We will access the current cstate at least every second and this saves us some CPU cycles looking them up every second. v2: Rewording commit message. Signed-off-by: Karol Herbst Reviewed-by: Martin Peres --- drm/nouveau/include/nvkm/subdev/clk.h |

[Nouveau] [RFC PATCH 00/13] Thermal throttling

2017-07-21 Thread Karol Herbst
Adds Nouveau controlled thermal throttling for Kepler+ GPUs. With this I feel safe enough to add support for Maxwell2 reclocking later on (still hidden behind a switch, but we can be fairly sure to not overheat hardware if a user isn't carefull enough) Contains all patches from my clk update

[Nouveau] [RFC PATCH 13/13] clk: thermal throttling

2017-07-21 Thread Karol Herbst
Signed-off-by: Karol Herbst --- drm/nouveau/include/nvkm/subdev/clk.h | 1 + drm/nouveau/nvkm/subdev/clk/base.c| 35 +++ 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/drm/nouveau/include/nvkm/subdev/clk.h

[Nouveau] [RFC PATCH 05/13] clk: We should pass the pstate id around not the index in the list

2017-07-21 Thread Karol Herbst
This makes the code easier, because we can compare the id with pstate->pstate and saves us from the trouble of iterating over the pstates to match the index. v2: reword commit message Signed-off-by: Karol Herbst Reviewed-by: Martin Peres ---

[Nouveau] [RFC PATCH 04/13] clk: Hold information about the current cstate status

2017-07-21 Thread Karol Herbst
Later we will have situations where the expected and the current state isn't the same. Signed-off-by: Karol Herbst Reviewed-by: Martin Peres --- drm/nouveau/include/nvkm/subdev/clk.h | 2 ++ drm/nouveau/nvkm/subdev/clk/base.c| 32

[Nouveau] [RFC PATCH 07/13] clk: Check pm_runtime status before reclocking

2017-07-21 Thread Karol Herbst
We don't want to change anything on the GPU if it's suspended. Also we need to increase the refcount on the pm_runtime counter so that the GPU won't be suspended while reclocking. v2: convert to C style comments Signed-off-by: Karol Herbst ---

[Nouveau] [RFC PATCH 11/13] bios: add thermal policies table

2017-07-21 Thread Karol Herbst
Signed-off-by: Karol Herbst --- .../include/nvkm/subdev/bios/thermal_policies.h| 27 drm/nouveau/nvkm/subdev/bios/Kbuild| 1 + drm/nouveau/nvkm/subdev/bios/thermal_policies.c| 81 ++ 3 files changed, 109 insertions(+)