search for: vid_set

Displaying 20 results from an estimated 20 matches for "vid_set".

2016 Mar 21
0
[PATCH v2 16/22] volt: don't require perfect fit
...km_subdev *subdev = &volt->subdev; - int i, ret = -EINVAL; + int i, ret = -EINVAL, err, best = -1; if (volt->func->volt_set) return volt->func->volt_set(volt, uv); for (i = 0; i < volt->vid_nr; i++) { - if (volt->vid[i].uv == uv) { - ret = volt->func->vid_set(volt, volt->vid[i].vid); + if (i == 0) { + best = 0; + err = volt->vid[i].uv - uv; + } else { + int new_err = volt->vid[i].uv - uv; + if (abs(new_err) < abs(err) + || (err < 0 && new_err >= 0)) { + best = i; + err = new_err; + } + } + + if (err ==...
2014 Jan 02
0
[PATCH] drm/nvc0-: Fix voltage obtained from vbios.
...volt/base.c b/drivers/gpu/drm/nouveau/core/subdev/volt/base.c index 32794a999106..7bf716b048bd 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/volt/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/volt/base.c @@ -50,12 +50,23 @@ nouveau_volt_set(struct nouveau_volt *volt, u32 uv) { if (volt->vid_set) { int i, ret = -EINVAL; + u32 best_uv = INT_MAX, best_vid = 0; + for (i = 0; i < volt->vid_nr; i++) { - if (volt->vid[i].uv == uv) { - ret = volt->vid_set(volt, volt->vid[i].vid); - nv_debug(volt, "set %duv: %d\n", uv, ret); + s32 delta = volt->vid[i].u...
2016 Apr 18
0
[PATCH v4 16/37] volt: don't require perfect fit
...*subdev = &volt->subdev; - int i, ret = -EINVAL; + int i, ret = -EINVAL, best_err = uv, best = -1; if (volt->func->volt_set) return volt->func->volt_set(volt, uv); for (i = 0; i < volt->vid_nr; i++) { - if (volt->vid[i].uv == uv) { - ret = volt->func->vid_set(volt, volt->vid[i].vid); - nvkm_debug(subdev, "set %duv: %d\n", uv, ret); + int err = volt->vid[i].uv - uv; + if (err < 0 || err > best_err) + continue; + + best_err = err; + best = i; + if (best_err == 0) break; - } } + + if (best == -1) { + nvkm_error(subdev...
2019 Jan 13
1
[PATCH v2] drm/nouveau/volt/gf117: fix speedo readout register
...{ + struct nvkm_device *device = volt->subdev.device; + struct nvkm_fuse *fuse = device->fuse; + + if (!fuse) + return -EINVAL; + + return nvkm_fuse_read(fuse, 0x3a8); +} + +static const struct nvkm_volt_func +gf117_volt = { + .oneinit = gf100_volt_oneinit, + .vid_get = nvkm_voltgpio_get, + .vid_set = nvkm_voltgpio_set, + .speedo_read = gf117_volt_speedo_read, +}; + +int +gf117_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt) +{ + struct nvkm_volt *volt; + int ret; + + ret = nvkm_volt_new_(&gf117_volt, device, index, &volt); + *pvolt = volt; + if (ret) + retur...
2016 Apr 18
0
[PATCH v4 18/37] volt: add speedo
...} int diff --git a/drm/nouveau/nvkm/subdev/volt/priv.h b/drm/nouveau/nvkm/subdev/volt/priv.h index d5140d9..9b34e9f 100644 --- a/drm/nouveau/nvkm/subdev/volt/priv.h +++ b/drm/nouveau/nvkm/subdev/volt/priv.h @@ -14,6 +14,7 @@ struct nvkm_volt_func { int (*vid_get)(struct nvkm_volt *); int (*vid_set)(struct nvkm_volt *, u8 vid); int (*set_id)(struct nvkm_volt *, u8 id, int condition); + int (*speedo_read)(struct nvkm_volt *); }; int nvkm_voltgpio_init(struct nvkm_volt *); -- 2.8.1
2016 Apr 18
0
[PATCH v4 36/37] WIP volt/gk104: readout speedo
...vkm_fuse_read(fuse, 0x3a8); + nvkm_wr32(device, 0x122634, 0x41); + return ret; +} + static const struct nvkm_volt_func gk104_volt_pwm = { .volt_get = gk104_volt_get, .volt_set = gk104_volt_set, + .speedo_read = gk104_volt_speedo_read, }, gk104_volt_gpio = { .vid_get = nvkm_voltgpio_get, .vid_set = nvkm_voltgpio_set, + .speedo_read = gk104_volt_speedo_read, }; int -- 2.8.1
2016 Mar 21
28
[PATCH v2 00/22] Volting/Clocking improvements for Fermi and newer
This series fixes most of the issues regarding volting on GPUs with any form of GPU Boost inside their vbios, which is mainly Kepler and newer, but we find some boosting related tables in Fermi vbios' already In the end reclocking should work on most Kepler cards without any issues v2: boost_mode can now be changed at runtime minor fixups Karol Herbst (22): bios/volt: handle voltage
2016 Apr 18
0
[PATCH v4 19/37] volt: add gf100 subdev with speedo
...do_read(struct nvkm_volt *volt) +{ + struct nvkm_device *device = volt->subdev.device; + struct nvkm_fuse *fuse = device->fuse; + + if (!fuse) + return -EINVAL; + + return nvkm_fuse_read(fuse, 0x1cc); +} + +static const struct nvkm_volt_func +gf100_volt = { + .vid_get = nvkm_voltgpio_get, + .vid_set = nvkm_voltgpio_set, + .speedo_read = gf100_volt_speedo_read, +}; + +int +gf100_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt) +{ + struct nvkm_volt *volt; + int ret; + + ret = nvkm_volt_new_(&gf100_volt, device, index, &volt); + *pvolt = volt; + if (ret) + retur...
2016 Aug 16
21
[PATCH v5 00/20] Engine Reclocking Fixes for Fermi-Maxwell2
I've splitted my big series between the part which actually fixes the engine reclocking bits and the part handling voltage/clock updates on temperature change, so that the more reviewed parts can be merged in faster. This series fixes a lot of Engine reclocking issues found on Fermi, Kepler and all Maxwell generation GPUs. It does _not_ fix memory reclocking on Fermi. It mostly contains of
2014 Nov 28
0
[PATCH 2/2] volt: add support for GK20A
...+gk20a_volt_vid_get(struct nouveau_volt *volt) +{ + struct gk20a_volt_priv *priv = (void *)volt; + int i, uv; + + uv = regulator_get_voltage(priv->vdd); + + for (i = 0; i < volt->vid_nr; i++) + if (volt->vid[i].uv >= uv) + return i; + + return -EINVAL; +} + +static int +gk20a_volt_vid_set(struct nouveau_volt *volt, u8 vid) +{ + struct gk20a_volt_priv *priv = (void *)volt; + + nv_debug(volt, "set voltage as %duv\n", volt->vid[vid].uv); + return regulator_set_voltage(priv->vdd, volt->vid[vid].uv, 1200000); +} + +static int +gk20a_volt_set_id(struct nouveau_volt *vol...
2014 Nov 28
0
[RESEND PATCH nouveau 3/3] volt: add support for GK20A
...+gk20a_volt_vid_get(struct nouveau_volt *volt) +{ + struct gk20a_volt_priv *priv = (void *)volt; + int i, uv; + + uv = regulator_get_voltage(priv->vdd); + + for (i = 0; i < volt->vid_nr; i++) + if (volt->vid[i].uv >= uv) + return i; + + return -EINVAL; +} + +static int +gk20a_volt_vid_set(struct nouveau_volt *volt, u8 vid) +{ + struct gk20a_volt_priv *priv = (void *)volt; + + nv_debug(volt, "set voltage as %duv\n", volt->vid[vid].uv); + return regulator_set_voltage(priv->vdd, volt->vid[vid].uv, 1200000); +} + +static int +gk20a_volt_set_id(struct nouveau_volt *vol...
2014 Nov 28
2
[RESEND PATCH nouveau 3/3] volt: add support for GK20A
...volt_priv *priv = (void *)volt; > + int i, uv; > + > + uv = regulator_get_voltage(priv->vdd); > + > + for (i = 0; i < volt->vid_nr; i++) > + if (volt->vid[i].uv >= uv) > + return i; > + > + return -EINVAL; > +} > + > +static int > +gk20a_volt_vid_set(struct nouveau_volt *volt, u8 vid) > +{ > + struct gk20a_volt_priv *priv = (void *)volt; > + > + nv_debug(volt, "set voltage as %duv\n", volt->vid[vid].uv); > + return regulator_set_voltage(priv->vdd, volt->vid[vid].uv, 1200000); > +} > + > +static int &gt...
2014 Nov 28
8
[RESEND V2 PATCH 1/3] soc/tegra: fuse: export tegra_sku_info for module use
Some Tegra drivers might be complied as kernel modules, and they need the fuse information for initialization. One example is the GK20A Nouveau driver. It needs the GPU speedo value to calculate frequency-voltage table. So export the tegra_sku_info. Signed-off-by: Vince Hsu <vinceh at nvidia.com> --- v2: add more description why we need this patch drivers/soc/tegra/fuse/fuse-tegra.c | 1
2014 Nov 28
0
[RESEND PATCH nouveau 3/3] volt: add support for GK20A
...uv = regulator_get_voltage(priv->vdd); >> + >> + for (i = 0; i < volt->vid_nr; i++) >> + if (volt->vid[i].uv >= uv) >> + return i; >> + >> + return -EINVAL; >> +} >> + >> +static int >> +gk20a_volt_vid_set(struct nouveau_volt *volt, u8 vid) >> +{ >> + struct gk20a_volt_priv *priv = (void *)volt; >> + >> + nv_debug(volt, "set voltage as %duv\n", volt->vid[vid].uv); >> + return regulator_set_voltage(priv->vdd, volt->vid[vid].uv, >> 120000...
2014 Nov 28
2
[PATCH 1/2] volt: allow non-bios voltage scaling
Signed-off-by: Vince Hsu <vinceh at nvidia.com> --- nvkm/subdev/volt/base.c | 67 ++++++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/nvkm/subdev/volt/base.c b/nvkm/subdev/volt/base.c index 32794a999106..26ccd8df193f 100644 --- a/nvkm/subdev/volt/base.c +++ b/nvkm/subdev/volt/base.c @@ -101,6 +101,41 @@ nouveau_volt_set_id(struct
2014 Dec 01
2
[V3 PATCH 1/3] soc/tegra: fuse: export tegra_sku_info
Some Tegra drivers might be compiled as kernel modules, and they need the fuse information for initialization. One example is the GK20A Nouveau driver. It needs the GPU speedo value to calculate frequency-voltage table. So export the tegra_sku_info. Signed-off-by: Vince Hsu <vinceh at nvidia.com> Acked-by: Alexandre Courbot <acourbot at nvidia.com> Acked-by: Thierry Reding <treding
2014 Dec 02
3
[V3 PATCH 1/4] soc/tegra: fuse: export tegra_sku_info
Some Tegra drivers might be compiled as kernel modules, and they need the fuse information for initialization. One example is the GK20A Nouveau driver. It needs the GPU speedo value to calculate frequency-voltage table. So export the tegra_sku_info. Signed-off-by: Vince Hsu <vinceh at nvidia.com> Acked-by: Alexandre Courbot <acourbot at nvidia.com> Acked-by: Thierry Reding <treding
2016 Apr 18
63
[PATCH v4 00/37] Volting/Clocking improvements for Fermi and newer
We are slowly getting there! v4 of the series with some realy good improvements, so I am sure this is like 95% done and only needs some proper polishing and proper Reviews! I also added the NvVoltOffsetmV module parameter, so that a user is able to over and !under!-volt the GPU. Overvolting makes sense, when there are still some reclocking issues left, which might be solved by a higher voltage.
2016 Mar 17
22
[PATCH 00/19] Volting/Clocking improvements for Fermi and newer
This series fixes most of the issues regarding volting on GPUs with any form of GPU Boost inside their vbios, which is mainly Kepler and newer, but we find some boosting related tables in Fermi vbios' already In the end reclocking should work on most Kepler cards without any issues Karol Herbst (19): bios/volt: handle voltage table version 0x50 with 0ed header volt: properly detect entry
2016 Apr 07
29
[PATCH v3 00/29] Volting/Clocking improvements for Fermi and newer
This is an updated series for the old clocking improvement one. I think I got everything needed in place and also a simple update mechanism for updating the cstates/voltage on temperature changes. If anything is unclear how I REed or got the information, please leave a note so that I can provide additional information in the commits. Besides that I think we are pretty close now and only some