diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-06-13 13:23:42 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-08-10 05:11:08 +1000 |
commit | 7e1ee6333c32a4b83aad430a4bcb8a7057f36194 (patch) | |
tree | e3f921e98245fe9f7c2582fdf8c2e21a795ba25f /drivers/gpu/drm/nouveau/core/include/subdev | |
parent | d5d7a0fa742383406c84e5292d00eccdbf74d91a (diff) | |
download | op-kernel-dev-7e1ee6333c32a4b83aad430a4bcb8a7057f36194.zip op-kernel-dev-7e1ee6333c32a4b83aad430a4bcb8a7057f36194.tar.gz |
drm/nouveau/clk: allow selection of different power state for ac vs battery
v2:
- s/init/fini/ typo, reported by Alex
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/include/subdev')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/include/subdev/clock.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/clock.h b/drivers/gpu/drm/nouveau/core/include/subdev/clock.h index 3168e1a..9f37c09 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/clock.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/clock.h @@ -75,8 +75,11 @@ struct nouveau_clock { wait_queue_head_t wait; atomic_t waiting; + struct nouveau_eventh *pwrsrc_ntfy; + int pwrsrc; int pstate; /* current */ - int ustate; /* user-requested (-1 disabled, -2 perfmon) */ + int ustate_ac; /* user-requested (-1 disabled, -2 perfmon) */ + int ustate_dc; /* user-requested (-1 disabled, -2 perfmon) */ int astate; /* perfmon adjustment (base) */ int tstate; /* thermal adjustment (max-) */ int dstate; /* display adjustment (min+) */ @@ -122,15 +125,17 @@ struct nouveau_clocks { struct nouveau_clock *clk = (p); \ _nouveau_clock_init(nv_object(clk)); \ }) -#define nouveau_clock_fini(p,s) \ - nouveau_subdev_fini(&(p)->base, (s)) +#define nouveau_clock_fini(p,s) ({ \ + struct nouveau_clock *clk = (p); \ + _nouveau_clock_fini(nv_object(clk), (s)); \ +}) int nouveau_clock_create_(struct nouveau_object *, struct nouveau_object *, struct nouveau_oclass *, struct nouveau_clocks *, bool, int, void **); void _nouveau_clock_dtor(struct nouveau_object *); -int _nouveau_clock_init(struct nouveau_object *); -#define _nouveau_clock_fini _nouveau_subdev_fini +int _nouveau_clock_init(struct nouveau_object *); +int _nouveau_clock_fini(struct nouveau_object *, bool); extern struct nouveau_oclass nv04_clock_oclass; extern struct nouveau_oclass nv40_clock_oclass; @@ -149,7 +154,7 @@ int nv04_clock_pll_prog(struct nouveau_clock *, u32 reg1, int nva3_clock_pll_calc(struct nouveau_clock *, struct nvbios_pll *, int clk, struct nouveau_pll_vals *); -int nouveau_clock_ustate(struct nouveau_clock *, int req); +int nouveau_clock_ustate(struct nouveau_clock *, int req, int pwr); int nouveau_clock_astate(struct nouveau_clock *, int req, int rel); int nouveau_clock_dstate(struct nouveau_clock *, int req, int rel); int nouveau_clock_tstate(struct nouveau_clock *, int req, int rel); |