We won't need it now, because we will adjust the clocks depending on engine
loads later on anyway or a static lookup table. It also simplifies the
clocking logic.

This code was nowhere used anyway and just a mock up.

v2: fixed typo in commit message

Signed-off-by: Karol Herbst <karolher...@gmail.com>
Reviewed-by: Martin Peres <martin.pe...@free.fr>
Reviewed-by: Pierre Moreau <pierre.mor...@free.fr>
---
 drm/nouveau/include/nvkm/subdev/clk.h |  2 --
 drm/nouveau/nvkm/subdev/clk/base.c    | 16 ++--------------
 2 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/drm/nouveau/include/nvkm/subdev/clk.h 
b/drm/nouveau/include/nvkm/subdev/clk.h
index 32f733c3..4f763309 100644
--- a/drm/nouveau/include/nvkm/subdev/clk.h
+++ b/drm/nouveau/include/nvkm/subdev/clk.h
@@ -101,7 +101,6 @@ struct nvkm_clk {
        int ustate_ac; /* user-requested (-1 disabled, -2 perfmon) */
        int ustate_dc; /* user-requested (-1 disabled, -2 perfmon) */
        int astate; /* perfmon adjustment (base) */
-       int dstate; /* display adjustment (min+) */
        int temp;
 
        bool allow_reclock;
@@ -123,7 +122,6 @@ struct nvkm_clk {
 int nvkm_clk_read(struct nvkm_clk *, enum nv_clk_src);
 int nvkm_clk_ustate(struct nvkm_clk *, int req, int pwr);
 int nvkm_clk_astate(struct nvkm_clk *, int req, int rel, bool wait);
-int nvkm_clk_dstate(struct nvkm_clk *, int req, int rel);
 int nvkm_clk_tstate(struct nvkm_clk *, int temperature);
 
 int nv04_clk_new(struct nvkm_device *, int, struct nvkm_clk **);
diff --git a/drm/nouveau/nvkm/subdev/clk/base.c 
b/drm/nouveau/nvkm/subdev/clk/base.c
index b268b8fd..83b18d88 100644
--- a/drm/nouveau/nvkm/subdev/clk/base.c
+++ b/drm/nouveau/nvkm/subdev/clk/base.c
@@ -308,15 +308,14 @@ nvkm_pstate_work(struct work_struct *work)
                return;
        clk->pwrsrc = power_supply_is_system_supplied();
 
-       nvkm_trace(subdev, "P %d PWR %d U(AC) %d U(DC) %d A %d T %d°C D %d\n",
+       nvkm_trace(subdev, "P %d PWR %d U(AC) %d U(DC) %d A %d T %d°C\n",
                   clk->pstate_idx, clk->pwrsrc, clk->ustate_ac, clk->ustate_dc,
-                  clk->astate, clk->temp, clk->dstate);
+                  clk->astate, clk->temp);
 
        pstate_idx = clk->pwrsrc ? clk->ustate_ac : clk->ustate_dc;
        if (clk->pstates_cnt && pstate_idx != NVKM_CLK_PSTATE_BOOT) {
                pstate_idx = (pstate_idx < 0) ? clk->astate : pstate_idx;
                pstate_idx = min(pstate_idx, clk->pstates_cnt - 1);
-               pstate_idx = max(pstate_idx, clk->dstate);
        } else {
                pstate_idx = clk->pstate_idx = NVKM_CLK_PSTATE_BOOT;
        }
@@ -550,16 +549,6 @@ nvkm_clk_tstate(struct nvkm_clk *clk, int temp)
        return nvkm_pstate_calc(clk, false);
 }
 
-int
-nvkm_clk_dstate(struct nvkm_clk *clk, int req, int rel)
-{
-       if (!rel) clk->dstate  = req;
-       if ( rel) clk->dstate += rel;
-       clk->dstate = min(clk->dstate, clk->pstates_cnt - 1);
-       clk->dstate = max(clk->dstate, 0);
-       return nvkm_pstate_calc(clk, true);
-}
-
 static int
 nvkm_clk_pwrsrc(struct nvkm_notify *notify)
 {
@@ -617,7 +606,6 @@ nvkm_clk_init(struct nvkm_subdev *subdev)
                return clk->func->init(clk);
 
        clk->astate = clk->pstates_cnt - 1;
-       clk->dstate = 0;
        clk->pstate_idx = NVKM_CLK_PSTATE_BOOT;
        clk->temp = 90; /* reasonable default value */
        nvkm_pstate_calc(clk, true);
-- 
2.15.0

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

Reply via email to