diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-01-14 00:31:24 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-01-21 21:18:05 -0500 |
commit | 25a6402557d3903e5082fc1afb2f97706abd9a6c (patch) | |
tree | 37e3947355ace6e70dcaa97980c79c5ef90c6184 | |
parent | 4d34686eb607037dafffb9d66d9e50b4648cfda4 (diff) |
drm/nouveau/sec: 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>
-rw-r--r-- | drivers/gpu/drm/nouveau/include/nvkm/engine/sec.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/device/nv50.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/sec/Kbuild | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/g98.fuc0s (renamed from drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/nv98.fuc0s) | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/g98.fuc0s.h (renamed from drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/nv98.fuc0s.h) | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/sec/g98.c (renamed from drivers/gpu/drm/nouveau/nvkm/engine/sec/nv98.c) | 105 |
6 files changed, 60 insertions, 66 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/sec.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/sec.h index 32cd4cb0744c..44590a2a479d 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/engine/sec.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/sec.h | |||
@@ -1,4 +1,5 @@ | |||
1 | #ifndef __NVKM_SEC_H__ | 1 | #ifndef __NVKM_SEC_H__ |
2 | #define __NVKM_SEC_H__ | 2 | #define __NVKM_SEC_H__ |
3 | extern struct nouveau_oclass nv98_sec_oclass; | 3 | #include <core/engine.h> |
4 | extern struct nvkm_oclass g98_sec_oclass; | ||
4 | #endif | 5 | #endif |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/nv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/nv50.c index 4bbd6b7ac997..bf3998b96bc4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/nv50.c | |||
@@ -255,7 +255,7 @@ nv50_identify(struct nouveau_device *device) | |||
255 | device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass; | 255 | device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass; |
256 | device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass; | 256 | device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass; |
257 | device->oclass[NVDEV_ENGINE_MSPDEC ] = &g98_mspdec_oclass; | 257 | device->oclass[NVDEV_ENGINE_MSPDEC ] = &g98_mspdec_oclass; |
258 | device->oclass[NVDEV_ENGINE_SEC ] = &nv98_sec_oclass; | 258 | device->oclass[NVDEV_ENGINE_SEC ] = &g98_sec_oclass; |
259 | device->oclass[NVDEV_ENGINE_MSVLD ] = &g98_msvld_oclass; | 259 | device->oclass[NVDEV_ENGINE_MSVLD ] = &g98_msvld_oclass; |
260 | device->oclass[NVDEV_ENGINE_MSPPP ] = &g98_msppp_oclass; | 260 | device->oclass[NVDEV_ENGINE_MSPPP ] = &g98_msppp_oclass; |
261 | device->oclass[NVDEV_ENGINE_DISP ] = g94_disp_oclass; | 261 | device->oclass[NVDEV_ENGINE_DISP ] = g94_disp_oclass; |
@@ -313,7 +313,7 @@ nv50_identify(struct nouveau_device *device) | |||
313 | device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass; | 313 | device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass; |
314 | device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass; | 314 | device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass; |
315 | device->oclass[NVDEV_ENGINE_MSPDEC ] = &g98_mspdec_oclass; | 315 | device->oclass[NVDEV_ENGINE_MSPDEC ] = &g98_mspdec_oclass; |
316 | device->oclass[NVDEV_ENGINE_SEC ] = &nv98_sec_oclass; | 316 | device->oclass[NVDEV_ENGINE_SEC ] = &g98_sec_oclass; |
317 | device->oclass[NVDEV_ENGINE_MSVLD ] = &g98_msvld_oclass; | 317 | device->oclass[NVDEV_ENGINE_MSVLD ] = &g98_msvld_oclass; |
318 | device->oclass[NVDEV_ENGINE_MSPPP ] = &g98_msppp_oclass; | 318 | device->oclass[NVDEV_ENGINE_MSPPP ] = &g98_msppp_oclass; |
319 | device->oclass[NVDEV_ENGINE_DISP ] = g94_disp_oclass; | 319 | device->oclass[NVDEV_ENGINE_DISP ] = g94_disp_oclass; |
@@ -342,7 +342,7 @@ nv50_identify(struct nouveau_device *device) | |||
342 | device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass; | 342 | device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass; |
343 | device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass; | 343 | device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass; |
344 | device->oclass[NVDEV_ENGINE_MSPDEC ] = &g98_mspdec_oclass; | 344 | device->oclass[NVDEV_ENGINE_MSPDEC ] = &g98_mspdec_oclass; |
345 | device->oclass[NVDEV_ENGINE_SEC ] = &nv98_sec_oclass; | 345 | device->oclass[NVDEV_ENGINE_SEC ] = &g98_sec_oclass; |
346 | device->oclass[NVDEV_ENGINE_MSVLD ] = &g98_msvld_oclass; | 346 | device->oclass[NVDEV_ENGINE_MSVLD ] = &g98_msvld_oclass; |
347 | device->oclass[NVDEV_ENGINE_MSPPP ] = &g98_msppp_oclass; | 347 | device->oclass[NVDEV_ENGINE_MSPPP ] = &g98_msppp_oclass; |
348 | device->oclass[NVDEV_ENGINE_DISP ] = g94_disp_oclass; | 348 | device->oclass[NVDEV_ENGINE_DISP ] = g94_disp_oclass; |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sec/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/sec/Kbuild index 5ce7a5073c97..552d40a4641f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sec/Kbuild +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sec/Kbuild | |||
@@ -1 +1 @@ | |||
nvkm-y += nvkm/engine/sec/nv98.o | nvkm-y += nvkm/engine/sec/g98.o | ||
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/nv98.fuc0s b/drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/g98.fuc0s index 0b9e77782a57..06ee06071104 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/nv98.fuc0s +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/g98.fuc0s | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * fuc microcode for nv98 psec engine | 2 | * fuc microcode for g98 psec engine |
3 | * Copyright (C) 2010 Marcin KoĆcielnicki | 3 | * Copyright (C) 2010 Marcin KoĆcielnicki |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
@@ -17,7 +17,7 @@ | |||
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
18 | */ | 18 | */ |
19 | 19 | ||
20 | .section #nv98_psec_data | 20 | .section #g98_psec_data |
21 | 21 | ||
22 | ctx_dma: | 22 | ctx_dma: |
23 | ctx_dma_query: .b32 0 | 23 | ctx_dma_query: .b32 0 |
@@ -94,7 +94,7 @@ sec_dtable: | |||
94 | 94 | ||
95 | .align 0x100 | 95 | .align 0x100 |
96 | 96 | ||
97 | .section #nv98_psec_code | 97 | .section #g98_psec_code |
98 | 98 | ||
99 | // $r0 is always set to 0 in our code - this allows some space savings. | 99 | // $r0 is always set to 0 in our code - this allows some space savings. |
100 | clear b32 $r0 | 100 | clear b32 $r0 |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/nv98.fuc0s.h b/drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/g98.fuc0s.h index f7e1e135b59b..5d65c4fbb087 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/nv98.fuc0s.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/g98.fuc0s.h | |||
@@ -1,4 +1,4 @@ | |||
1 | uint32_t nv98_psec_data[] = { | 1 | uint32_t g98_psec_data[] = { |
2 | /* 0x0000: ctx_dma */ | 2 | /* 0x0000: ctx_dma */ |
3 | /* 0x0000: ctx_dma_query */ | 3 | /* 0x0000: ctx_dma_query */ |
4 | 0x00000000, | 4 | 0x00000000, |
@@ -150,7 +150,7 @@ uint32_t nv98_psec_data[] = { | |||
150 | 0x00000000, | 150 | 0x00000000, |
151 | }; | 151 | }; |
152 | 152 | ||
153 | uint32_t nv98_psec_code[] = { | 153 | uint32_t g98_psec_code[] = { |
154 | 0x17f004bd, | 154 | 0x17f004bd, |
155 | 0x0010fe35, | 155 | 0x0010fe35, |
156 | 0xf10004fe, | 156 | 0xf10004fe, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sec/nv98.c b/drivers/gpu/drm/nouveau/nvkm/engine/sec/g98.c index 10d0d1ff2694..9d5c1b8b1f8c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/sec/nv98.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/sec/g98.c | |||
@@ -21,32 +21,25 @@ | |||
21 | * | 21 | * |
22 | * Authors: Ben Skeggs | 22 | * Authors: Ben Skeggs |
23 | */ | 23 | */ |
24 | #include <engine/sec.h> | ||
25 | #include <engine/falcon.h> | ||
26 | #include "fuc/g98.fuc0s.h" | ||
24 | 27 | ||
25 | #include <core/client.h> | 28 | #include <core/client.h> |
26 | #include <core/os.h> | ||
27 | #include <core/enum.h> | 29 | #include <core/enum.h> |
28 | #include <core/engctx.h> | ||
29 | |||
30 | #include <subdev/timer.h> | ||
31 | #include <subdev/fb.h> | ||
32 | |||
33 | #include <engine/falcon.h> | ||
34 | #include <engine/fifo.h> | 30 | #include <engine/fifo.h> |
35 | #include <engine/sec.h> | ||
36 | |||
37 | #include "fuc/nv98.fuc0s.h" | ||
38 | 31 | ||
39 | struct nv98_sec_priv { | 32 | struct g98_sec_priv { |
40 | struct nouveau_falcon base; | 33 | struct nvkm_falcon base; |
41 | }; | 34 | }; |
42 | 35 | ||
43 | /******************************************************************************* | 36 | /******************************************************************************* |
44 | * Crypt object classes | 37 | * Crypt object classes |
45 | ******************************************************************************/ | 38 | ******************************************************************************/ |
46 | 39 | ||
47 | static struct nouveau_oclass | 40 | static struct nvkm_oclass |
48 | nv98_sec_sclass[] = { | 41 | g98_sec_sclass[] = { |
49 | { 0x88b4, &nouveau_object_ofuncs }, | 42 | { 0x88b4, &nvkm_object_ofuncs }, |
50 | {}, | 43 | {}, |
51 | }; | 44 | }; |
52 | 45 | ||
@@ -54,16 +47,16 @@ nv98_sec_sclass[] = { | |||
54 | * PSEC context | 47 | * PSEC context |
55 | ******************************************************************************/ | 48 | ******************************************************************************/ |
56 | 49 | ||
57 | static struct nouveau_oclass | 50 | static struct nvkm_oclass |
58 | nv98_sec_cclass = { | 51 | g98_sec_cclass = { |
59 | .handle = NV_ENGCTX(SEC, 0x98), | 52 | .handle = NV_ENGCTX(SEC, 0x98), |
60 | .ofuncs = &(struct nouveau_ofuncs) { | 53 | .ofuncs = &(struct nvkm_ofuncs) { |
61 | .ctor = _nouveau_falcon_context_ctor, | 54 | .ctor = _nvkm_falcon_context_ctor, |
62 | .dtor = _nouveau_falcon_context_dtor, | 55 | .dtor = _nvkm_falcon_context_dtor, |
63 | .init = _nouveau_falcon_context_init, | 56 | .init = _nvkm_falcon_context_init, |
64 | .fini = _nouveau_falcon_context_fini, | 57 | .fini = _nvkm_falcon_context_fini, |
65 | .rd32 = _nouveau_falcon_context_rd32, | 58 | .rd32 = _nvkm_falcon_context_rd32, |
66 | .wr32 = _nouveau_falcon_context_wr32, | 59 | .wr32 = _nvkm_falcon_context_wr32, |
67 | }, | 60 | }, |
68 | }; | 61 | }; |
69 | 62 | ||
@@ -71,7 +64,7 @@ nv98_sec_cclass = { | |||
71 | * PSEC engine/subdev functions | 64 | * PSEC engine/subdev functions |
72 | ******************************************************************************/ | 65 | ******************************************************************************/ |
73 | 66 | ||
74 | static const struct nouveau_enum nv98_sec_isr_error_name[] = { | 67 | static const struct nvkm_enum g98_sec_isr_error_name[] = { |
75 | { 0x0000, "ILLEGAL_MTHD" }, | 68 | { 0x0000, "ILLEGAL_MTHD" }, |
76 | { 0x0001, "INVALID_BITFIELD" }, | 69 | { 0x0001, "INVALID_BITFIELD" }, |
77 | { 0x0002, "INVALID_ENUM" }, | 70 | { 0x0002, "INVALID_ENUM" }, |
@@ -80,12 +73,12 @@ static const struct nouveau_enum nv98_sec_isr_error_name[] = { | |||
80 | }; | 73 | }; |
81 | 74 | ||
82 | static void | 75 | static void |
83 | nv98_sec_intr(struct nouveau_subdev *subdev) | 76 | g98_sec_intr(struct nvkm_subdev *subdev) |
84 | { | 77 | { |
85 | struct nouveau_fifo *pfifo = nouveau_fifo(subdev); | 78 | struct nvkm_fifo *pfifo = nvkm_fifo(subdev); |
86 | struct nouveau_engine *engine = nv_engine(subdev); | 79 | struct nvkm_engine *engine = nv_engine(subdev); |
87 | struct nouveau_object *engctx; | 80 | struct nvkm_object *engctx; |
88 | struct nv98_sec_priv *priv = (void *)subdev; | 81 | struct g98_sec_priv *priv = (void *)subdev; |
89 | u32 disp = nv_rd32(priv, 0x08701c); | 82 | u32 disp = nv_rd32(priv, 0x08701c); |
90 | u32 stat = nv_rd32(priv, 0x087008) & disp & ~(disp >> 16); | 83 | u32 stat = nv_rd32(priv, 0x087008) & disp & ~(disp >> 16); |
91 | u32 inst = nv_rd32(priv, 0x087050) & 0x3fffffff; | 84 | u32 inst = nv_rd32(priv, 0x087050) & 0x3fffffff; |
@@ -96,14 +89,14 @@ nv98_sec_intr(struct nouveau_subdev *subdev) | |||
96 | u32 data = nv_rd32(priv, 0x087044); | 89 | u32 data = nv_rd32(priv, 0x087044); |
97 | int chid; | 90 | int chid; |
98 | 91 | ||
99 | engctx = nouveau_engctx_get(engine, inst); | 92 | engctx = nvkm_engctx_get(engine, inst); |
100 | chid = pfifo->chid(pfifo, engctx); | 93 | chid = pfifo->chid(pfifo, engctx); |
101 | 94 | ||
102 | if (stat & 0x00000040) { | 95 | if (stat & 0x00000040) { |
103 | nv_error(priv, "DISPATCH_ERROR ["); | 96 | nv_error(priv, "DISPATCH_ERROR ["); |
104 | nouveau_enum_print(nv98_sec_isr_error_name, ssta); | 97 | nvkm_enum_print(g98_sec_isr_error_name, ssta); |
105 | pr_cont("] ch %d [0x%010llx %s] subc %d mthd 0x%04x data 0x%08x\n", | 98 | pr_cont("] ch %d [0x%010llx %s] subc %d mthd 0x%04x data 0x%08x\n", |
106 | chid, (u64)inst << 12, nouveau_client_name(engctx), | 99 | chid, (u64)inst << 12, nvkm_client_name(engctx), |
107 | subc, mthd, data); | 100 | subc, mthd, data); |
108 | nv_wr32(priv, 0x087004, 0x00000040); | 101 | nv_wr32(priv, 0x087004, 0x00000040); |
109 | stat &= ~0x00000040; | 102 | stat &= ~0x00000040; |
@@ -114,43 +107,43 @@ nv98_sec_intr(struct nouveau_subdev *subdev) | |||
114 | nv_wr32(priv, 0x087004, stat); | 107 | nv_wr32(priv, 0x087004, stat); |
115 | } | 108 | } |
116 | 109 | ||
117 | nouveau_engctx_put(engctx); | 110 | nvkm_engctx_put(engctx); |
118 | } | 111 | } |
119 | 112 | ||
120 | static int | 113 | static int |
121 | nv98_sec_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | 114 | g98_sec_ctor(struct nvkm_object *parent, struct nvkm_object *engine, |
122 | struct nouveau_oclass *oclass, void *data, u32 size, | 115 | struct nvkm_oclass *oclass, void *data, u32 size, |
123 | struct nouveau_object **pobject) | 116 | struct nvkm_object **pobject) |
124 | { | 117 | { |
125 | struct nv98_sec_priv *priv; | 118 | struct g98_sec_priv *priv; |
126 | int ret; | 119 | int ret; |
127 | 120 | ||
128 | ret = nouveau_falcon_create(parent, engine, oclass, 0x087000, true, | 121 | ret = nvkm_falcon_create(parent, engine, oclass, 0x087000, true, |
129 | "PSEC", "sec", &priv); | 122 | "PSEC", "sec", &priv); |
130 | *pobject = nv_object(priv); | 123 | *pobject = nv_object(priv); |
131 | if (ret) | 124 | if (ret) |
132 | return ret; | 125 | return ret; |
133 | 126 | ||
134 | nv_subdev(priv)->unit = 0x00004000; | 127 | nv_subdev(priv)->unit = 0x00004000; |
135 | nv_subdev(priv)->intr = nv98_sec_intr; | 128 | nv_subdev(priv)->intr = g98_sec_intr; |
136 | nv_engine(priv)->cclass = &nv98_sec_cclass; | 129 | nv_engine(priv)->cclass = &g98_sec_cclass; |
137 | nv_engine(priv)->sclass = nv98_sec_sclass; | 130 | nv_engine(priv)->sclass = g98_sec_sclass; |
138 | nv_falcon(priv)->code.data = nv98_psec_code; | 131 | nv_falcon(priv)->code.data = g98_psec_code; |
139 | nv_falcon(priv)->code.size = sizeof(nv98_psec_code); | 132 | nv_falcon(priv)->code.size = sizeof(g98_psec_code); |
140 | nv_falcon(priv)->data.data = nv98_psec_data; | 133 | nv_falcon(priv)->data.data = g98_psec_data; |
141 | nv_falcon(priv)->data.size = sizeof(nv98_psec_data); | 134 | nv_falcon(priv)->data.size = sizeof(g98_psec_data); |
142 | return 0; | 135 | return 0; |
143 | } | 136 | } |
144 | 137 | ||
145 | struct nouveau_oclass | 138 | struct nvkm_oclass |
146 | nv98_sec_oclass = { | 139 | g98_sec_oclass = { |
147 | .handle = NV_ENGINE(SEC, 0x98), | 140 | .handle = NV_ENGINE(SEC, 0x98), |
148 | .ofuncs = &(struct nouveau_ofuncs) { | 141 | .ofuncs = &(struct nvkm_ofuncs) { |
149 | .ctor = nv98_sec_ctor, | 142 | .ctor = g98_sec_ctor, |
150 | .dtor = _nouveau_falcon_dtor, | 143 | .dtor = _nvkm_falcon_dtor, |
151 | .init = _nouveau_falcon_init, | 144 | .init = _nvkm_falcon_init, |
152 | .fini = _nouveau_falcon_fini, | 145 | .fini = _nvkm_falcon_fini, |
153 | .rd32 = _nouveau_falcon_rd32, | 146 | .rd32 = _nvkm_falcon_rd32, |
154 | .wr32 = _nouveau_falcon_wr32, | 147 | .wr32 = _nvkm_falcon_wr32, |
155 | }, | 148 | }, |
156 | }; | 149 | }; |