Commit 09f409d7 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/dma: switch to instanced constructor

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent a7f000ec
...@@ -60,7 +60,6 @@ struct nvkm_device { ...@@ -60,7 +60,6 @@ struct nvkm_device {
struct notifier_block nb; struct notifier_block nb;
} acpi; } acpi;
struct nvkm_dma *dma;
struct nvkm_fifo *fifo; struct nvkm_fifo *fifo;
struct nvkm_gr *gr; struct nvkm_gr *gr;
struct nvkm_engine *ifb; struct nvkm_engine *ifb;
...@@ -118,7 +117,6 @@ struct nvkm_device_chip { ...@@ -118,7 +117,6 @@ struct nvkm_device_chip {
#undef NVKM_LAYOUT_INST #undef NVKM_LAYOUT_INST
#undef NVKM_LAYOUT_ONCE #undef NVKM_LAYOUT_ONCE
int (*dma )(struct nvkm_device *, int idx, struct nvkm_dma **);
int (*fifo )(struct nvkm_device *, int idx, struct nvkm_fifo **); int (*fifo )(struct nvkm_device *, int idx, struct nvkm_fifo **);
int (*gr )(struct nvkm_device *, int idx, struct nvkm_gr **); int (*gr )(struct nvkm_device *, int idx, struct nvkm_gr **);
int (*ifb )(struct nvkm_device *, int idx, struct nvkm_engine **); int (*ifb )(struct nvkm_device *, int idx, struct nvkm_engine **);
......
...@@ -29,4 +29,5 @@ NVKM_LAYOUT_ONCE(NVKM_ENGINE_BSP , struct nvkm_engine , bsp) ...@@ -29,4 +29,5 @@ NVKM_LAYOUT_ONCE(NVKM_ENGINE_BSP , struct nvkm_engine , bsp)
NVKM_LAYOUT_INST(NVKM_ENGINE_CE , struct nvkm_engine , ce, 9) NVKM_LAYOUT_INST(NVKM_ENGINE_CE , struct nvkm_engine , ce, 9)
NVKM_LAYOUT_ONCE(NVKM_ENGINE_CIPHER , struct nvkm_engine , cipher) NVKM_LAYOUT_ONCE(NVKM_ENGINE_CIPHER , struct nvkm_engine , cipher)
NVKM_LAYOUT_ONCE(NVKM_ENGINE_DISP , struct nvkm_disp , disp) NVKM_LAYOUT_ONCE(NVKM_ENGINE_DISP , struct nvkm_disp , disp)
NVKM_LAYOUT_ONCE(NVKM_ENGINE_DMAOBJ , struct nvkm_dma , dma)
NVKM_LAYOUT_ONCE(NVKM_ENGINE_VP , struct nvkm_engine , vp) NVKM_LAYOUT_ONCE(NVKM_ENGINE_VP , struct nvkm_engine , vp)
...@@ -23,9 +23,9 @@ struct nvkm_dma { ...@@ -23,9 +23,9 @@ struct nvkm_dma {
struct nvkm_dmaobj *nvkm_dmaobj_search(struct nvkm_client *, u64 object); struct nvkm_dmaobj *nvkm_dmaobj_search(struct nvkm_client *, u64 object);
int nv04_dma_new(struct nvkm_device *, int, struct nvkm_dma **); int nv04_dma_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_dma **);
int nv50_dma_new(struct nvkm_device *, int, struct nvkm_dma **); int nv50_dma_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_dma **);
int gf100_dma_new(struct nvkm_device *, int, struct nvkm_dma **); int gf100_dma_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_dma **);
int gf119_dma_new(struct nvkm_device *, int, struct nvkm_dma **); int gf119_dma_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_dma **);
int gv100_dma_new(struct nvkm_device *, int, struct nvkm_dma **); int gv100_dma_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_dma **);
#endif #endif
...@@ -33,7 +33,6 @@ nvkm_subdev_type[NVKM_SUBDEV_NR] = { ...@@ -33,7 +33,6 @@ nvkm_subdev_type[NVKM_SUBDEV_NR] = {
#include <core/layout.h> #include <core/layout.h>
#undef NVKM_LAYOUT_ONCE #undef NVKM_LAYOUT_ONCE
#undef NVKM_LAYOUT_INST #undef NVKM_LAYOUT_INST
[NVKM_ENGINE_DMAOBJ ] = "dma",
[NVKM_ENGINE_FIFO ] = "fifo", [NVKM_ENGINE_FIFO ] = "fifo",
[NVKM_ENGINE_GR ] = "gr", [NVKM_ENGINE_GR ] = "gr",
[NVKM_ENGINE_IFB ] = "ifb", [NVKM_ENGINE_IFB ] = "ifb",
......
...@@ -104,7 +104,7 @@ nvkm_dma = { ...@@ -104,7 +104,7 @@ nvkm_dma = {
int int
nvkm_dma_new_(const struct nvkm_dma_func *func, struct nvkm_device *device, nvkm_dma_new_(const struct nvkm_dma_func *func, struct nvkm_device *device,
int index, struct nvkm_dma **pdma) enum nvkm_subdev_type type, int inst, struct nvkm_dma **pdma)
{ {
struct nvkm_dma *dma; struct nvkm_dma *dma;
...@@ -112,5 +112,5 @@ nvkm_dma_new_(const struct nvkm_dma_func *func, struct nvkm_device *device, ...@@ -112,5 +112,5 @@ nvkm_dma_new_(const struct nvkm_dma_func *func, struct nvkm_device *device,
return -ENOMEM; return -ENOMEM;
dma->func = func; dma->func = func;
return nvkm_engine_ctor(&nvkm_dma, device, index, true, &dma->engine); return nvkm_engine_ctor(&nvkm_dma, device, type, inst, true, &dma->engine);
} }
...@@ -30,7 +30,8 @@ gf100_dma = { ...@@ -30,7 +30,8 @@ gf100_dma = {
}; };
int int
gf100_dma_new(struct nvkm_device *device, int index, struct nvkm_dma **pdma) gf100_dma_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_dma **pdma)
{ {
return nvkm_dma_new_(&gf100_dma, device, index, pdma); return nvkm_dma_new_(&gf100_dma, device, type, inst, pdma);
} }
...@@ -30,7 +30,8 @@ gf119_dma = { ...@@ -30,7 +30,8 @@ gf119_dma = {
}; };
int int
gf119_dma_new(struct nvkm_device *device, int index, struct nvkm_dma **pdma) gf119_dma_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_dma **pdma)
{ {
return nvkm_dma_new_(&gf119_dma, device, index, pdma); return nvkm_dma_new_(&gf119_dma, device, type, inst, pdma);
} }
...@@ -28,7 +28,8 @@ gv100_dma = { ...@@ -28,7 +28,8 @@ gv100_dma = {
}; };
int int
gv100_dma_new(struct nvkm_device *device, int index, struct nvkm_dma **pdma) gv100_dma_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_dma **pdma)
{ {
return nvkm_dma_new_(&gv100_dma, device, index, pdma); return nvkm_dma_new_(&gv100_dma, device, type, inst, pdma);
} }
...@@ -30,7 +30,8 @@ nv04_dma = { ...@@ -30,7 +30,8 @@ nv04_dma = {
}; };
int int
nv04_dma_new(struct nvkm_device *device, int index, struct nvkm_dma **pdma) nv04_dma_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_dma **pdma)
{ {
return nvkm_dma_new_(&nv04_dma, device, index, pdma); return nvkm_dma_new_(&nv04_dma, device, type, inst, pdma);
} }
...@@ -30,7 +30,8 @@ nv50_dma = { ...@@ -30,7 +30,8 @@ nv50_dma = {
}; };
int int
nv50_dma_new(struct nvkm_device *device, int index, struct nvkm_dma **pdma) nv50_dma_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_dma **pdma)
{ {
return nvkm_dma_new_(&nv50_dma, device, index, pdma); return nvkm_dma_new_(&nv50_dma, device, type, inst, pdma);
} }
...@@ -9,8 +9,8 @@ struct nvkm_dmaobj_func { ...@@ -9,8 +9,8 @@ struct nvkm_dmaobj_func {
struct nvkm_gpuobj **); struct nvkm_gpuobj **);
}; };
int nvkm_dma_new_(const struct nvkm_dma_func *, struct nvkm_device *, int nvkm_dma_new_(const struct nvkm_dma_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
int index, struct nvkm_dma **); struct nvkm_dma **);
struct nvkm_dma_func { struct nvkm_dma_func {
int (*class_new)(struct nvkm_dma *, const struct nvkm_oclass *, int (*class_new)(struct nvkm_dma *, const struct nvkm_oclass *,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment