History log of /linux-master/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c
Revision Date Author Comments
# d07be5d7 03-Dec-2020 Ben Skeggs <bskeggs@redhat.com>

drm/nouveau/volt: switch to instanced constructor

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>


# ff535412 17-Nov-2016 Ben Skeggs <bskeggs@redhat.com>

drm/nouveau/bios/volt: pointers are 32-bit

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 60fb7064 17-Nov-2016 Ben Skeggs <bskeggs@redhat.com>

drm/nouveau/bios/vmap: pointers are 32-bit

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 321c258e 16-Sep-2016 Alexandre Courbot <acourbot@nvidia.com>

drm/nouveau/volt: use kernel's 64-bit signed division function

Doing direct 64 bit divisions in kernel code leads to references to
undefined symbols on 32 bit architectures. Replace such divisions with
calls to div64_s64 to make the module usable on 32 bit archs.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Karol Herbst <karolherbst@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 114653c7 12-Jul-2016 Karol Herbst <karolherbst@gmail.com>

drm/nouveau/volt: Make use of cvb coefficients

I'm quite sure that those coefficients are real close, because while
testing the biggest error compared to nvidia was around -1.5% (biggest
error with right coefficients is 12.5mV / 600mV = 2%).

These coefficients were REed by modifing the voltage map entries and by
calculating the set voltage back until I was able to forecast which voltage
nvidia sets for a given voltage map entry.

With these formulars I am able to precisely predict at which exact
temperature Nvidia down- or upvolts due to a changed therm reading.

That's why I am quite sure these are right, or at least really really
close.

v4: Use better coefficients and speedo.
v5: Add error message when speedo is missing.

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 08de5743 17-Jul-2016 Karol Herbst <karolherbst@gmail.com>

drm/nouveau/volt/gf100-: Add speedo

v5: Squashed speedo related commits.

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 5e00e326 12-Jul-2016 Karol Herbst <karolherbst@gmail.com>

drm/nouveau/volt: Don't require perfect fit

If we calculate the voltage in the table right, we get all kinds of values,
which never fit the hardware steps, so we use the closest higher value the
hardware can do.

v3: Simplify the implementation.
v5: Initialize best_err with volt->max_uv.

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 1f7f3d91 16-Jul-2016 Karol Herbst <karolherbst@gmail.com>

drm/nouveau/clk: Respect voltage limits in nvkm_cstate_prog

We should never allow to select a cstate which current voltage (depending
on the temperature) is higher than

1. the max volt entries in the voltage map table.
2. what tha gpu actually can volt to.

v3: Use find_best for all cstates before actually trying.
Add nvkm_cstate_get function to get cstate by index.
v5: Cstates with voltages lower then min_uv are valid.
Move nvkm_cstate_get into the previous commit.

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 8d08c264 12-Jul-2016 Karol Herbst <karolherbst@gmail.com>

drm/nouveau/volt: Add temperature parameter to nvkm_volt_map

The voltage entries actually may map to a different voltage depending on
the current temperature.

v2: Only read the temperature when actually needed.
v5: Be smarter about using max().
Don't read the temperature anymore.

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# fa6c4d8e 12-Jul-2016 Karol Herbst <karolherbst@gmail.com>

drm/nouveau/volt: Add min_id parameter to nvkm_volt_set_id

Each pstate has its own voltage map entry like each cstate has.

The voltages of those entries act as a floor value for the currently
selected pstate and nvidia never sets a voltage below them.

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 4a4555a7 12-Jul-2016 Karol Herbst <karolherbst@gmail.com>

drm/nouveau/volt: Parse the max voltage map entries

There are at least three "max" entries, which specify the max voltage.
Because they are actually normal voltage map entries, they can also be
affected by the temperature.

Nvidia respects those entries and if they get changed, nvidia uses the
lower voltage from all three.

We shouldn't exceed those voltages at any given time.

