Commit b7a9369a authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/fb: switch to instanced constructor

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 77689f1b
...@@ -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_fb *fb;
struct nvkm_fuse *fuse; struct nvkm_fuse *fuse;
struct nvkm_gpio *gpio; struct nvkm_gpio *gpio;
struct nvkm_gsp *gsp; struct nvkm_gsp *gsp;
...@@ -141,7 +140,6 @@ struct nvkm_device_chip { ...@@ -141,7 +140,6 @@ struct nvkm_device_chip {
#include <core/layout.h> #include <core/layout.h>
#undef NVKM_LAYOUT_INST #undef NVKM_LAYOUT_INST
#undef NVKM_LAYOUT_ONCE #undef NVKM_LAYOUT_ONCE
int (*fb )(struct nvkm_device *, int idx, struct nvkm_fb **);
int (*fuse )(struct nvkm_device *, int idx, struct nvkm_fuse **); int (*fuse )(struct nvkm_device *, int idx, struct nvkm_fuse **);
int (*gpio )(struct nvkm_device *, int idx, struct nvkm_gpio **); int (*gpio )(struct nvkm_device *, int idx, struct nvkm_gpio **);
int (*gsp )(struct nvkm_device *, int idx, struct nvkm_gsp **); int (*gsp )(struct nvkm_device *, int idx, struct nvkm_gsp **);
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
NVKM_LAYOUT_ONCE(NVKM_SUBDEV_VBIOS , struct nvkm_bios , bios) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_VBIOS , struct nvkm_bios , bios)
NVKM_LAYOUT_ONCE(NVKM_SUBDEV_DEVINIT , struct nvkm_devinit , devinit) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_DEVINIT , struct nvkm_devinit , devinit)
NVKM_LAYOUT_ONCE(NVKM_SUBDEV_BUS , struct nvkm_bus , bus) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_BUS , struct nvkm_bus , bus)
NVKM_LAYOUT_ONCE(NVKM_SUBDEV_FB , struct nvkm_fb , fb)
NVKM_LAYOUT_ONCE(NVKM_SUBDEV_BAR , struct nvkm_bar , bar) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_BAR , struct nvkm_bar , bar)
NVKM_LAYOUT_ONCE(NVKM_SUBDEV_FAULT , struct nvkm_fault , fault) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_FAULT , struct nvkm_fault , fault)
NVKM_LAYOUT_ONCE(NVKM_SUBDEV_ACR , struct nvkm_acr , acr) NVKM_LAYOUT_ONCE(NVKM_SUBDEV_ACR , struct nvkm_acr , acr)
......
...@@ -58,40 +58,40 @@ void nvkm_fb_tile_init(struct nvkm_fb *, int region, u32 addr, u32 size, ...@@ -58,40 +58,40 @@ void nvkm_fb_tile_init(struct nvkm_fb *, int region, u32 addr, u32 size,
void nvkm_fb_tile_fini(struct nvkm_fb *, int region, struct nvkm_fb_tile *); void nvkm_fb_tile_fini(struct nvkm_fb *, int region, struct nvkm_fb_tile *);
void nvkm_fb_tile_prog(struct nvkm_fb *, int region, struct nvkm_fb_tile *); void nvkm_fb_tile_prog(struct nvkm_fb *, int region, struct nvkm_fb_tile *);
int nv04_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv04_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int nv10_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv10_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int nv1a_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv1a_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int nv20_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv20_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int nv25_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv25_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int nv30_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv30_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int nv35_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv35_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int nv36_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv36_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int nv40_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv40_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int nv41_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv41_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int nv44_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv44_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int nv46_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv46_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int nv47_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv47_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int nv49_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv49_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int nv4e_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv4e_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int nv50_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int nv50_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int g84_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int g84_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int gt215_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gt215_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int mcp77_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int mcp77_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int mcp89_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int mcp89_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int gf100_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gf100_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int gf108_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gf108_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int gk104_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gk104_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int gk110_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gk110_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int gk20a_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gk20a_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int gm107_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gm107_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int gm200_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gm200_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int gm20b_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gm20b_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int gp100_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gp100_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int gp102_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gp102_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int gp10b_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gp10b_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int gv100_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int gv100_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int ga100_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int ga100_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
int ga102_fb_new(struct nvkm_device *, int, struct nvkm_fb **); int ga102_fb_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/ramcfg.h> #include <subdev/bios/ramcfg.h>
......
...@@ -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_SUBDEV_FB ] = "fb",
[NVKM_SUBDEV_FUSE ] = "fuse", [NVKM_SUBDEV_FUSE ] = "fuse",
[NVKM_SUBDEV_GPIO ] = "gpio", [NVKM_SUBDEV_GPIO ] = "gpio",
[NVKM_SUBDEV_GSP ] = "gsp", [NVKM_SUBDEV_GSP ] = "gsp",
......
...@@ -227,9 +227,9 @@ nvkm_fb = { ...@@ -227,9 +227,9 @@ nvkm_fb = {
void void
nvkm_fb_ctor(const struct nvkm_fb_func *func, struct nvkm_device *device, nvkm_fb_ctor(const struct nvkm_fb_func *func, struct nvkm_device *device,
int index, struct nvkm_fb *fb) enum nvkm_subdev_type type, int inst, struct nvkm_fb *fb)
{ {
nvkm_subdev_ctor(&nvkm_fb, device, index, &fb->subdev); nvkm_subdev_ctor(&nvkm_fb, device, type, inst, &fb->subdev);
fb->func = func; fb->func = func;
fb->tile.regions = fb->func->tile.regions; fb->tile.regions = fb->func->tile.regions;
fb->page = nvkm_longopt(device->cfgopt, "NvFbBigPage", fb->func->default_bigpage); fb->page = nvkm_longopt(device->cfgopt, "NvFbBigPage", fb->func->default_bigpage);
...@@ -238,10 +238,10 @@ nvkm_fb_ctor(const struct nvkm_fb_func *func, struct nvkm_device *device, ...@@ -238,10 +238,10 @@ nvkm_fb_ctor(const struct nvkm_fb_func *func, struct nvkm_device *device,
int int
nvkm_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device, nvkm_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device,
int index, struct nvkm_fb **pfb) enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
if (!(*pfb = kzalloc(sizeof(**pfb), GFP_KERNEL))) if (!(*pfb = kzalloc(sizeof(**pfb), GFP_KERNEL)))
return -ENOMEM; return -ENOMEM;
nvkm_fb_ctor(func, device, index, *pfb); nvkm_fb_ctor(func, device, type, inst, *pfb);
return 0; return 0;
} }
...@@ -32,7 +32,7 @@ g84_fb = { ...@@ -32,7 +32,7 @@ g84_fb = {
}; };
int int
g84_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) g84_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nv50_fb_new_(&g84_fb, device, index, pfb); return nv50_fb_new_(&g84_fb, device, type, inst, pfb);
} }
...@@ -34,7 +34,7 @@ ga100_fb = { ...@@ -34,7 +34,7 @@ ga100_fb = {
}; };
int int
ga100_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) ga100_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return gp102_fb_new_(&ga100_fb, device, index, pfb); return gp102_fb_new_(&ga100_fb, device, type, inst, pfb);
} }
...@@ -34,7 +34,7 @@ ga102_fb = { ...@@ -34,7 +34,7 @@ ga102_fb = {
}; };
int int
ga102_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) ga102_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return gp102_fb_new_(&ga102_fb, device, index, pfb); return gp102_fb_new_(&ga102_fb, device, type, inst, pfb);
} }
...@@ -117,13 +117,13 @@ gf100_fb_dtor(struct nvkm_fb *base) ...@@ -117,13 +117,13 @@ gf100_fb_dtor(struct nvkm_fb *base)
int int
gf100_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device, gf100_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device,
int index, struct nvkm_fb **pfb) enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
struct gf100_fb *fb; struct gf100_fb *fb;
if (!(fb = kzalloc(sizeof(*fb), GFP_KERNEL))) if (!(fb = kzalloc(sizeof(*fb), GFP_KERNEL)))
return -ENOMEM; return -ENOMEM;
nvkm_fb_ctor(func, device, index, &fb->base); nvkm_fb_ctor(func, device, type, inst, &fb->base);
*pfb = &fb->base; *pfb = &fb->base;
return 0; return 0;
...@@ -141,7 +141,7 @@ gf100_fb = { ...@@ -141,7 +141,7 @@ gf100_fb = {
}; };
int int
gf100_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) gf100_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return gf100_fb_new_(&gf100_fb, device, index, pfb); return gf100_fb_new_(&gf100_fb, device, type, inst, pfb);
} }
...@@ -10,8 +10,8 @@ struct gf100_fb { ...@@ -10,8 +10,8 @@ struct gf100_fb {
dma_addr_t r100c10; dma_addr_t r100c10;
}; };
int gf100_fb_new_(const struct nvkm_fb_func *, struct nvkm_device *, int gf100_fb_new_(const struct nvkm_fb_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
int index, struct nvkm_fb **); struct nvkm_fb **);
void *gf100_fb_dtor(struct nvkm_fb *); void *gf100_fb_dtor(struct nvkm_fb *);
void gf100_fb_init(struct nvkm_fb *); void gf100_fb_init(struct nvkm_fb *);
void gf100_fb_intr(struct nvkm_fb *); void gf100_fb_intr(struct nvkm_fb *);
......
...@@ -36,7 +36,7 @@ gf108_fb = { ...@@ -36,7 +36,7 @@ gf108_fb = {
}; };
int int
gf108_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) gf108_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return gf100_fb_new_(&gf108_fb, device, index, pfb); return gf100_fb_new_(&gf108_fb, device, type, inst, pfb);
} }
...@@ -83,7 +83,7 @@ gk104_fb = { ...@@ -83,7 +83,7 @@ gk104_fb = {
}; };
int int
gk104_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) gk104_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return gf100_fb_new_(&gk104_fb, device, index, pfb); return gf100_fb_new_(&gk104_fb, device, type, inst, pfb);
} }
...@@ -65,7 +65,7 @@ gk110_fb = { ...@@ -65,7 +65,7 @@ gk110_fb = {
}; };
int int
gk110_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) gk110_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return gf100_fb_new_(&gk110_fb, device, index, pfb); return gf100_fb_new_(&gk110_fb, device, type, inst, pfb);
} }
...@@ -34,7 +34,7 @@ gk20a_fb = { ...@@ -34,7 +34,7 @@ gk20a_fb = {
}; };
int int
gk20a_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) gk20a_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return gf100_fb_new_(&gk20a_fb, device, index, pfb); return gf100_fb_new_(&gk20a_fb, device, type, inst, pfb);
} }
...@@ -36,7 +36,7 @@ gm107_fb = { ...@@ -36,7 +36,7 @@ gm107_fb = {
}; };
int int
gm107_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) gm107_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return gf100_fb_new_(&gm107_fb, device, index, pfb); return gf100_fb_new_(&gm107_fb, device, type, inst, pfb);
} }
...@@ -67,7 +67,7 @@ gm200_fb = { ...@@ -67,7 +67,7 @@ gm200_fb = {
}; };
int int
gm200_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) gm200_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return gf100_fb_new_(&gm200_fb, device, index, pfb); return gf100_fb_new_(&gm200_fb, device, type, inst, pfb);
} }
...@@ -34,7 +34,7 @@ gm20b_fb = { ...@@ -34,7 +34,7 @@ gm20b_fb = {
}; };
int int
gm20b_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) gm20b_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return gf100_fb_new_(&gm20b_fb, device, index, pfb); return gf100_fb_new_(&gm20b_fb, device, type, inst, pfb);
} }
...@@ -71,7 +71,7 @@ gp100_fb = { ...@@ -71,7 +71,7 @@ gp100_fb = {
}; };
int int
gp100_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) gp100_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return gf100_fb_new_(&gp100_fb, device, index, pfb); return gf100_fb_new_(&gp100_fb, device, type, inst, pfb);
} }
...@@ -114,9 +114,9 @@ gp102_fb = { ...@@ -114,9 +114,9 @@ gp102_fb = {
int int
gp102_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device, gp102_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device,
int index, struct nvkm_fb **pfb) enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
int ret = gf100_fb_new_(func, device, index, pfb); int ret = gf100_fb_new_(func, device, type, inst, pfb);
if (ret) if (ret)
return ret; return ret;
...@@ -126,9 +126,9 @@ gp102_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device, ...@@ -126,9 +126,9 @@ gp102_fb_new_(const struct nvkm_fb_func *func, struct nvkm_device *device,
} }
int int
gp102_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) gp102_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return gp102_fb_new_(&gp102_fb, device, index, pfb); return gp102_fb_new_(&gp102_fb, device, type, inst, pfb);
} }
MODULE_FIRMWARE("nvidia/gp102/nvdec/scrubber.bin"); MODULE_FIRMWARE("nvidia/gp102/nvdec/scrubber.bin");
......
...@@ -31,7 +31,7 @@ gp10b_fb = { ...@@ -31,7 +31,7 @@ gp10b_fb = {
}; };
int int
gp10b_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) gp10b_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return gf100_fb_new_(&gp10b_fb, device, index, pfb); return gf100_fb_new_(&gp10b_fb, device, type, inst, pfb);
} }
...@@ -32,7 +32,7 @@ gt215_fb = { ...@@ -32,7 +32,7 @@ gt215_fb = {
}; };
int int
gt215_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) gt215_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nv50_fb_new_(&gt215_fb, device, index, pfb); return nv50_fb_new_(&gt215_fb, device, type, inst, pfb);
} }
...@@ -42,9 +42,9 @@ gv100_fb = { ...@@ -42,9 +42,9 @@ gv100_fb = {
}; };
int int
gv100_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) gv100_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return gp102_fb_new_(&gv100_fb, device, index, pfb); return gp102_fb_new_(&gv100_fb, device, type, inst, pfb);
} }
MODULE_FIRMWARE("nvidia/gv100/nvdec/scrubber.bin"); MODULE_FIRMWARE("nvidia/gv100/nvdec/scrubber.bin");
......
...@@ -31,7 +31,7 @@ mcp77_fb = { ...@@ -31,7 +31,7 @@ mcp77_fb = {
}; };
int int
mcp77_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) mcp77_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nv50_fb_new_(&mcp77_fb, device, index, pfb); return nv50_fb_new_(&mcp77_fb, device, type, inst, pfb);
} }
...@@ -31,7 +31,7 @@ mcp89_fb = { ...@@ -31,7 +31,7 @@ mcp89_fb = {
}; };
int int
mcp89_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) mcp89_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nv50_fb_new_(&mcp89_fb, device, index, pfb); return nv50_fb_new_(&mcp89_fb, device, type, inst, pfb);
} }
...@@ -44,7 +44,7 @@ nv04_fb = { ...@@ -44,7 +44,7 @@ nv04_fb = {
}; };
int int
nv04_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv04_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nvkm_fb_new_(&nv04_fb, device, index, pfb); return nvkm_fb_new_(&nv04_fb, device, type, inst, pfb);
} }
...@@ -64,7 +64,7 @@ nv10_fb = { ...@@ -64,7 +64,7 @@ nv10_fb = {
}; };
int int
nv10_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv10_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nvkm_fb_new_(&nv10_fb, device, index, pfb); return nvkm_fb_new_(&nv10_fb, device, type, inst, pfb);
} }
...@@ -36,7 +36,7 @@ nv1a_fb = { ...@@ -36,7 +36,7 @@ nv1a_fb = {
}; };
int int
nv1a_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv1a_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nvkm_fb_new_(&nv1a_fb, device, index, pfb); return nvkm_fb_new_(&nv1a_fb, device, type, inst, pfb);
} }
...@@ -96,7 +96,7 @@ nv20_fb = { ...@@ -96,7 +96,7 @@ nv20_fb = {
}; };
int int
nv20_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv20_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nvkm_fb_new_(&nv20_fb, device, index, pfb); return nvkm_fb_new_(&nv20_fb, device, type, inst, pfb);
} }
...@@ -54,7 +54,7 @@ nv25_fb = { ...@@ -54,7 +54,7 @@ nv25_fb = {
}; };
int int
nv25_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv25_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nvkm_fb_new_(&nv25_fb, device, index, pfb); return nvkm_fb_new_(&nv25_fb, device, type, inst, pfb);
} }
...@@ -127,7 +127,7 @@ nv30_fb = { ...@@ -127,7 +127,7 @@ nv30_fb = {
}; };
int int
nv30_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv30_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nvkm_fb_new_(&nv30_fb, device, index, pfb); return nvkm_fb_new_(&nv30_fb, device, type, inst, pfb);
} }
...@@ -56,7 +56,7 @@ nv35_fb = { ...@@ -56,7 +56,7 @@ nv35_fb = {
}; };
int int
nv35_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv35_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nvkm_fb_new_(&nv35_fb, device, index, pfb); return nvkm_fb_new_(&nv35_fb, device, type, inst, pfb);
} }
...@@ -56,7 +56,7 @@ nv36_fb = { ...@@ -56,7 +56,7 @@ nv36_fb = {
}; };
int int
nv36_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv36_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nvkm_fb_new_(&nv36_fb, device, index, pfb); return nvkm_fb_new_(&nv36_fb, device, type, inst, pfb);
} }
...@@ -62,7 +62,7 @@ nv40_fb = { ...@@ -62,7 +62,7 @@ nv40_fb = {
}; };
int int
nv40_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv40_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nvkm_fb_new_(&nv40_fb, device, index, pfb); return nvkm_fb_new_(&nv40_fb, device, type, inst, pfb);
} }
...@@ -56,7 +56,7 @@ nv41_fb = { ...@@ -56,7 +56,7 @@ nv41_fb = {
}; };
int int
nv41_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv41_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nvkm_fb_new_(&nv41_fb, device, index, pfb); return nvkm_fb_new_(&nv41_fb, device, type, inst, pfb);
} }
...@@ -65,7 +65,7 @@ nv44_fb = { ...@@ -65,7 +65,7 @@ nv44_fb = {
}; };
int int
nv44_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv44_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nvkm_fb_new_(&nv44_fb, device, index, pfb); return nvkm_fb_new_(&nv44_fb, device, type, inst, pfb);
} }
...@@ -51,7 +51,7 @@ nv46_fb = { ...@@ -51,7 +51,7 @@ nv46_fb = {
}; };
int int
nv46_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv46_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nvkm_fb_new_(&nv46_fb, device, index, pfb); return nvkm_fb_new_(&nv46_fb, device, type, inst, pfb);
} }
...@@ -39,7 +39,7 @@ nv47_fb = { ...@@ -39,7 +39,7 @@ nv47_fb = {
}; };
int int
nv47_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv47_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nvkm_fb_new_(&nv47_fb, device, index, pfb); return nvkm_fb_new_(&nv47_fb, device, type, inst, pfb);
} }
...@@ -39,7 +39,7 @@ nv49_fb = { ...@@ -39,7 +39,7 @@ nv49_fb = {
}; };
int int
nv49_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv49_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nvkm_fb_new_(&nv49_fb, device, index, pfb); return nvkm_fb_new_(&nv49_fb, device, type, inst, pfb);
} }
...@@ -37,7 +37,7 @@ nv4e_fb = { ...@@ -37,7 +37,7 @@ nv4e_fb = {
}; };
int int
nv4e_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv4e_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nvkm_fb_new_(&nv4e_fb, device, index, pfb); return nvkm_fb_new_(&nv4e_fb, device, type, inst, pfb);
} }
...@@ -262,16 +262,15 @@ nv50_fb_ = { ...@@ -262,16 +262,15 @@ nv50_fb_ = {
int int
nv50_fb_new_(const struct nv50_fb_func *func, struct nvkm_device *device, nv50_fb_new_(const struct nv50_fb_func *func, struct nvkm_device *device,
int index, struct nvkm_fb **pfb) enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
struct nv50_fb *fb; struct nv50_fb *fb;
if (!(fb = kzalloc(sizeof(*fb), GFP_KERNEL))) if (!(fb = kzalloc(sizeof(*fb), GFP_KERNEL)))
return -ENOMEM; return -ENOMEM;
nvkm_fb_ctor(&nv50_fb_, device, index, &fb->base); nvkm_fb_ctor(&nv50_fb_, device, type, inst, &fb->base);
fb->func = func; fb->func = func;
*pfb = &fb->base; *pfb = &fb->base;
return 0; return 0;
} }
...@@ -283,7 +282,7 @@ nv50_fb = { ...@@ -283,7 +282,7 @@ nv50_fb = {
}; };
int int
nv50_fb_new(struct nvkm_device *device, int index, struct nvkm_fb **pfb) nv50_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{ {
return nv50_fb_new_(&nv50_fb, device, index, pfb); return nv50_fb_new_(&nv50_fb, device, type, inst, pfb);
} }
...@@ -17,6 +17,6 @@ struct nv50_fb_func { ...@@ -17,6 +17,6 @@ struct nv50_fb_func {
u32 trap; u32 trap;
}; };
int nv50_fb_new_(const struct nv50_fb_func *, struct nvkm_device *, int index, int nv50_fb_new_(const struct nv50_fb_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
struct nvkm_fb **pfb); struct nvkm_fb **pfb);
#endif #endif
...@@ -38,9 +38,9 @@ struct nvkm_fb_func { ...@@ -38,9 +38,9 @@ struct nvkm_fb_func {
}; };
void nvkm_fb_ctor(const struct nvkm_fb_func *, struct nvkm_device *device, void nvkm_fb_ctor(const struct nvkm_fb_func *, struct nvkm_device *device,
int index, struct nvkm_fb *); enum nvkm_subdev_type type, int inst, struct nvkm_fb *);
int nvkm_fb_new_(const struct nvkm_fb_func *, struct nvkm_device *device, int nvkm_fb_new_(const struct nvkm_fb_func *, struct nvkm_device *device,
int index, struct nvkm_fb **); enum nvkm_subdev_type type, int inst, struct nvkm_fb **);
int nvkm_fb_bios_memtype(struct nvkm_bios *); int nvkm_fb_bios_memtype(struct nvkm_bios *);
void nv10_fb_tile_init(struct nvkm_fb *, int i, u32 addr, u32 size, void nv10_fb_tile_init(struct nvkm_fb *, int i, u32 addr, u32 size,
...@@ -78,7 +78,7 @@ int gm200_fb_init_page(struct nvkm_fb *); ...@@ -78,7 +78,7 @@ int gm200_fb_init_page(struct nvkm_fb *);
void gp100_fb_init_remapper(struct nvkm_fb *); void gp100_fb_init_remapper(struct nvkm_fb *);
void gp100_fb_init_unkn(struct nvkm_fb *); void gp100_fb_init_unkn(struct nvkm_fb *);
int gp102_fb_new_(const struct nvkm_fb_func *, struct nvkm_device *, int, int gp102_fb_new_(const struct nvkm_fb_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
struct nvkm_fb **); struct nvkm_fb **);
bool gp102_fb_vpr_scrub_required(struct nvkm_fb *); bool gp102_fb_vpr_scrub_required(struct nvkm_fb *);
int gp102_fb_vpr_scrub(struct nvkm_fb *); int gp102_fb_vpr_scrub(struct nvkm_fb *);
......
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