diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/falcon.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/falcon.c | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c b/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c index 2914646c8709..f6e9ae95c822 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c | |||
@@ -19,14 +19,14 @@ | |||
19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
20 | * OTHER DEALINGS IN THE SOFTWARE. | 20 | * OTHER DEALINGS IN THE SOFTWARE. |
21 | */ | 21 | */ |
22 | |||
23 | #include <engine/falcon.h> | 22 | #include <engine/falcon.h> |
23 | |||
24 | #include <subdev/timer.h> | 24 | #include <subdev/timer.h> |
25 | 25 | ||
26 | void | 26 | void |
27 | nouveau_falcon_intr(struct nouveau_subdev *subdev) | 27 | nvkm_falcon_intr(struct nvkm_subdev *subdev) |
28 | { | 28 | { |
29 | struct nouveau_falcon *falcon = (void *)subdev; | 29 | struct nvkm_falcon *falcon = (void *)subdev; |
30 | u32 dispatch = nv_ro32(falcon, 0x01c); | 30 | u32 dispatch = nv_ro32(falcon, 0x01c); |
31 | u32 intr = nv_ro32(falcon, 0x008) & dispatch & ~(dispatch >> 16); | 31 | u32 intr = nv_ro32(falcon, 0x008) & dispatch & ~(dispatch >> 16); |
32 | 32 | ||
@@ -43,16 +43,16 @@ nouveau_falcon_intr(struct nouveau_subdev *subdev) | |||
43 | } | 43 | } |
44 | 44 | ||
45 | u32 | 45 | u32 |
46 | _nouveau_falcon_rd32(struct nouveau_object *object, u64 addr) | 46 | _nvkm_falcon_rd32(struct nvkm_object *object, u64 addr) |
47 | { | 47 | { |
48 | struct nouveau_falcon *falcon = (void *)object; | 48 | struct nvkm_falcon *falcon = (void *)object; |
49 | return nv_rd32(falcon, falcon->addr + addr); | 49 | return nv_rd32(falcon, falcon->addr + addr); |
50 | } | 50 | } |
51 | 51 | ||
52 | void | 52 | void |
53 | _nouveau_falcon_wr32(struct nouveau_object *object, u64 addr, u32 data) | 53 | _nvkm_falcon_wr32(struct nvkm_object *object, u64 addr, u32 data) |
54 | { | 54 | { |
55 | struct nouveau_falcon *falcon = (void *)object; | 55 | struct nvkm_falcon *falcon = (void *)object; |
56 | nv_wr32(falcon, falcon->addr + addr, data); | 56 | nv_wr32(falcon, falcon->addr + addr, data); |
57 | } | 57 | } |
58 | 58 | ||
@@ -67,17 +67,17 @@ vmemdup(const void *src, size_t len) | |||
67 | } | 67 | } |
68 | 68 | ||
69 | int | 69 | int |
70 | _nouveau_falcon_init(struct nouveau_object *object) | 70 | _nvkm_falcon_init(struct nvkm_object *object) |
71 | { | 71 | { |
72 | struct nouveau_device *device = nv_device(object); | 72 | struct nvkm_device *device = nv_device(object); |
73 | struct nouveau_falcon *falcon = (void *)object; | 73 | struct nvkm_falcon *falcon = (void *)object; |
74 | const struct firmware *fw; | 74 | const struct firmware *fw; |
75 | char name[32] = "internal"; | 75 | char name[32] = "internal"; |
76 | int ret, i; | 76 | int ret, i; |
77 | u32 caps; | 77 | u32 caps; |
78 | 78 | ||
79 | /* enable engine, and determine its capabilities */ | 79 | /* enable engine, and determine its capabilities */ |
80 | ret = nouveau_engine_init(&falcon->base); | 80 | ret = nvkm_engine_init(&falcon->base); |
81 | if (ret) | 81 | if (ret) |
82 | return ret; | 82 | return ret; |
83 | 83 | ||
@@ -171,9 +171,8 @@ _nouveau_falcon_init(struct nouveau_object *object) | |||
171 | 171 | ||
172 | /* ensure any "self-bootstrapping" firmware image is in vram */ | 172 | /* ensure any "self-bootstrapping" firmware image is in vram */ |
173 | if (!falcon->data.data && !falcon->core) { | 173 | if (!falcon->data.data && !falcon->core) { |
174 | ret = nouveau_gpuobj_new(object->parent, NULL, | 174 | ret = nvkm_gpuobj_new(object->parent, NULL, falcon->code.size, |
175 | falcon->code.size, 256, 0, | 175 | 256, 0, &falcon->core); |
176 | &falcon->core); | ||
177 | if (ret) { | 176 | if (ret) { |
178 | nv_error(falcon, "core allocation failed, %d\n", ret); | 177 | nv_error(falcon, "core allocation failed, %d\n", ret); |
179 | return ret; | 178 | return ret; |
@@ -238,12 +237,12 @@ _nouveau_falcon_init(struct nouveau_object *object) | |||
238 | } | 237 | } |
239 | 238 | ||
240 | int | 239 | int |
241 | _nouveau_falcon_fini(struct nouveau_object *object, bool suspend) | 240 | _nvkm_falcon_fini(struct nvkm_object *object, bool suspend) |
242 | { | 241 | { |
243 | struct nouveau_falcon *falcon = (void *)object; | 242 | struct nvkm_falcon *falcon = (void *)object; |
244 | 243 | ||
245 | if (!suspend) { | 244 | if (!suspend) { |
246 | nouveau_gpuobj_ref(NULL, &falcon->core); | 245 | nvkm_gpuobj_ref(NULL, &falcon->core); |
247 | if (falcon->external) { | 246 | if (falcon->external) { |
248 | vfree(falcon->data.data); | 247 | vfree(falcon->data.data); |
249 | vfree(falcon->code.data); | 248 | vfree(falcon->code.data); |
@@ -254,21 +253,20 @@ _nouveau_falcon_fini(struct nouveau_object *object, bool suspend) | |||
254 | nv_mo32(falcon, 0x048, 0x00000003, 0x00000000); | 253 | nv_mo32(falcon, 0x048, 0x00000003, 0x00000000); |
255 | nv_wo32(falcon, 0x014, 0xffffffff); | 254 | nv_wo32(falcon, 0x014, 0xffffffff); |
256 | 255 | ||
257 | return nouveau_engine_fini(&falcon->base, suspend); | 256 | return nvkm_engine_fini(&falcon->base, suspend); |
258 | } | 257 | } |
259 | 258 | ||
260 | int | 259 | int |
261 | nouveau_falcon_create_(struct nouveau_object *parent, | 260 | nvkm_falcon_create_(struct nvkm_object *parent, struct nvkm_object *engine, |
262 | struct nouveau_object *engine, | 261 | struct nvkm_oclass *oclass, u32 addr, bool enable, |
263 | struct nouveau_oclass *oclass, u32 addr, bool enable, | 262 | const char *iname, const char *fname, |
264 | const char *iname, const char *fname, | 263 | int length, void **pobject) |
265 | int length, void **pobject) | ||
266 | { | 264 | { |
267 | struct nouveau_falcon *falcon; | 265 | struct nvkm_falcon *falcon; |
268 | int ret; | 266 | int ret; |
269 | 267 | ||
270 | ret = nouveau_engine_create_(parent, engine, oclass, enable, iname, | 268 | ret = nvkm_engine_create_(parent, engine, oclass, enable, iname, |
271 | fname, length, pobject); | 269 | fname, length, pobject); |
272 | falcon = *pobject; | 270 | falcon = *pobject; |
273 | if (ret) | 271 | if (ret) |
274 | return ret; | 272 | return ret; |