v2: State what those entries do in the source.
v3: Add the third max entry.
v5: Better describe the entries.

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 17d063db 12-Jul-2016 Karol Herbst <karolherbst@gmail.com>

drm/nouveau/clk: Don't create cstates with voltages higher than what the gpu can do

nvkm_volt_map_min is a copy of nvkm_volt_map, which always returns the
lowest possible voltage for a cstate.

nvkm_volt_map will get a temperature parameter there later and also fix
the voltage calculation, so that this functions will be completly
different later.

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Tested-by: Pierre Moreau <pierre.morrow@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 17f486de 12-Jul-2016 Karol Herbst <karolherbst@gmail.com>

drm/nouveau/volt: Properly detect entry based voltage tables

There is a field in the voltage table which tells us if the VIDs are taken
from the entries or calculated through the header.

v2: Don't break older versions.
v5: Reverse flag name.

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Tested-by: Pierre Moreau <pierre.morrow@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 437bb44d 25-Feb-2016 Karol Herbst <nouveau@karolherbst.de>

drm/nouveau/volt: save the voltage range we are able to set

We shouldn't set voltages below the min or above the max voltage the gpu is
able to set, so save the range for future lookups.

Signed-off-by: Karol Herbst <karolherbst@gmail.de>
Reviewed-by: Martin Peres <martin.peres@free.fr>
Tested-by: Pierre Moreau <pierre.morrow@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 56d06fa2 08-Apr-2016 Ben Skeggs <bskeggs@redhat.com>

drm/nouveau/core: remove pmc_enable argument from subdev ctor

These are now specified directly in the MC subdev.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 4c58a05b 08-Sep-2015 Martin Peres <martin.peres@free.fr>

drm/nouveau/volt: add support for non-vid-based voltage controllers

This patch is not ideal but it definitely beats a rewrite of the current
interface and is very self-contained.

Signed-off-by: Martin Peres <martin.peres@free.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 437b2296 19-Aug-2015 Ben Skeggs <bskeggs@redhat.com>

drm/nouveau/volt: convert to new-style nvkm_subdev

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 46484438 19-Aug-2015 Ben Skeggs <bskeggs@redhat.com>

drm/nouveau/bios: convert to new-style nvkm_subdev

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 3a8c3400 19-Aug-2015 Ben Skeggs <bskeggs@redhat.com>

drm/nouveau/subdev: rename some functions to avoid upcoming conflicts

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 185eda33 19-Aug-2015 Ben Skeggs <bskeggs@redhat.com>

drm/nouveau/volt: switch to subdev printk macros

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# 6052dc57 19-Aug-2015 Ben Skeggs <bskeggs@redhat.com>

drm/nouveau/volt: cosmetic changes

This is purely preparation for upcoming commits, there should be no
code changes here.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# de3aaa66 13-Jan-2015 Ben Skeggs <bskeggs@redhat.com>

drm/nouveau/volt: namespace + nvidia gpu names (no binary change)

The namespace of NVKM is being changed to nvkm_ instead of nouveau_,
which will be used for the DRM part of the driver. This is being
done in order to make it very clear as to what part of the driver a
given symbol belongs to, and as a minor step towards splitting the
DRM driver out to be able to stand on its own (for virt).

Because there's already a large amount of churn here anyway, this is
as good a time as any to also switch to NVIDIA's device and chipset
naming to ease collaboration with them.

A comparison of objdump disassemblies proves no code changes.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>


# c39f472e 13-Jan-2015 Ben Skeggs <bskeggs@redhat.com>

drm/nouveau: remove symlinks, move core/ to nvkm/ (no code changes)

The symlinks were annoying some people, and they're not used anywhere
else in the kernel tree. The include directory structure has been
changed so that symlinks aren't needed anymore.

NVKM has been moved from core/ to nvkm/ to make it more obvious as to
what the directory is for, and as some minor prep for when NVKM gets
split out into its own module (virt) at a later date.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>