From: Martin Peres <martin.peres-GANU6spQydw@public.gmane.org>
To: Karol Herbst <nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>,
nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 05/19] clk: allow boosting only when NvBoost is set
Date: Sun, 20 Mar 2016 22:15:30 +0200 [thread overview]
Message-ID: <56EF04E2.40703@free.fr> (raw)
In-Reply-To: <1458255836-3878-6-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
On 18/03/16 01:03, Karol Herbst wrote:
> 0: base clock from the vbios is max clock
> 1: boost only to boost clock from the vbios (default)
> 2: boost to max clock available
> Signed-off-by: Karol Herbst <nouveau@karolherbst.de>
> ---
> drm/nouveau/include/nvkm/subdev/clk.h | 9 ++++++++-
> drm/nouveau/nvkm/subdev/clk/base.c | 26 ++++++++++++++++++++++++--
> drm/nouveau/nvkm/subdev/clk/gf100.c | 2 +-
> drm/nouveau/nvkm/subdev/clk/gk104.c | 2 +-
> 4 files changed, 34 insertions(+), 5 deletions(-)
>
> diff --git a/drm/nouveau/include/nvkm/subdev/clk.h b/drm/nouveau/include/nvkm/subdev/clk.h
> index fb54417..a292e5a 100644
> --- a/drm/nouveau/include/nvkm/subdev/clk.h
> +++ b/drm/nouveau/include/nvkm/subdev/clk.h
> @@ -67,7 +67,8 @@ struct nvkm_pstate {
> struct nvkm_domain {
> enum nv_clk_src name;
> u8 bios; /* 0xff for none */
> -#define NVKM_CLK_DOM_FLAG_CORE 0x01
> +#define NVKM_CLK_DOM_FLAG_CORE 0x01
> +#define NVKM_CLK_DOM_FLAG_BASECLK 0x02
> u8 flags;
> const char *mname;
> int mdiv;
> @@ -97,6 +98,12 @@ struct nvkm_clk {
> int dstate; /* display adjustment (min+) */
>
> bool allow_reclock;
> +#define NVKM_CLK_BOOST_NONE 0x0
> +#define NVKM_CLK_BOOST_AVG 0x1
> +#define NVKM_CLK_BOOST_FULL 0x2
> + u8 boost_mode;
> + u32 base_khz;
> + u32 boost_khz;
>
> /*XXX: die, these are here *only* to support the completely
> * bat-shit insane what-was-nouveau_hw.c code
> diff --git a/drm/nouveau/nvkm/subdev/clk/base.c b/drm/nouveau/nvkm/subdev/clk/base.c
> index 4928668..d575412 100644
> --- a/drm/nouveau/nvkm/subdev/clk/base.c
> +++ b/drm/nouveau/nvkm/subdev/clk/base.c
> @@ -160,6 +160,18 @@ nvkm_cstate_new(struct nvkm_clk *clk, int idx, struct nvkm_pstate *pstate)
> if (domain->flags & NVKM_CLK_DOM_FLAG_CORE) {
> u32 freq = nvkm_clk_adjust(clk, true, pstate->pstate,
> domain->bios, cstepX.freq);
> + if (domain->flags & NVKM_CLK_DOM_FLAG_BASECLK) {
> + switch (clk->boost_mode) {
> + case NVKM_CLK_BOOST_NONE:
> + if (clk->base_khz
> + && freq > clk->base_khz)
> + goto err;
> + case NVKM_CLK_BOOST_AVG:
> + if (clk->boost_khz
> + && freq > clk->boost_khz)
> + goto err;
> + }
> + }
> cstate->domain[domain->name] = freq;
> }
> domain++;
> @@ -167,6 +179,9 @@ nvkm_cstate_new(struct nvkm_clk *clk, int idx, struct nvkm_pstate *pstate)
>
> list_add(&cstate->head, &pstate->list);
> return 0;
> +err:
> + kfree(cstate);
> + return -EINVAL;
> }
>
> /******************************************************************************
> @@ -570,14 +585,21 @@ nvkm_clk_ctor(const struct nvkm_clk_func *func, struct nvkm_device *device,
>
> nvkm_subdev_ctor(&nvkm_clk, device, index, 0, subdev);
>
> + clk->boost_mode = nvkm_longopt(device->cfgopt, "NvBoost",
> + NVKM_CLK_BOOST_AVG);
> if (bios && !nvbios_baseclock_parse(bios, &h)) {
> struct nvbios_baseclk_entry base, boost;
> - if (!nvbios_baseclock_entry(bios, &h, h.boost, &boost))
> + if (!nvbios_baseclock_entry(bios, &h, h.boost, &boost)) {
> + clk->boost_khz = boost.clock_mhz * 1000;
> nvkm_info(subdev, "boost: %i MHz\n",
> boost.clock_mhz / 2);
> - if (!nvbios_baseclock_entry(bios, &h, h.base, &base))
> + }
> +
> + if (!nvbios_baseclock_entry(bios, &h, h.base, &base)) {
> + clk->base_khz = base.clock_mhz * 1000;
> nvkm_info(subdev, "base: %i MHz\n",
> base.clock_mhz / 2);
> + }
> }
>
> clk->func = func;
> diff --git a/drm/nouveau/nvkm/subdev/clk/gf100.c b/drm/nouveau/nvkm/subdev/clk/gf100.c
> index 78c449b..71b7c9f 100644
> --- a/drm/nouveau/nvkm/subdev/clk/gf100.c
> +++ b/drm/nouveau/nvkm/subdev/clk/gf100.c
> @@ -443,7 +443,7 @@ gf100_clk = {
> { nv_clk_src_hubk06 , 0x00 },
> { nv_clk_src_hubk01 , 0x01 },
> { nv_clk_src_copy , 0x02 },
> - { nv_clk_src_gpc , 0x03, 0, "core", 2000 },
> + { nv_clk_src_gpc , 0x03, NVKM_CLK_DOM_FLAG_BASECLK, "core", 2000 },
> { nv_clk_src_rop , 0x04 },
> { nv_clk_src_mem , 0x05, 0, "memory", 1000 },
> { nv_clk_src_vdec , 0x06 },
> diff --git a/drm/nouveau/nvkm/subdev/clk/gk104.c b/drm/nouveau/nvkm/subdev/clk/gk104.c
> index 975c401..639234f 100644
> --- a/drm/nouveau/nvkm/subdev/clk/gk104.c
> +++ b/drm/nouveau/nvkm/subdev/clk/gk104.c
> @@ -485,7 +485,7 @@ gk104_clk = {
> .domains = {
> { nv_clk_src_crystal, 0xff },
> { nv_clk_src_href , 0xff },
> - { nv_clk_src_gpc , 0x00, NVKM_CLK_DOM_FLAG_CORE, "core", 2000 },
> + { nv_clk_src_gpc , 0x00, NVKM_CLK_DOM_FLAG_CORE | NVKM_CLK_DOM_FLAG_BASECLK, "core", 2000 },
> { nv_clk_src_hubk07 , 0x01, NVKM_CLK_DOM_FLAG_CORE },
> { nv_clk_src_rop , 0x02, NVKM_CLK_DOM_FLAG_CORE },
> { nv_clk_src_mem , 0x03, 0, "memory", 500 },
Reviewed-by: Martin Peres <martin.peres@free.fr>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
next prev parent reply other threads:[~2016-03-20 20:15 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-17 23:03 [PATCH 00/19] Volting/Clocking improvements for Fermi and newer Karol Herbst
[not found] ` <1458255836-3878-1-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2016-03-17 23:03 ` [PATCH 01/19] bios/volt: handle voltage table version 0x50 with 0ed header Karol Herbst
2016-03-17 23:03 ` [PATCH 02/19] volt: properly detect entry based voltage tables Karol Herbst
2016-03-17 23:03 ` [PATCH 03/19] bios: add parsing of BASE CLOCK table Karol Herbst
[not found] ` <1458255836-3878-4-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2016-03-20 17:07 ` Martin Peres
2016-03-17 23:03 ` [PATCH 04/19] clk: print the base clocks Karol Herbst
[not found] ` <1458255836-3878-5-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2016-03-20 17:16 ` Martin Peres
2016-03-17 23:03 ` [PATCH 05/19] clk: allow boosting only when NvBoost is set Karol Herbst
[not found] ` <1458255836-3878-6-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2016-03-20 20:15 ` Martin Peres [this message]
2016-03-17 23:03 ` [PATCH 06/19] volt: save the voltage range we are able to set Karol Herbst
2016-03-17 23:03 ` [PATCH 07/19] volt: add nvkm_volt_map_min function Karol Herbst
2016-03-17 23:03 ` [PATCH 08/19] clk: don't create cstates which voltage is higher than what the gpu can do Karol Herbst
2016-03-17 23:03 ` [PATCH 09/19] volt: parse the both max voltage entries Karol Herbst
2016-03-17 23:03 ` [PATCH 10/19] volt: add min_id parameter to nvkm_volt_set_id Karol Herbst
2016-03-17 23:03 ` [PATCH 11/19] clk: export nvkm_volt_map Karol Herbst
2016-03-17 23:03 ` [PATCH 12/19] clk: add index field to nvkm_cstate Karol Herbst
2016-03-17 23:03 ` [PATCH 13/19] add daemon to compare nouveau with blob voltage Karol Herbst
2016-03-17 23:03 ` [PATCH 14/19] volt: add temperature parameter to nvkm_volt_map Karol Herbst
2016-03-17 23:03 ` [PATCH 15/19] nouveau/subdev/clk: fixup cstate selection Karol Herbst
2016-03-17 23:03 ` [PATCH 16/19] clk: respect voltage limits in nvkm_cstate_prog with cstate = -1 Karol Herbst
2016-03-17 23:03 ` [PATCH 17/19] volt: don't require perfect fit Karol Herbst
2016-03-17 23:03 ` [PATCH 18/19] bios/vmap: unk0 field is the mode Karol Herbst
2016-03-17 23:03 ` [PATCH 19/19] volt: add coefficients I found on my gpu Karol Herbst
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56EF04E2.40703@free.fr \
--to=martin.peres-ganu6spqydw@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.