Commit 864d37c3 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/gr: switch to instanced constructor

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent f8fabd31
......@@ -60,7 +60,6 @@ struct nvkm_device {
struct notifier_block nb;
} acpi;
struct nvkm_gr *gr;
struct nvkm_engine *ifb;
struct nvkm_engine *me;
struct nvkm_engine *mpeg;
......@@ -116,7 +115,6 @@ struct nvkm_device_chip {
#undef NVKM_LAYOUT_INST
#undef NVKM_LAYOUT_ONCE
int (*gr )(struct nvkm_device *, int idx, struct nvkm_gr **);
int (*ifb )(struct nvkm_device *, int idx, struct nvkm_engine **);
int (*me )(struct nvkm_device *, int idx, struct nvkm_engine **);
int (*mpeg )(struct nvkm_device *, int idx, struct nvkm_engine **);
......
......@@ -31,4 +31,5 @@ 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_DMAOBJ , struct nvkm_dma , dma)
NVKM_LAYOUT_ONCE(NVKM_ENGINE_FIFO , struct nvkm_fifo , fifo)
NVKM_LAYOUT_ONCE(NVKM_ENGINE_GR , struct nvkm_gr , gr)
NVKM_LAYOUT_ONCE(NVKM_ENGINE_VP , struct nvkm_engine , vp)
......@@ -14,44 +14,44 @@ int nvkm_gr_ctxsw_pause(struct nvkm_device *);
int nvkm_gr_ctxsw_resume(struct nvkm_device *);
u32 nvkm_gr_ctxsw_inst(struct nvkm_device *);
int nv04_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int nv10_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int nv15_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int nv17_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int nv20_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int nv25_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int nv2a_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int nv30_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int nv34_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int nv35_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int nv40_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int nv44_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int nv50_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int g84_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gt200_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int mcp79_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gt215_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int mcp89_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gf100_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gf104_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gf108_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gf110_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gf117_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gf119_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gk104_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gk110_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gk110b_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gk208_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gk20a_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gm107_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gm200_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gm20b_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gp100_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gp102_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gp104_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gp107_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gp108_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gp10b_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int gv100_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int tu102_gr_new(struct nvkm_device *, int, struct nvkm_gr **);
int nv04_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int nv10_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int nv15_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int nv17_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int nv20_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int nv25_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int nv2a_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int nv30_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int nv34_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int nv35_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int nv40_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int nv44_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int nv50_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int g84_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gt200_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int mcp79_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gt215_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int mcp89_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gf100_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gf104_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gf108_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gf110_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gf117_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gf119_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gk104_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gk110_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gk110b_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gk208_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gk20a_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gm107_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gm200_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gm20b_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gp100_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gp102_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gp104_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gp107_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gp108_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gp10b_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int gv100_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
int tu102_gr_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_gr **);
#endif
......@@ -33,7 +33,6 @@ nvkm_subdev_type[NVKM_SUBDEV_NR] = {
#include <core/layout.h>
#undef NVKM_LAYOUT_ONCE
#undef NVKM_LAYOUT_INST
[NVKM_ENGINE_GR ] = "gr",
[NVKM_ENGINE_IFB ] = "ifb",
[NVKM_ENGINE_ME ] = "me",
[NVKM_ENGINE_MPEG ] = "mpeg",
......
......@@ -175,8 +175,8 @@ nvkm_gr = {
int
nvkm_gr_ctor(const struct nvkm_gr_func *func, struct nvkm_device *device,
int index, bool enable, struct nvkm_gr *gr)
enum nvkm_subdev_type type, int inst, bool enable, struct nvkm_gr *gr)
{
gr->func = func;
return nvkm_engine_ctor(&nvkm_gr, device, index, enable, &gr->engine);
return nvkm_engine_ctor(&nvkm_gr, device, type, inst, enable, &gr->engine);
}
......@@ -192,7 +192,7 @@ g84_gr = {
};
int
g84_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
g84_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv50_gr_new_(&g84_gr, device, index, pgr);
return nv50_gr_new_(&g84_gr, device, type, inst, pgr);
}
......@@ -2087,8 +2087,8 @@ gf100_gr_flcn = {
};
int
gf100_gr_new_(const struct gf100_gr_fwif *fwif,
struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gf100_gr_new_(const struct gf100_gr_fwif *fwif, struct nvkm_device *device,
enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
struct gf100_gr *gr;
int ret;
......@@ -2097,7 +2097,7 @@ gf100_gr_new_(const struct gf100_gr_fwif *fwif,
return -ENOMEM;
*pgr = &gr->base;
ret = nvkm_gr_ctor(&gf100_gr_, device, index, true, &gr->base);
ret = nvkm_gr_ctor(&gf100_gr_, device, type, inst, true, &gr->base);
if (ret)
return ret;
......@@ -2483,7 +2483,7 @@ gf100_gr_fwif[] = {
};
int
gf100_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gf100_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gf100_gr_fwif, device, index, pgr);
return gf100_gr_new_(gf100_gr_fwif, device, type, inst, pgr);
}
......@@ -416,6 +416,6 @@ void gm20b_gr_acr_bld_patch(struct nvkm_acr *, u32, s64);
extern const struct nvkm_acr_lsf_func gp108_gr_gpccs_acr;
extern const struct nvkm_acr_lsf_func gp108_gr_fecs_acr;
int gf100_gr_new_(const struct gf100_gr_fwif *, struct nvkm_device *, int,
int gf100_gr_new_(const struct gf100_gr_fwif *, struct nvkm_device *, enum nvkm_subdev_type, int,
struct nvkm_gr **);
#endif
......@@ -152,7 +152,7 @@ gf104_gr_fwif[] = {
};
int
gf104_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gf104_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gf104_gr_fwif, device, index, pgr);
return gf100_gr_new_(gf104_gr_fwif, device, type, inst, pgr);
}
......@@ -151,7 +151,7 @@ gf108_gr_fwif[] = {
};
int
gf108_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gf108_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gf108_gr_fwif, device, index, pgr);
return gf100_gr_new_(gf108_gr_fwif, device, type, inst, pgr);
}
......@@ -127,7 +127,7 @@ gf110_gr_fwif[] = {
};
int
gf110_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gf110_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gf110_gr_fwif, device, index, pgr);
return gf100_gr_new_(gf110_gr_fwif, device, type, inst, pgr);
}
......@@ -192,7 +192,7 @@ gf117_gr_fwif[] = {
};
int
gf117_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gf117_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gf117_gr_fwif, device, index, pgr);
return gf100_gr_new_(gf117_gr_fwif, device, type, inst, pgr);
}
......@@ -218,7 +218,7 @@ gf119_gr_fwif[] = {
};
int
gf119_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gf119_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gf119_gr_fwif, device, index, pgr);
return gf100_gr_new_(gf119_gr_fwif, device, type, inst, pgr);
}
......@@ -497,7 +497,7 @@ gk104_gr_fwif[] = {
};
int
gk104_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gk104_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gk104_gr_fwif, device, index, pgr);
return gf100_gr_new_(gk104_gr_fwif, device, type, inst, pgr);
}
......@@ -393,7 +393,7 @@ gk110_gr_fwif[] = {
};
int
gk110_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gk110_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gk110_gr_fwif, device, index, pgr);
return gf100_gr_new_(gk110_gr_fwif, device, type, inst, pgr);
}
......@@ -144,7 +144,8 @@ gk110b_gr_fwif[] = {
};
int
gk110b_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gk110b_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
struct nvkm_gr **pgr)
{
return gf100_gr_new_(gk110b_gr_fwif, device, index, pgr);
return gf100_gr_new_(gk110b_gr_fwif, device, type, inst, pgr);
}
......@@ -202,7 +202,7 @@ gk208_gr_fwif[] = {
};
int
gk208_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gk208_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gk208_gr_fwif, device, index, pgr);
return gf100_gr_new_(gk208_gr_fwif, device, type, inst, pgr);
}
......@@ -357,7 +357,7 @@ gk20a_gr_fwif[] = {
};
int
gk20a_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gk20a_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gk20a_gr_fwif, device, index, pgr);
return gf100_gr_new_(gk20a_gr_fwif, device, type, inst, pgr);
}
......@@ -437,7 +437,7 @@ gm107_gr_fwif[] = {
};
int
gm107_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gm107_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gm107_gr_fwif, device, index, pgr);
return gf100_gr_new_(gm107_gr_fwif, device, type, inst, pgr);
}
......@@ -288,7 +288,7 @@ gm200_gr_fwif[] = {
};
int
gm200_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gm200_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gm200_gr_fwif, device, index, pgr);
return gf100_gr_new_(gm200_gr_fwif, device, type, inst, pgr);
}
......@@ -181,7 +181,7 @@ gm20b_gr_fwif[] = {
};
int
gm20b_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gm20b_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gm20b_gr_fwif, device, index, pgr);
return gf100_gr_new_(gm20b_gr_fwif, device, type, inst, pgr);
}
......@@ -156,7 +156,7 @@ gp100_gr_fwif[] = {
};
int
gp100_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gp100_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gp100_gr_fwif, device, index, pgr);
return gf100_gr_new_(gp100_gr_fwif, device, type, inst, pgr);
}
......@@ -152,7 +152,7 @@ gp102_gr_fwif[] = {
};
int
gp102_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gp102_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gp102_gr_fwif, device, index, pgr);
return gf100_gr_new_(gp102_gr_fwif, device, type, inst, pgr);
}
......@@ -93,7 +93,7 @@ gp104_gr_fwif[] = {
};
int
gp104_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gp104_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gp104_gr_fwif, device, index, pgr);
return gf100_gr_new_(gp104_gr_fwif, device, type, inst, pgr);
}
......@@ -82,7 +82,7 @@ gp107_gr_fwif[] = {
};
int
gp107_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gp107_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gp107_gr_fwif, device, index, pgr);
return gf100_gr_new_(gp107_gr_fwif, device, type, inst, pgr);
}
......@@ -92,7 +92,7 @@ gp108_gr_fwif[] = {
};
int
gp108_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gp108_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gp108_gr_fwif, device, index, pgr);
return gf100_gr_new_(gp108_gr_fwif, device, type, inst, pgr);
}
......@@ -94,7 +94,7 @@ gp10b_gr_fwif[] = {
};
int
gp10b_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gp10b_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gp10b_gr_fwif, device, index, pgr);
return gf100_gr_new_(gp10b_gr_fwif, device, type, inst, pgr);
}
......@@ -43,7 +43,7 @@ gt200_gr = {
};
int
gt200_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gt200_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv50_gr_new_(&gt200_gr, device, index, pgr);
return nv50_gr_new_(&gt200_gr, device, type, inst, pgr);
}
......@@ -44,7 +44,7 @@ gt215_gr = {
};
int
gt215_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gt215_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv50_gr_new_(&gt215_gr, device, index, pgr);
return nv50_gr_new_(&gt215_gr, device, type, inst, pgr);
}
......@@ -141,7 +141,7 @@ gv100_gr_fwif[] = {
};
int
gv100_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
gv100_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(gv100_gr_fwif, device, index, pgr);
return gf100_gr_new_(gv100_gr_fwif, device, type, inst, pgr);
}
......@@ -42,7 +42,7 @@ mcp79_gr = {
};
int
mcp79_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
mcp79_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv50_gr_new_(&mcp79_gr, device, index, pgr);
return nv50_gr_new_(&mcp79_gr, device, type, inst, pgr);
}
......@@ -44,7 +44,7 @@ mcp89_gr = {
};
int
mcp89_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
mcp89_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv50_gr_new_(&mcp89_gr, device, index, pgr);
return nv50_gr_new_(&mcp89_gr, device, type, inst, pgr);
}
......@@ -1413,7 +1413,7 @@ nv04_gr = {
};
int
nv04_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
nv04_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
struct nv04_gr *gr;
......@@ -1422,5 +1422,5 @@ nv04_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
spin_lock_init(&gr->lock);
*pgr = &gr->base;
return nvkm_gr_ctor(&nv04_gr, device, index, true, &gr->base);
return nvkm_gr_ctor(&nv04_gr, device, type, inst, true, &gr->base);
}
......@@ -1173,7 +1173,7 @@ nv10_gr_init(struct nvkm_gr *base)
int
nv10_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device,
int index, struct nvkm_gr **pgr)
enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
struct nv10_gr *gr;
......@@ -1182,7 +1182,7 @@ nv10_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device,
spin_lock_init(&gr->lock);
*pgr = &gr->base;
return nvkm_gr_ctor(func, device, index, true, &gr->base);
return nvkm_gr_ctor(func, device, type, inst, true, &gr->base);
}
static const struct nvkm_gr_func
......@@ -1215,7 +1215,7 @@ nv10_gr = {
};
int
nv10_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
nv10_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv10_gr_new_(&nv10_gr, device, index, pgr);
return nv10_gr_new_(&nv10_gr, device, type, inst, pgr);
}
......@@ -3,7 +3,7 @@
#define __NV10_GR_H__
#include "priv.h"
int nv10_gr_new_(const struct nvkm_gr_func *, struct nvkm_device *, int index,
int nv10_gr_new_(const struct nvkm_gr_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
struct nvkm_gr **);
int nv10_gr_init(struct nvkm_gr *);
void nv10_gr_intr(struct nvkm_gr *);
......
......@@ -53,7 +53,7 @@ nv15_gr = {
};
int
nv15_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
nv15_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv10_gr_new_(&nv15_gr, device, index, pgr);
return nv10_gr_new_(&nv15_gr, device, type, inst, pgr);
}
......@@ -53,7 +53,7 @@ nv17_gr = {
};
int
nv17_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
nv17_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv10_gr_new_(&nv17_gr, device, index, pgr);
return nv10_gr_new_(&nv17_gr, device, type, inst, pgr);
}
......@@ -330,7 +330,7 @@ nv20_gr_dtor(struct nvkm_gr *base)
int
nv20_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device,
int index, struct nvkm_gr **pgr)
enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
struct nv20_gr *gr;
......@@ -338,7 +338,7 @@ nv20_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device,
return -ENOMEM;
*pgr = &gr->base;
return nvkm_gr_ctor(func, device, index, true, &gr->base);
return nvkm_gr_ctor(func, device, type, inst, true, &gr->base);
}
static const struct nvkm_gr_func
......@@ -370,7 +370,7 @@ nv20_gr = {
};
int
nv20_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
nv20_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv20_gr_new_(&nv20_gr, device, index, pgr);
return nv20_gr_new_(&nv20_gr, device, type, inst, pgr);
}
......@@ -9,8 +9,8 @@ struct nv20_gr {
struct nvkm_memory *ctxtab;
};
int nv20_gr_new_(const struct nvkm_gr_func *, struct nvkm_device *,
int, struct nvkm_gr **);
int nv20_gr_new_(const struct nvkm_gr_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
struct nvkm_gr **);
void *nv20_gr_dtor(struct nvkm_gr *);
int nv20_gr_oneinit(struct nvkm_gr *);
int nv20_gr_init(struct nvkm_gr *);
......
......@@ -129,7 +129,7 @@ nv25_gr = {
};
int
nv25_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
nv25_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv20_gr_new_(&nv25_gr, device, index, pgr);
return nv20_gr_new_(&nv25_gr, device, type, inst, pgr);
}
......@@ -120,7 +120,7 @@ nv2a_gr = {
};
int
nv2a_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
nv2a_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv20_gr_new_(&nv2a_gr, device, index, pgr);
return nv20_gr_new_(&nv2a_gr, device, type, inst, pgr);
}
......@@ -194,7 +194,7 @@ nv30_gr = {
};
int
nv30_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
nv30_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv20_gr_new_(&nv30_gr, device, index, pgr);
return nv20_gr_new_(&nv30_gr, device, type, inst, pgr);
}
......@@ -131,7 +131,7 @@ nv34_gr = {
};
int
nv34_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
nv34_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv20_gr_new_(&nv34_gr, device, index, pgr);
return nv20_gr_new_(&nv34_gr, device, type, inst, pgr);
}
......@@ -131,7 +131,7 @@ nv35_gr = {
};
int
nv35_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
nv35_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv20_gr_new_(&nv35_gr, device, index, pgr);
return nv20_gr_new_(&nv35_gr, device, type, inst, pgr);
}
......@@ -429,7 +429,7 @@ nv40_gr_init(struct nvkm_gr *base)
int
nv40_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device,
int index, struct nvkm_gr **pgr)
enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
struct nv40_gr *gr;
......@@ -438,7 +438,7 @@ nv40_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device,
*pgr = &gr->base;
INIT_LIST_HEAD(&gr->chan);
return nvkm_gr_ctor(func, device, index, true, &gr->base);
return nvkm_gr_ctor(func, device, type, inst, true, &gr->base);
}
static const struct nvkm_gr_func
......@@ -470,7 +470,7 @@ nv40_gr = {
};
int
nv40_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
nv40_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv40_gr_new_(&nv40_gr, device, index, pgr);
return nv40_gr_new_(&nv40_gr, device, type, inst, pgr);
}
......@@ -10,7 +10,7 @@ struct nv40_gr {
struct list_head chan;
};
int nv40_gr_new_(const struct nvkm_gr_func *, struct nvkm_device *, int index,
int nv40_gr_new_(const struct nvkm_gr_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
struct nvkm_gr **);
int nv40_gr_init(struct nvkm_gr *);
void nv40_gr_intr(struct nvkm_gr *);
......
......@@ -102,7 +102,7 @@ nv44_gr = {
};
int
nv44_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
nv44_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv40_gr_new_(&nv44_gr, device, index, pgr);
return nv40_gr_new_(&nv44_gr, device, type, inst, pgr);
}
......@@ -761,7 +761,7 @@ nv50_gr_init(struct nvkm_gr *base)
int
nv50_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device,
int index, struct nvkm_gr **pgr)
enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
struct nv50_gr *gr;
......@@ -770,7 +770,7 @@ nv50_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device,
spin_lock_init(&gr->lock);
*pgr = &gr->base;
return nvkm_gr_ctor(func, device, index, true, &gr->base);
return nvkm_gr_ctor(func, device, type, inst, true, &gr->base);
}
static const struct nvkm_gr_func
......@@ -790,7 +790,7 @@ nv50_gr = {
};
int
nv50_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
nv50_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return nv50_gr_new_(&nv50_gr, device, index, pgr);
return nv50_gr_new_(&nv50_gr, device, type, inst, pgr);
}
......@@ -11,7 +11,7 @@ struct nv50_gr {
u32 size;
};
int nv50_gr_new_(const struct nvkm_gr_func *, struct nvkm_device *, int index,
int nv50_gr_new_(const struct nvkm_gr_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
struct nvkm_gr **);
int nv50_gr_init(struct nvkm_gr *);
void nv50_gr_intr(struct nvkm_gr *);
......
......@@ -7,8 +7,8 @@
struct nvkm_fb_tile;
struct nvkm_fifo_chan;
int nvkm_gr_ctor(const struct nvkm_gr_func *, struct nvkm_device *,
int index, bool enable, struct nvkm_gr *);
int nvkm_gr_ctor(const struct nvkm_gr_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
bool enable, struct nvkm_gr *);
bool nv04_gr_idle(struct nvkm_gr *);
......
......@@ -198,7 +198,7 @@ tu102_gr_fwif[] = {
};
int
tu102_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
tu102_gr_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gr **pgr)
{
return gf100_gr_new_(tu102_gr_fwif, device, index, pgr);
return gf100_gr_new_(tu102_gr_fwif, device, type, inst, pgr);
}
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