diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-01-14 00:12:11 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-01-21 21:17:58 -0500 |
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 @@ | |||
1 | #ifndef __NOUVEAU_TIMER_H__ | 1 | #ifndef __NVKM_TIMER_H__ |
2 | #define __NOUVEAU_TIMER_H__ | 2 | #define __NVKM_TIMER_H__ |
3 | |||
4 | #include <core/subdev.h> | 3 | #include <core/subdev.h> |
5 | #include <core/device.h> | ||
6 | 4 | ||
7 | struct nouveau_alarm { | 5 | struct nvkm_alarm { |
8 | struct list_head head; | 6 | struct list_head head; |
9 | u64 timestamp; | 7 | u64 timestamp; |
10 | void (*func)(struct nouveau_alarm *); | 8 | void (*func)(struct nvkm_alarm *); |
11 | }; | 9 | }; |
12 | 10 | ||
13 | static inline void | 11 | static inline void |
14 | nouveau_alarm_init(struct nouveau_alarm *alarm, | 12 | nvkm_alarm_init(struct nvkm_alarm *alarm, |
15 | void (*func)(struct nouveau_alarm *)) | 13 | void (*func)(struct nvkm_alarm *)) |
16 | { | 14 | { |
17 | INIT_LIST_HEAD(&alarm->head); | 15 | INIT_LIST_HEAD(&alarm->head); |
18 | alarm->func = func; | 16 | alarm->func = func; |
19 | } | 17 | } |
20 | 18 | ||
21 | bool nouveau_timer_wait_eq(void *, u64 nsec, u32 addr, u32 mask, u32 data); | 19 | bool nvkm_timer_wait_eq(void *, u64 nsec, u32 addr, u32 mask, u32 data); |
22 | bool nouveau_timer_wait_ne(void *, u64 nsec, u32 addr, u32 mask, u32 data); | 20 | bool nvkm_timer_wait_ne(void *, u64 nsec, u32 addr, u32 mask, u32 data); |
23 | bool nouveau_timer_wait_cb(void *, u64 nsec, bool (*func)(void *), void *data); | 21 | bool nvkm_timer_wait_cb(void *, u64 nsec, bool (*func)(void *), void *data); |
24 | void nouveau_timer_alarm(void *, u32 nsec, struct nouveau_alarm *); | 22 | void nvkm_timer_alarm(void *, u32 nsec, struct nvkm_alarm *); |
25 | void nouveau_timer_alarm_cancel(void *, struct nouveau_alarm *); | 23 | void nvkm_timer_alarm_cancel(void *, struct nvkm_alarm *); |
26 | 24 | ||
27 | #define NV_WAIT_DEFAULT 2000000000ULL | 25 | #define NV_WAIT_DEFAULT 2000000000ULL |
28 | #define nv_wait(o,a,m,v) \ | 26 | #define nv_wait(o,a,m,v) \ |
29 | nouveau_timer_wait_eq((o), NV_WAIT_DEFAULT, (a), (m), (v)) | 27 | nvkm_timer_wait_eq((o), NV_WAIT_DEFAULT, (a), (m), (v)) |
30 | #define nv_wait_ne(o,a,m,v) \ | 28 | #define nv_wait_ne(o,a,m,v) \ |
31 | nouveau_timer_wait_ne((o), NV_WAIT_DEFAULT, (a), (m), (v)) | 29 | nvkm_timer_wait_ne((o), NV_WAIT_DEFAULT, (a), (m), (v)) |
32 | #define nv_wait_cb(o,c,d) \ | 30 | #define nv_wait_cb(o,c,d) \ |
33 | nouveau_timer_wait_cb((o), NV_WAIT_DEFAULT, (c), (d)) | 31 | nvkm_timer_wait_cb((o), NV_WAIT_DEFAULT, (c), (d)) |
34 | 32 | ||
35 | struct nouveau_timer { | 33 | struct nvkm_timer { |
36 | struct nouveau_subdev base; | 34 | struct nvkm_subdev base; |
37 | u64 (*read)(struct nouveau_timer *); | 35 | u64 (*read)(struct nvkm_timer *); |
38 | void (*alarm)(struct nouveau_timer *, u64 time, struct nouveau_alarm *); | 36 | void (*alarm)(struct nvkm_timer *, u64 time, struct nvkm_alarm *); |
39 | void (*alarm_cancel)(struct nouveau_timer *, struct nouveau_alarm *); | 37 | void (*alarm_cancel)(struct nvkm_timer *, struct nvkm_alarm *); |
40 | }; | 38 | }; |
41 | 39 | ||
42 | static inline struct nouveau_timer * | 40 | static inline struct nvkm_timer * |
43 | nouveau_timer(void *obj) | 41 | nvkm_timer(void *obj) |
44 | { | 42 | { |
45 | return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_TIMER); | 43 | return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_TIMER); |
46 | } | 44 | } |
47 | 45 | ||
48 | #define nouveau_timer_create(p,e,o,d) \ | 46 | #define nvkm_timer_create(p,e,o,d) \ |
49 | nouveau_subdev_create_((p), (e), (o), 0, "PTIMER", "timer", \ | 47 | nvkm_subdev_create_((p), (e), (o), 0, "PTIMER", "timer", \ |
50 | sizeof(**d), (void **)d) | 48 | sizeof(**d), (void **)d) |
51 | #define nouveau_timer_destroy(p) \ | 49 | #define nvkm_timer_destroy(p) \ |
52 | nouveau_subdev_destroy(&(p)->base) | 50 | nvkm_subdev_destroy(&(p)->base) |
53 | #define nouveau_timer_init(p) \ | 51 | #define nvkm_timer_init(p) \ |
54 | nouveau_subdev_init(&(p)->base) | 52 | nvkm_subdev_init(&(p)->base) |
55 | #define nouveau_timer_fini(p,s) \ | 53 | #define nvkm_timer_fini(p,s) \ |
56 | nouveau_subdev_fini(&(p)->base, (s)) | 54 | nvkm_subdev_fini(&(p)->base, (s)) |
57 | 55 | ||
58 | int nouveau_timer_create_(struct nouveau_object *, struct nouveau_engine *, | 56 | int nvkm_timer_create_(struct nvkm_object *, struct nvkm_engine *, |
59 | struct nouveau_oclass *, int size, void **); | 57 | struct nvkm_oclass *, int size, void **); |
60 | 58 | ||
61 | extern struct nouveau_oclass nv04_timer_oclass; | 59 | extern struct nvkm_oclass nv04_timer_oclass; |
62 | extern struct nouveau_oclass gk20a_timer_oclass; | 60 | extern struct nvkm_oclass gk20a_timer_oclass; |
63 | |||
64 | #endif | 61 | #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 @@ | |||
21 | */ | 21 | */ |
22 | #include <engine/falcon.h> | 22 | #include <engine/falcon.h> |
23 | 23 | ||
24 | #include <core/device.h> | ||
24 | #include <subdev/timer.h> | 25 | #include <subdev/timer.h> |
25 | 26 | ||
26 | void | 27 | 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 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <core/client.h> | 25 | #include <core/client.h> |
26 | #include <core/device.h> | ||
26 | #include <nvif/unpack.h> | 27 | #include <nvif/unpack.h> |
27 | #include <nvif/class.h> | 28 | #include <nvif/class.h> |
28 | #include <core/engctx.h> | 29 | #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 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <core/client.h> | 25 | #include <core/client.h> |
26 | #include <core/device.h> | ||
26 | #include <core/os.h> | 27 | #include <core/os.h> |
27 | #include <core/handle.h> | 28 | #include <core/handle.h> |
28 | #include <core/namedb.h> | 29 | #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 @@ | |||
1 | #include <core/client.h> | 1 | #include <core/client.h> |
2 | #include <core/device.h> | ||
2 | #include <core/os.h> | 3 | #include <core/os.h> |
3 | #include <core/engctx.h> | 4 | #include <core/engctx.h> |
4 | #include <core/handle.h> | 5 | #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 @@ | |||
1 | #include <core/os.h> | 1 | #include <core/os.h> |
2 | #include <core/device.h> | ||
2 | #include <core/engctx.h> | 3 | #include <core/engctx.h> |
3 | #include <core/enum.h> | 4 | #include <core/enum.h> |
4 | 5 | ||
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 @@ | |||
24 | 24 | ||
25 | #include <core/os.h> | 25 | #include <core/os.h> |
26 | #include <core/client.h> | 26 | #include <core/client.h> |
27 | #include <core/device.h> | ||
27 | #include <core/handle.h> | 28 | #include <core/handle.h> |
28 | #include <core/engctx.h> | 29 | #include <core/engctx.h> |
29 | #include <core/enum.h> | 30 | #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 @@ | |||
26 | #define __NVC0_GR_H__ | 26 | #define __NVC0_GR_H__ |
27 | 27 | ||
28 | #include <core/client.h> | 28 | #include <core/client.h> |
29 | #include <core/device.h> | ||
29 | #include <core/handle.h> | 30 | #include <core/handle.h> |
30 | #include <core/gpuobj.h> | 31 | #include <core/gpuobj.h> |
31 | #include <core/option.h> | 32 | #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 @@ | |||
23 | */ | 23 | */ |
24 | #include "priv.h" | 24 | #include "priv.h" |
25 | 25 | ||
26 | #include <core/device.h> | ||
26 | #include <core/gpuobj.h> | 27 | #include <core/gpuobj.h> |
27 | #include <subdev/fb.h> | 28 | #include <subdev/fb.h> |
28 | #include <subdev/mmu.h> | 29 | #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 @@ | |||
24 | #include <subdev/clk.h> | 24 | #include <subdev/clk.h> |
25 | #include "pll.h" | 25 | #include "pll.h" |
26 | 26 | ||
27 | #include <core/device.h> | ||
27 | #include <subdev/bios.h> | 28 | #include <subdev/bios.h> |
28 | #include <subdev/bios/pll.h> | 29 | #include <subdev/bios/pll.h> |
29 | #include <subdev/timer.h> | 30 | #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 @@ | |||
24 | #include <subdev/clk.h> | 24 | #include <subdev/clk.h> |
25 | #include "pll.h" | 25 | #include "pll.h" |
26 | 26 | ||
27 | #include <core/device.h> | ||
27 | #include <subdev/timer.h> | 28 | #include <subdev/timer.h> |
28 | #include <subdev/bios.h> | 29 | #include <subdev/bios.h> |
29 | #include <subdev/bios/pll.h> | 30 | #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 @@ | |||
25 | #include <subdev/clk.h> | 25 | #include <subdev/clk.h> |
26 | #include <subdev/timer.h> | 26 | #include <subdev/timer.h> |
27 | 27 | ||
28 | #include <core/device.h> | ||
29 | |||
28 | #ifdef __KERNEL__ | 30 | #ifdef __KERNEL__ |
29 | #include <nouveau_platform.h> | 31 | #include <nouveau_platform.h> |
30 | #endif | 32 | #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 @@ | |||
25 | #include "gt215.h" | 25 | #include "gt215.h" |
26 | #include "pll.h" | 26 | #include "pll.h" |
27 | 27 | ||
28 | #include <core/device.h> | ||
28 | #include <engine/fifo.h> | 29 | #include <engine/fifo.h> |
29 | #include <subdev/bios.h> | 30 | #include <subdev/bios.h> |
30 | #include <subdev/bios/pll.h> | 31 | #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 @@ | |||
24 | #include "gt215.h" | 24 | #include "gt215.h" |
25 | #include "pll.h" | 25 | #include "pll.h" |
26 | 26 | ||
27 | #include <core/device.h> | ||
27 | #include <subdev/bios.h> | 28 | #include <subdev/bios.h> |
28 | #include <subdev/bios/pll.h> | 29 | #include <subdev/bios/pll.h> |
29 | #include <subdev/timer.h> | 30 | #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 @@ | |||
23 | */ | 23 | */ |
24 | #include "nv40.h" | 24 | #include "nv40.h" |
25 | 25 | ||
26 | #include <core/device.h> | ||
26 | #include <subdev/bios.h> | 27 | #include <subdev/bios.h> |
27 | #include <subdev/bios/bit.h> | 28 | #include <subdev/bios/bit.h> |
28 | #include <subdev/bios/init.h> | 29 | #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 @@ | |||
24 | */ | 24 | */ |
25 | #include "priv.h" | 25 | #include "priv.h" |
26 | 26 | ||
27 | #include <core/device.h> | ||
27 | #include <core/option.h> | 28 | #include <core/option.h> |
28 | #include <subdev/bios.h> | 29 | #include <subdev/bios.h> |
29 | #include <subdev/bios/fan.h> | 30 | #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 @@ | |||
23 | */ | 23 | */ |
24 | #include "priv.h" | 24 | #include "priv.h" |
25 | 25 | ||
26 | #include <core/device.h> | ||
27 | |||
26 | struct gf110_therm_priv { | 28 | struct gf110_therm_priv { |
27 | struct nvkm_therm_priv base; | 29 | struct nvkm_therm_priv base; |
28 | }; | 30 | }; |
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 @@ | |||
23 | */ | 23 | */ |
24 | #include "priv.h" | 24 | #include "priv.h" |
25 | 25 | ||
26 | #include <core/device.h> | ||
27 | |||
26 | struct gm107_therm_priv { | 28 | struct gm107_therm_priv { |
27 | struct nvkm_therm_priv base; | 29 | struct nvkm_therm_priv base; |
28 | }; | 30 | }; |
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 @@ | |||
23 | */ | 23 | */ |
24 | #include "priv.h" | 24 | #include "priv.h" |
25 | 25 | ||
26 | #include <core/device.h> | ||
26 | #include <subdev/gpio.h> | 27 | #include <subdev/gpio.h> |
27 | 28 | ||
28 | struct gt215_therm_priv { | 29 | 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 @@ | |||
24 | */ | 24 | */ |
25 | #include "priv.h" | 25 | #include "priv.h" |
26 | 26 | ||
27 | #include <core/device.h> | ||
28 | |||
27 | struct nv40_therm_priv { | 29 | struct nv40_therm_priv { |
28 | struct nvkm_therm_priv base; | 30 | struct nvkm_therm_priv base; |
29 | }; | 31 | }; |
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 @@ | |||
24 | */ | 24 | */ |
25 | #include "priv.h" | 25 | #include "priv.h" |
26 | 26 | ||
27 | #include <core/device.h> | ||
28 | |||
27 | struct nv50_therm_priv { | 29 | struct nv50_therm_priv { |
28 | struct nvkm_therm_priv base; | 30 | struct nvkm_therm_priv base; |
29 | }; | 31 | }; |
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 @@ | |||
21 | * | 21 | * |
22 | * Authors: Ben Skeggs | 22 | * Authors: Ben Skeggs |
23 | */ | 23 | */ |
24 | 24 | #include <subdev/timer.h> | |
25 | #include "subdev/timer.h" | ||
26 | 25 | ||
27 | bool | 26 | bool |
28 | nouveau_timer_wait_eq(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) | 27 | nvkm_timer_wait_eq(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) |
29 | { | 28 | { |
30 | struct nouveau_timer *ptimer = nouveau_timer(obj); | 29 | struct nvkm_timer *ptimer = nvkm_timer(obj); |
31 | u64 time0; | 30 | u64 time0; |
32 | 31 | ||
33 | time0 = ptimer->read(ptimer); | 32 | time0 = ptimer->read(ptimer); |
@@ -45,9 +44,9 @@ nouveau_timer_wait_eq(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) | |||
45 | } | 44 | } |
46 | 45 | ||
47 | bool | 46 | bool |
48 | nouveau_timer_wait_ne(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) | 47 | nvkm_timer_wait_ne(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) |
49 | { | 48 | { |
50 | struct nouveau_timer *ptimer = nouveau_timer(obj); | 49 | struct nvkm_timer *ptimer = nvkm_timer(obj); |
51 | u64 time0; | 50 | u64 time0; |
52 | 51 | ||
53 | time0 = ptimer->read(ptimer); | 52 | time0 = ptimer->read(ptimer); |
@@ -65,9 +64,9 @@ nouveau_timer_wait_ne(void *obj, u64 nsec, u32 addr, u32 mask, u32 data) | |||
65 | } | 64 | } |
66 | 65 | ||
67 | bool | 66 | bool |
68 | nouveau_timer_wait_cb(void *obj, u64 nsec, bool (*func)(void *), void *data) | 67 | nvkm_timer_wait_cb(void *obj, u64 nsec, bool (*func)(void *), void *data) |
69 | { | 68 | { |
70 | struct nouveau_timer *ptimer = nouveau_timer(obj); | 69 | struct nvkm_timer *ptimer = nvkm_timer(obj); |
71 | u64 time0; | 70 | u64 time0; |
72 | 71 | ||
73 | time0 = ptimer->read(ptimer); | 72 | time0 = ptimer->read(ptimer); |
@@ -80,15 +79,15 @@ nouveau_timer_wait_cb(void *obj, u64 nsec, bool (*func)(void *), void *data) | |||
80 | } | 79 | } |
81 | 80 | ||
82 | void | 81 | void |
83 | nouveau_timer_alarm(void *obj, u32 nsec, struct nouveau_alarm *alarm) | 82 | nvkm_timer_alarm(void *obj, u32 nsec, struct nvkm_alarm *alarm) |
84 | { | 83 | { |
85 | struct nouveau_timer *ptimer = nouveau_timer(obj); | 84 | struct nvkm_timer *ptimer = nvkm_timer(obj); |
86 | ptimer->alarm(ptimer, nsec, alarm); | 85 | ptimer->alarm(ptimer, nsec, alarm); |
87 | } | 86 | } |
88 | 87 | ||
89 | void | 88 | void |
90 | nouveau_timer_alarm_cancel(void *obj, struct nouveau_alarm *alarm) | 89 | nvkm_timer_alarm_cancel(void *obj, struct nvkm_alarm *alarm) |
91 | { | 90 | { |
92 | struct nouveau_timer *ptimer = nouveau_timer(obj); | 91 | struct nvkm_timer *ptimer = nvkm_timer(obj); |
93 | ptimer->alarm_cancel(ptimer, alarm); | 92 | ptimer->alarm_cancel(ptimer, alarm); |
94 | } | 93 | } |
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 @@ | |||
21 | * | 21 | * |
22 | * Authors: Ben Skeggs | 22 | * Authors: Ben Skeggs |
23 | */ | 23 | */ |
24 | |||
25 | #include "nv04.h" | 24 | #include "nv04.h" |
26 | 25 | ||
27 | static int | 26 | static int |
28 | gk20a_timer_init(struct nouveau_object *object) | 27 | gk20a_timer_init(struct nvkm_object *object) |
29 | { | 28 | { |
30 | struct nv04_timer_priv *priv = (void *)object; | 29 | struct nv04_timer_priv *priv = (void *)object; |
31 | u32 hi = upper_32_bits(priv->suspend_time); | 30 | u32 hi = upper_32_bits(priv->suspend_time); |
32 | u32 lo = lower_32_bits(priv->suspend_time); | 31 | u32 lo = lower_32_bits(priv->suspend_time); |
33 | int ret; | 32 | int ret; |
34 | 33 | ||
35 | ret = nouveau_timer_init(&priv->base); | 34 | ret = nvkm_timer_init(&priv->base); |
36 | if (ret) | 35 | if (ret) |
37 | return ret; | 36 | return ret; |
38 | 37 | ||
@@ -45,10 +44,10 @@ gk20a_timer_init(struct nouveau_object *object) | |||
45 | return 0; | 44 | return 0; |
46 | } | 45 | } |
47 | 46 | ||
48 | struct nouveau_oclass | 47 | struct nvkm_oclass |
49 | gk20a_timer_oclass = { | 48 | gk20a_timer_oclass = { |
50 | .handle = NV_SUBDEV(TIMER, 0xff), | 49 | .handle = NV_SUBDEV(TIMER, 0xff), |
51 | .ofuncs = &(struct nouveau_ofuncs) { | 50 | .ofuncs = &(struct nvkm_ofuncs) { |
52 | .ctor = nv04_timer_ctor, | 51 | .ctor = nv04_timer_ctor, |
53 | .dtor = nv04_timer_dtor, | 52 | .dtor = nv04_timer_dtor, |
54 | .init = gk20a_timer_init, | 53 | .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 @@ | |||
21 | * | 21 | * |
22 | * Authors: Ben Skeggs | 22 | * Authors: Ben Skeggs |
23 | */ | 23 | */ |
24 | |||
25 | #include "nv04.h" | 24 | #include "nv04.h" |
26 | 25 | ||
26 | #include <core/device.h> | ||
27 | |||
27 | static u64 | 28 | static u64 |
28 | nv04_timer_read(struct nouveau_timer *ptimer) | 29 | nv04_timer_read(struct nvkm_timer *ptimer) |
29 | { | 30 | { |
30 | struct nv04_timer_priv *priv = (void *)ptimer; | 31 | struct nv04_timer_priv *priv = (void *)ptimer; |
31 | u32 hi, lo; | 32 | u32 hi, lo; |
@@ -39,10 +40,10 @@ nv04_timer_read(struct nouveau_timer *ptimer) | |||
39 | } | 40 | } |
40 | 41 | ||
41 | static void | 42 | static void |
42 | nv04_timer_alarm_trigger(struct nouveau_timer *ptimer) | 43 | nv04_timer_alarm_trigger(struct nvkm_timer *ptimer) |
43 | { | 44 | { |
44 | struct nv04_timer_priv *priv = (void *)ptimer; | 45 | struct nv04_timer_priv *priv = (void *)ptimer; |
45 | struct nouveau_alarm *alarm, *atemp; | 46 | struct nvkm_alarm *alarm, *atemp; |
46 | unsigned long flags; | 47 | unsigned long flags; |
47 | LIST_HEAD(exec); | 48 | LIST_HEAD(exec); |
48 | 49 | ||
@@ -71,11 +72,10 @@ nv04_timer_alarm_trigger(struct nouveau_timer *ptimer) | |||
71 | } | 72 | } |
72 | 73 | ||
73 | static void | 74 | static void |
74 | nv04_timer_alarm(struct nouveau_timer *ptimer, u64 time, | 75 | nv04_timer_alarm(struct nvkm_timer *ptimer, u64 time, struct nvkm_alarm *alarm) |
75 | struct nouveau_alarm *alarm) | ||
76 | { | 76 | { |
77 | struct nv04_timer_priv *priv = (void *)ptimer; | 77 | struct nv04_timer_priv *priv = (void *)ptimer; |
78 | struct nouveau_alarm *list; | 78 | struct nvkm_alarm *list; |
79 | unsigned long flags; | 79 | unsigned long flags; |
80 | 80 | ||
81 | alarm->timestamp = ptimer->read(ptimer) + time; | 81 | alarm->timestamp = ptimer->read(ptimer) + time; |
@@ -99,8 +99,7 @@ nv04_timer_alarm(struct nouveau_timer *ptimer, u64 time, | |||
99 | } | 99 | } |
100 | 100 | ||
101 | static void | 101 | static void |
102 | nv04_timer_alarm_cancel(struct nouveau_timer *ptimer, | 102 | nv04_timer_alarm_cancel(struct nvkm_timer *ptimer, struct nvkm_alarm *alarm) |
103 | struct nouveau_alarm *alarm) | ||
104 | { | 103 | { |
105 | struct nv04_timer_priv *priv = (void *)ptimer; | 104 | struct nv04_timer_priv *priv = (void *)ptimer; |
106 | unsigned long flags; | 105 | unsigned long flags; |
@@ -110,7 +109,7 @@ nv04_timer_alarm_cancel(struct nouveau_timer *ptimer, | |||
110 | } | 109 | } |
111 | 110 | ||
112 | static void | 111 | static void |
113 | nv04_timer_intr(struct nouveau_subdev *subdev) | 112 | nv04_timer_intr(struct nvkm_subdev *subdev) |
114 | { | 113 | { |
115 | struct nv04_timer_priv *priv = (void *)subdev; | 114 | struct nv04_timer_priv *priv = (void *)subdev; |
116 | u32 stat = nv_rd32(priv, NV04_PTIMER_INTR_0); | 115 | u32 stat = nv_rd32(priv, NV04_PTIMER_INTR_0); |
@@ -128,24 +127,24 @@ nv04_timer_intr(struct nouveau_subdev *subdev) | |||
128 | } | 127 | } |
129 | 128 | ||
130 | int | 129 | int |
131 | nv04_timer_fini(struct nouveau_object *object, bool suspend) | 130 | nv04_timer_fini(struct nvkm_object *object, bool suspend) |
132 | { | 131 | { |
133 | struct nv04_timer_priv *priv = (void *)object; | 132 | struct nv04_timer_priv *priv = (void *)object; |
134 | if (suspend) | 133 | if (suspend) |
135 | priv->suspend_time = nv04_timer_read(&priv->base); | 134 | priv->suspend_time = nv04_timer_read(&priv->base); |
136 | nv_wr32(priv, NV04_PTIMER_INTR_EN_0, 0x00000000); | 135 | nv_wr32(priv, NV04_PTIMER_INTR_EN_0, 0x00000000); |
137 | return nouveau_timer_fini(&priv->base, suspend); | 136 | return nvkm_timer_fini(&priv->base, suspend); |
138 | } | 137 | } |
139 | 138 | ||
140 | static int | 139 | static int |
141 | nv04_timer_init(struct nouveau_object *object) | 140 | nv04_timer_init(struct nvkm_object *object) |
142 | { | 141 | { |
143 | struct nouveau_device *device = nv_device(object); | 142 | struct nvkm_device *device = nv_device(object); |
144 | struct nv04_timer_priv *priv = (void *)object; | 143 | struct nv04_timer_priv *priv = (void *)object; |
145 | u32 m = 1, f, n, d, lo, hi; | 144 | u32 m = 1, f, n, d, lo, hi; |
146 | int ret; | 145 | int ret; |
147 | 146 | ||
148 | ret = nouveau_timer_init(&priv->base); | 147 | ret = nvkm_timer_init(&priv->base); |
149 | if (ret) | 148 | if (ret) |
150 | return ret; | 149 | return ret; |
151 | 150 | ||
@@ -155,7 +154,7 @@ nv04_timer_init(struct nouveau_object *object) | |||
155 | /* determine base clock for timer source */ | 154 | /* determine base clock for timer source */ |
156 | #if 0 /*XXX*/ | 155 | #if 0 /*XXX*/ |
157 | if (device->chipset < 0x40) { | 156 | if (device->chipset < 0x40) { |
158 | n = nouveau_hw_get_clock(device, PLL_CORE); | 157 | n = nvkm_hw_get_clock(device, PLL_CORE); |
159 | } else | 158 | } else |
160 | #endif | 159 | #endif |
161 | if (device->chipset <= 0x40) { | 160 | if (device->chipset <= 0x40) { |
@@ -217,26 +216,25 @@ nv04_timer_init(struct nouveau_object *object) | |||
217 | nv_wr32(priv, NV04_PTIMER_INTR_EN_0, 0x00000000); | 216 | nv_wr32(priv, NV04_PTIMER_INTR_EN_0, 0x00000000); |
218 | nv_wr32(priv, NV04_PTIMER_TIME_1, hi); | 217 | nv_wr32(priv, NV04_PTIMER_TIME_1, hi); |
219 | nv_wr32(priv, NV04_PTIMER_TIME_0, lo); | 218 | nv_wr32(priv, NV04_PTIMER_TIME_0, lo); |
220 | |||
221 | return 0; | 219 | return 0; |
222 | } | 220 | } |
223 | 221 | ||
224 | void | 222 | void |
225 | nv04_timer_dtor(struct nouveau_object *object) | 223 | nv04_timer_dtor(struct nvkm_object *object) |
226 | { | 224 | { |
227 | struct nv04_timer_priv *priv = (void *)object; | 225 | struct nv04_timer_priv *priv = (void *)object; |
228 | return nouveau_timer_destroy(&priv->base); | 226 | return nvkm_timer_destroy(&priv->base); |
229 | } | 227 | } |
230 | 228 | ||
231 | int | 229 | int |
232 | nv04_timer_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | 230 | nv04_timer_ctor(struct nvkm_object *parent, struct nvkm_object *engine, |
233 | struct nouveau_oclass *oclass, void *data, u32 size, | 231 | struct nvkm_oclass *oclass, void *data, u32 size, |
234 | struct nouveau_object **pobject) | 232 | struct nvkm_object **pobject) |
235 | { | 233 | { |
236 | struct nv04_timer_priv *priv; | 234 | struct nv04_timer_priv *priv; |
237 | int ret; | 235 | int ret; |
238 | 236 | ||
239 | ret = nouveau_timer_create(parent, engine, oclass, &priv); | 237 | ret = nvkm_timer_create(parent, engine, oclass, &priv); |
240 | *pobject = nv_object(priv); | 238 | *pobject = nv_object(priv); |
241 | if (ret) | 239 | if (ret) |
242 | return ret; | 240 | return ret; |
@@ -252,10 +250,10 @@ nv04_timer_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
252 | return 0; | 250 | return 0; |
253 | } | 251 | } |
254 | 252 | ||
255 | struct nouveau_oclass | 253 | struct nvkm_oclass |
256 | nv04_timer_oclass = { | 254 | nv04_timer_oclass = { |
257 | .handle = NV_SUBDEV(TIMER, 0x04), | 255 | .handle = NV_SUBDEV(TIMER, 0x04), |
258 | .ofuncs = &(struct nouveau_ofuncs) { | 256 | .ofuncs = &(struct nvkm_ofuncs) { |
259 | .ctor = nv04_timer_ctor, | 257 | .ctor = nv04_timer_ctor, |
260 | .dtor = nv04_timer_dtor, | 258 | .dtor = nv04_timer_dtor, |
261 | .init = nv04_timer_init, | 259 | .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 @@ | |||
1 | #ifndef __NVKM_TIMER_NV04_H__ | 1 | #ifndef __NVKM_TIMER_NV04_H__ |
2 | #define __NVKM_TIMER_NV04_H__ | 2 | #define __NVKM_TIMER_NV04_H__ |
3 | |||
4 | #include "priv.h" | 3 | #include "priv.h" |
5 | 4 | ||
6 | #define NV04_PTIMER_INTR_0 0x009100 | 5 | #define NV04_PTIMER_INTR_0 0x009100 |
@@ -12,16 +11,15 @@ | |||
12 | #define NV04_PTIMER_ALARM_0 0x009420 | 11 | #define NV04_PTIMER_ALARM_0 0x009420 |
13 | 12 | ||
14 | struct nv04_timer_priv { | 13 | struct nv04_timer_priv { |
15 | struct nouveau_timer base; | 14 | struct nvkm_timer base; |
16 | struct list_head alarms; | 15 | struct list_head alarms; |
17 | spinlock_t lock; | 16 | spinlock_t lock; |
18 | u64 suspend_time; | 17 | u64 suspend_time; |
19 | }; | 18 | }; |
20 | 19 | ||
21 | int nv04_timer_ctor(struct nouveau_object *, struct nouveau_object *, | 20 | int nv04_timer_ctor(struct nvkm_object *, struct nvkm_object *, |
22 | struct nouveau_oclass *, void *, u32, | 21 | struct nvkm_oclass *, void *, u32, |
23 | struct nouveau_object **); | 22 | struct nvkm_object **); |
24 | void nv04_timer_dtor(struct nouveau_object *); | 23 | void nv04_timer_dtor(struct nvkm_object *); |
25 | int nv04_timer_fini(struct nouveau_object *, bool); | 24 | int nv04_timer_fini(struct nvkm_object *, bool); |
26 | |||
27 | #endif | 25 | #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 @@ | |||
1 | #ifndef __NVKM_TIMER_PRIV_H__ | 1 | #ifndef __NVKM_TIMER_PRIV_H__ |
2 | #define __NVKM_TIMER_PRIV_H__ | 2 | #define __NVKM_TIMER_PRIV_H__ |
3 | |||
4 | #include <subdev/timer.h> | 3 | #include <subdev/timer.h> |
5 | |||
6 | #endif | 4 | #endif |