diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-01-14 15:12:11 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-01-22 12:17:58 +1000 |
commit | 9e79a85343e2191ac83f0ef4fe49b71b9d80ad38 (patch) | |
tree | c937ab3ef2397fb00d2b61e9d7493174ec985e81 | |
parent | e1404611d5f6a7c75e2b745f5eb7fbcdd23751c5 (diff) |
drm/nouveau/timer: 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>
26 files changed, 105 insertions, 91 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/timer.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/timer.h index 36b5184e35ec..4ad55082ef7a 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/timer.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/timer.h @@ -1,64 +1,61 @@ -#ifndef __NOUVEAU_TIMER_H__ -#define __NOUVEAU_TIMER_H__ - +#ifndef __NVKM_TIMER_H__ +#define __NVKM_TIMER_H__ #include <core/subdev.h> -#include <core/device.h> -struct nouveau_alarm { +struct nvkm_alarm { struct list_head head; u64 timestamp; - void (*func)(struct nouveau_alarm *); + void (*func)(struct nvkm_alarm *); }; static inline void -nouveau_alarm_init(struct nouveau_alarm *alarm, - void (*func)(struct nouveau_alarm *)) +nvkm_alarm_init(struct nvkm_alarm *alarm, + void (*func)(struct nvkm_alarm *)) { INIT_LIST_HEAD(&alarm->head); alarm->func = func; } -bool nouveau_timer_wait_eq(void *, u64 nsec, u32 addr, u32 mask, u32 data); -bool nouveau_timer_wait_ne(void *, u64 nsec, u32 addr, u32 mask, u32 data); -bool nouveau_timer_wait_cb(void *, u64 nsec, bool (*func)(void *), void *data); -void nouveau_timer_alarm(void *, u32 nsec, struct nouveau_alarm *); -void nouveau_timer_alarm_cancel(void *, struct nouveau_alarm *); +bool nvkm_timer_wait_eq(void *, u64 nsec, u32 addr, u32 mask, u32 data); +bool nvkm_timer_wait_ne(void *, u64 nsec, u32 addr, u32 mask, u32 data); +bool nvkm_timer_wait_cb(void *, u64 nsec, bool (*func)(void *), void *data); +void nvkm_timer_alarm(void *, u32 nsec, struct nvkm_alarm *); +void nvkm_timer_alarm_cancel(void *, struct nvkm_alarm *); #define NV_WAIT_DEFAULT 2000000000ULL #define nv_wait(o,a,m,v) \ - nouveau_timer_wait_eq((o), NV_WAIT_DEFAULT, (a), (m), (v)) + nvkm_timer_wait_eq((o), NV_WAIT_DEFAULT, (a), (m), (v)) #define nv_wait_ne(o,a,m,v) \ - nouveau_timer_wait_ne((o), NV_WAIT_DEFAULT, (a), (m), (v)) + nvkm_timer_wait_ne((o), NV_WAIT_DEFAULT, (a), (m), (v)) #define nv_wait_cb(o,c,d) \ - nouveau_timer_wait_cb((o), NV_WAIT_DEFAULT, (c), (d)) + nvkm_timer_wait_cb((o), NV_WAIT_DEFAULT, (c), (d)) -struct nouveau_timer { - struct nouveau_subdev base; - u64 (*read)(struct nouveau_timer *); - void (*alarm)(struct nouveau_timer *, u64 time, struct nouveau_alarm *); - void (*alarm_cancel)(struct nouveau_timer *, struct nouveau_alarm *); +struct nvkm_timer { + struct nvkm_subdev base; + u64 (*read)(struct nvkm_timer *); + void (*alarm)(struct nvkm_timer *, u64 time, struct nvkm_alarm *); + void (*alarm_cancel)(struct nvkm_timer *, struct nvkm_alarm *); }; -static inline struct nouveau_timer * -nouveau_timer(void *obj) +static inline struct nvkm_timer * +nvkm_timer(void *obj) { - return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_TIMER); + return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_TIMER); } -#define nouveau_timer_create(p,e,o,d) \ - nouveau_subdev_create_((p), (e), (o), 0, "PTIMER", "timer", \ +#define nvkm_timer_create(p,e,o,d) \ + nvkm_subdev_create_((p), (e), (o), 0, "PTIMER", "timer", \ sizeof(**d), (void **)d) -#define nouveau_timer_destroy(p) \ - nouveau_subdev_destroy(&(p)->base) -#define nouveau_timer_init(p) \ - nouveau_subdev_init(&(p)->base) -#define nouveau_timer_fini(p,s) \ - nouveau_subdev_fini(&(p)->base, (s)) - -int nouveau_timer_create_(struct nouveau_object *, struct nouveau_engine *, - struct nouveau_oclass *, int size, void **); - -extern struct nouveau_oclass nv04_timer_oclass; -extern struct nouveau_oclass gk20a_timer_oclass; - +#define nvkm_timer_destroy(p) \ + nvkm_subdev_destroy(&(p)->base) +#define nvkm_timer_init(p) \ + nvkm_subdev_init(&(p)->base) +#define nvkm_timer_fini(p,s) \ + nvkm_subdev_fini(&(p)->base, (s)) + +int nvkm_timer_create_(struct nvkm_object *, struct nvkm_engine *, + struct nvkm_oclass *, int size, void **); + +extern struct nvkm_oclass nv04_timer_oclass; +extern struct nvkm_oclass gk20a_timer_oclass; #endif diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c b/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c index f6e9ae95c822..30958c19e61d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c @@ -21,6 +21,7 @@ */ #include <engine/falcon.h> +#include <core/device.h> #include <subdev/timer.h> void diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c index 6f51ae0daecf..1b384bd5994e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c @@ -23,6 +23,7 @@ */ #include <core/client.h> +#include <core/device.h> #include <nvif/unpack.h> #include <nvif/class.h> #include <core/engctx.h> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv04.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv04.c index 4d25c9532b2b..5dda6ed846ba 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv04.c @@ -23,6 +23,7 @@ */ #include <core/client.h> +#include <core/device.h> #include <core/os.h> #include <core/handle.h> #include <core/namedb.h> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c index 8caf0c338425..9841b4e5964d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c @@ -1,4 +1,5 @@ #include <core/client.h> +#include <core/device.h> #include <core/os.h> #include <core/engctx.h> #include <core/handle.h> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c index d9d85508cbcf..6a8e0022f8af 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c @@ -1,4 +1,5 @@ #include <core/os.h> +#include <core/device.h> #include <core/engctx.h> #include <core/enum.h> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.c index bd7687c683c8..9d7fcbd96522 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.c @@ -24,6 +24,7 @@ #include <core/os.h> #include <core/client.h> +#include <core/device.h> #include <core/handle.h> #include <core/engctx.h> #include <core/enum.h> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nvc0.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nvc0.h index 413def63be0e..2f2ed95fe936 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nvc0.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nvc0.h @@ -26,6 +26,7 @@ #define __NVC0_GR_H__ #include <core/client.h> +#include <core/device.h> #include <core/handle.h> #include <core/gpuobj.h> #include <core/option.h> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c index 36c5c083c1e9..8548adb91dcc 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.c @@ -23,6 +23,7 @@ */ #include "priv.h" +#include <core/device.h> #include <core/gpuobj.h> #include <subdev/fb.h> #include <subdev/mmu.h> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c index e8125b5199a4..3d7330d54b02 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gf100.c @@ -24,6 +24,7 @@ #include <subdev/clk.h> #include "pll.h" +#include <core/device.h> #include <subdev/bios.h> #include <subdev/bios/pll.h> #include <subdev/timer.h> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk104.c index e380d62df232..e9b2310bdfbb 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk104.c @@ -24,6 +24,7 @@ #include <subdev/clk.h> #include "pll.h" +#include <core/device.h> #include <subdev/timer.h> #include <subdev/bios.h> #include <subdev/bios/pll.h> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c index 94d3839fd444..65c532742b08 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c @@ -25,6 +25,8 @@ #include <subdev/clk.h> #include <subdev/timer.h> +#include <core/device.h> + #ifdef __KERNEL__ #include <nouveau_platform.h> #endif diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c index 99e3ca3b0890..822d32a28d6e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c @@ -25,6 +25,7 @@ #include "gt215.h" #include "pll.h" +#include <core/device.h> #include <engine/fifo.h> #include <subdev/bios.h> #include <subdev/bios/pll.h> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c index d735de2dbd74..c54417b146c7 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/mcp77.c @@ -24,6 +24,7 @@ #include "gt215.h" #include "pll.h" +#include <core/device.h> #include <subdev/bios.h> #include <subdev/bios/pll.h> #include <subdev/timer.h> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c index a36a90c29ba9..3d31fa45c1a6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.c @@ -23,6 +23,7 @@ */ #include "nv40.h" +#include <core/device.h> #include <subdev/bios.h> #include <subdev/bios/bit.h> #include <subdev/bios/init.h> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c index 3cf4192a33af..bde5ceaeb70a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fanpwm.c @@ -24,6 +24,7 @@ */ #include "priv.h" +#include <core/device.h> #include <core/option.h> #include <subdev/bios.h> #include <subdev/bios/fan.h> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf110.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf110.c index 0540e6886d7d..46b7e656a752 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf110.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf110.c @@ -23,6 +23,8 @@ */ #include "priv.h" +#include <core/device.h> + struct gf110_therm_priv { struct nvkm_therm_priv base; }; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gm107.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gm107.c index c1f3cf361837..2fd110f09878 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gm107.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gm107.c @@ -23,6 +23,8 @@ */ #include "priv.h" +#include <core/device.h> + struct gm107_therm_priv { struct nvkm_therm_priv base; }; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gt215.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gt215.c index b7fa4716ca9f..e99be20332f2 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gt215.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gt215.c @@ -23,6 +23,7 @@ */ #include "priv.h" +#include <core/device.h> #include <subdev/gpio.h> struct gt215_therm_priv { diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv40.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv40.c index 20f65fd7679a..8496fffd4688 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv40.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv40.c @@ -24,6 +24,8 @@ */ #include "priv.h" +#include <core/device.h> + struct nv40_therm_priv { struct nvkm_therm_priv base; }; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c index 489dcf355d34..1ef59e8922d4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c @@ -24,6 +24,8 @@ */ #include "priv.h" +#include <core/device.h> + struct nv50_therm_priv { struct nvkm_therm_priv base; }; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c index cf8a0e0f8ee3..d894061ced52 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c @@ -21,13 +21,12 @@ * * Authors: Ben Skeggs */ - -#include "subdev/timer.h" +#include <subdev/timer.h> bool -nouveau_timer_wait_eq(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) +nvkm_timer_wait_eq(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) { - struct nouveau_timer *ptimer = nouveau_timer(obj); + struct nvkm_timer *ptimer = nvkm_timer(obj); u64 time0; time0 = ptimer->read(ptimer); @@ -45,9 +44,9 @@ nouveau_timer_wait_eq(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) } bool -nouveau_timer_wait_ne(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) +nvkm_timer_wait_ne(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) { - struct nouveau_timer *ptimer = nouveau_timer(obj); + struct nvkm_timer *ptimer = nvkm_timer(obj); u64 time0; time0 = ptimer->read(ptimer); @@ -65,9 +64,9 @@ nouveau_timer_wait_ne(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) } bool -nouveau_timer_wait_cb(void *obj, u64 nsec, bool (*func)(void *), void *data) +nvkm_timer_wait_cb(void *obj, u64 nsec, bool (*func)(void *), void *data) { - struct nouveau_timer *ptimer = nouveau_timer(obj); + struct nvkm_timer *ptimer = nvkm_timer(obj); u64 time0; time0 = ptimer->read(ptimer); @@ -80,15 +79,15 @@ nouveau_timer_wait_cb(void *obj, u64 nsec, bool (*func)(void *), void *data) } void -nouveau_timer_alarm(void *obj, u32 nsec, struct nouveau_alarm *alarm) +nvkm_timer_alarm(void *obj, u32 nsec, struct nvkm_alarm *alarm) { - struct nouveau_timer *ptimer = nouveau_timer(obj); + struct nvkm_timer *ptimer = nvkm_timer(obj); ptimer->alarm(ptimer, nsec, alarm); } void -nouveau_timer_alarm_cancel(void *obj, struct nouveau_alarm *alarm) +nvkm_timer_alarm_cancel(void *obj, struct nvkm_alarm *alarm) { - struct nouveau_timer *ptimer = nouveau_timer(obj); + struct nvkm_timer *ptimer = nvkm_timer(obj); ptimer->alarm_cancel(ptimer, alarm); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/gk20a.c index 37484db1f7fc..80e38063dd9b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/gk20a.c @@ -21,18 +21,17 @@ * * Authors: Ben Skeggs */ - #include "nv04.h" static int -gk20a_timer_init(struct nouveau_object *object) +gk20a_timer_init(struct nvkm_object *object) { struct nv04_timer_priv *priv = (void *)object; u32 hi = upper_32_bits(priv->suspend_time); u32 lo = lower_32_bits(priv->suspend_time); int ret; - ret = nouveau_timer_init(&priv->base); + ret = nvkm_timer_init(&priv->base); if (ret) return ret; @@ -45,10 +44,10 @@ gk20a_timer_init(struct nouveau_object *object) return 0; } -struct nouveau_oclass +struct nvkm_oclass gk20a_timer_oclass = { .handle = NV_SUBDEV(TIMER, 0xff), - .ofuncs = &(struct nouveau_ofuncs) { + .ofuncs = &(struct nvkm_ofuncs) { .ctor = nv04_timer_ctor, .dtor = nv04_timer_dtor, .init = gk20a_timer_init, diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/nv04.c b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/nv04.c index 240ed0b983a9..6b7facbe59a2 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/nv04.c @@ -21,11 +21,12 @@ * * Authors: Ben Skeggs */ - #include "nv04.h" +#include <core/device.h> + static u64 -nv04_timer_read(struct nouveau_timer *ptimer) +nv04_timer_read(struct nvkm_timer *ptimer) { struct nv04_timer_priv *priv = (void *)ptimer; u32 hi, lo; @@ -39,10 +40,10 @@ nv04_timer_read(struct nouveau_timer *ptimer) } static void -nv04_timer_alarm_trigger(struct nouveau_timer *ptimer) +nv04_timer_alarm_trigger(struct nvkm_timer *ptimer) { struct nv04_timer_priv *priv = (void *)ptimer; - struct nouveau_alarm *alarm, *atemp; + struct nvkm_alarm *alarm, *atemp; unsigned long flags; LIST_HEAD(exec); @@ -71,11 +72,10 @@ nv04_timer_alarm_trigger(struct nouveau_timer *ptimer) } static void -nv04_timer_alarm(struct nouveau_timer *ptimer, u64 time, - struct nouveau_alarm *alarm) +nv04_timer_alarm(struct nvkm_timer *ptimer, u64 time, struct nvkm_alarm *alarm) { struct nv04_timer_priv *priv = (void *)ptimer; - struct nouveau_alarm *list; + struct nvkm_alarm *list; unsigned long flags; alarm->timestamp = ptimer->read(ptimer) + time; @@ -99,8 +99,7 @@ nv04_timer_alarm(struct nouveau_timer *ptimer, u64 time, } static void -nv04_timer_alarm_cancel(struct nouveau_timer *ptimer, - struct nouveau_alarm *alarm) +nv04_timer_alarm_cancel(struct nvkm_timer *ptimer, struct nvkm_alarm *alarm) { struct nv04_timer_priv *priv = (void *)ptimer; unsigned long flags; @@ -110,7 +109,7 @@ nv04_timer_alarm_cancel(struct nouveau_timer *ptimer, } static void -nv04_timer_intr(struct nouveau_subdev *subdev) +nv04_timer_intr(struct nvkm_subdev *subdev) { struct nv04_timer_priv *priv = (void *)subdev; u32 stat = nv_rd32(priv, NV04_PTIMER_INTR_0); @@ -128,24 +127,24 @@ nv04_timer_intr(struct nouveau_subdev *subdev) } int -nv04_timer_fini(struct nouveau_object *object, bool suspend) +nv04_timer_fini(struct nvkm_object *object, bool suspend) { struct nv04_timer_priv *priv = (void *)object; if (suspend) priv->suspend_time = nv04_timer_read(&priv->base); nv_wr32(priv, NV04_PTIMER_INTR_EN_0, 0x00000000); - return nouveau_timer_fini(&priv->base, suspend); + return nvkm_timer_fini(&priv->base, suspend); } static int -nv04_timer_init(struct nouveau_object *object) +nv04_timer_init(struct nvkm_object *object) { - struct nouveau_device *device = nv_device(object); + struct nvkm_device *device = nv_device(object); struct nv04_timer_priv *priv = (void *)object; u32 m = 1, f, n, d, lo, hi; int ret; - ret = nouveau_timer_init(&priv->base); + ret = nvkm_timer_init(&priv->base); if (ret) return ret; @@ -155,7 +154,7 @@ nv04_timer_init(struct nouveau_object *object) /* determine base clock for timer source */ #if 0 /*XXX*/ if (device->chipset < 0x40) { - n = nouveau_hw_get_clock(device, PLL_CORE); + n = nvkm_hw_get_clock(device, PLL_CORE); } else #endif if (device->chipset <= 0x40) { @@ -217,26 +216,25 @@ nv04_timer_init(struct nouveau_object *object) nv_wr32(priv, NV04_PTIMER_INTR_EN_0, 0x00000000); nv_wr32(priv, NV04_PTIMER_TIME_1, hi); nv_wr32(priv, NV04_PTIMER_TIME_0, lo); - return 0; } void -nv04_timer_dtor(struct nouveau_object *object) +nv04_timer_dtor(struct nvkm_object *object) { struct nv04_timer_priv *priv = (void *)object; - return nouveau_timer_destroy(&priv->base); + return nvkm_timer_destroy(&priv->base); } int -nv04_timer_ctor(struct nouveau_object *parent, struct nouveau_object *engine, - struct nouveau_oclass *oclass, void *data, u32 size, - struct nouveau_object **pobject) +nv04_timer_ctor(struct nvkm_object *parent, struct nvkm_object *engine, + struct nvkm_oclass *oclass, void *data, u32 size, + struct nvkm_object **pobject) { struct nv04_timer_priv *priv; int ret; - ret = nouveau_timer_create(parent, engine, oclass, &priv); + ret = nvkm_timer_create(parent, engine, oclass, &priv); *pobject = nv_object(priv); if (ret) return ret; @@ -252,10 +250,10 @@ nv04_timer_ctor(struct nouveau_object *parent, struct nouveau_object *engine, return 0; } -struct nouveau_oclass +struct nvkm_oclass nv04_timer_oclass = { .handle = NV_SUBDEV(TIMER, 0x04), - .ofuncs = &(struct nouveau_ofuncs) { + .ofuncs = &(struct nvkm_ofuncs) { .ctor = nv04_timer_ctor, .dtor = nv04_timer_dtor, .init = nv04_timer_init, diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/nv04.h b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/nv04.h index 4bc152697c37..89996a9826b1 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/nv04.h +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/nv04.h @@ -1,6 +1,5 @@ #ifndef __NVKM_TIMER_NV04_H__ #define __NVKM_TIMER_NV04_H__ - #include "priv.h" #define NV04_PTIMER_INTR_0 0x009100 @@ -12,16 +11,15 @@ #define NV04_PTIMER_ALARM_0 0x009420 struct nv04_timer_priv { - struct nouveau_timer base; + struct nvkm_timer base; struct list_head alarms; spinlock_t lock; u64 suspend_time; }; -int nv04_timer_ctor(struct nouveau_object *, struct nouveau_object *, - struct nouveau_oclass *, void *, u32, - struct nouveau_object **); -void nv04_timer_dtor(struct nouveau_object *); -int nv04_timer_fini(struct nouveau_object *, bool); - +int nv04_timer_ctor(struct nvkm_object *, struct nvkm_object *, + struct nvkm_oclass *, void *, u32, + struct nvkm_object **); +void nv04_timer_dtor(struct nvkm_object *); +int nv04_timer_fini(struct nvkm_object *, bool); #endif diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/priv.h index 799dae3f2300..08e29a3da188 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/priv.h +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/priv.h @@ -1,6 +1,4 @@ #ifndef __NVKM_TIMER_PRIV_H__ #define __NVKM_TIMER_PRIV_H__ - #include <subdev/timer.h> - #endif |