{
struct nvkm_disp *disp = nvkm_disp(oclass->engine);
if (index == 0) {
- const struct nvkm_disp_oclass *root = disp->func->root(disp);
- oclass->base = root->base;
- oclass->engn = root;
+ oclass->base = disp->func->root->base;
+ oclass->engn = disp->func->root;
*class = &nvkm_disp_sclass;
return 0;
}
#include "ior.h"
#include "rootnv50.h"
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
g84_disp = {
- .init = nv50_disp_init,
- .fini = nv50_disp_fini,
- .intr = nv50_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = nv50_disp_init,
+ .fini_ = nv50_disp_fini,
+ .intr_ = nv50_disp_intr,
.uevent = &nv50_disp_chan_uevent,
.super = nv50_disp_super,
.root = &g84_disp_root_oclass,
#include "ior.h"
#include "rootnv50.h"
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
g94_disp = {
- .init = nv50_disp_init,
- .fini = nv50_disp_fini,
- .intr = nv50_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = nv50_disp_init,
+ .fini_ = nv50_disp_fini,
+ .intr_ = nv50_disp_intr,
.uevent = &nv50_disp_chan_uevent,
.super = nv50_disp_super,
.root = &g94_disp_root_oclass,
#include "channv50.h"
#include "rootnv50.h"
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
ga102_disp = {
- .init = tu102_disp_init,
- .fini = gv100_disp_fini,
- .intr = gv100_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = tu102_disp_init,
+ .fini_ = gv100_disp_fini,
+ .intr_ = gv100_disp_intr,
.uevent = &gv100_disp_chan_uevent,
.super = gv100_disp_super,
.root = &ga102_disp_root_oclass,
return 0;
}
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
gf119_disp = {
- .init = gf119_disp_init,
- .fini = gf119_disp_fini,
- .intr = gf119_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = gf119_disp_init,
+ .fini_ = gf119_disp_fini,
+ .intr_ = gf119_disp_intr,
.intr_error = gf119_disp_intr_error,
.uevent = &gf119_disp_chan_uevent,
.super = gf119_disp_super,
#include "ior.h"
#include "rootnv50.h"
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
gk104_disp = {
- .init = gf119_disp_init,
- .fini = gf119_disp_fini,
- .intr = gf119_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = gf119_disp_init,
+ .fini_ = gf119_disp_fini,
+ .intr_ = gf119_disp_intr,
.intr_error = gf119_disp_intr_error,
.uevent = &gf119_disp_chan_uevent,
.super = gf119_disp_super,
#include "ior.h"
#include "rootnv50.h"
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
gk110_disp = {
- .init = gf119_disp_init,
- .fini = gf119_disp_fini,
- .intr = gf119_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = gf119_disp_init,
+ .fini_ = gf119_disp_fini,
+ .intr_ = gf119_disp_intr,
.intr_error = gf119_disp_intr_error,
.uevent = &gf119_disp_chan_uevent,
.super = gf119_disp_super,
#include "ior.h"
#include "rootnv50.h"
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
gm107_disp = {
- .init = gf119_disp_init,
- .fini = gf119_disp_fini,
- .intr = gf119_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = gf119_disp_init,
+ .fini_ = gf119_disp_fini,
+ .intr_ = gf119_disp_intr,
.intr_error = gf119_disp_intr_error,
.uevent = &gf119_disp_chan_uevent,
.super = gf119_disp_super,
#include "ior.h"
#include "rootnv50.h"
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
gm200_disp = {
- .init = gf119_disp_init,
- .fini = gf119_disp_fini,
- .intr = gf119_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = gf119_disp_init,
+ .fini_ = gf119_disp_fini,
+ .intr_ = gf119_disp_intr,
.intr_error = gf119_disp_intr_error,
.uevent = &gf119_disp_chan_uevent,
.super = gf119_disp_super,
#include "ior.h"
#include "rootnv50.h"
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
gp100_disp = {
- .init = gf119_disp_init,
- .fini = gf119_disp_fini,
- .intr = gf119_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = gf119_disp_init,
+ .fini_ = gf119_disp_fini,
+ .intr_ = gf119_disp_intr,
.intr_error = gf119_disp_intr_error,
.uevent = &gf119_disp_chan_uevent,
.super = gf119_disp_super,
nvkm_wr32(device, 0x6111f0 + (chid * 12), 0x90000000);
}
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
gp102_disp = {
- .init = gf119_disp_init,
- .fini = gf119_disp_fini,
- .intr = gf119_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = gf119_disp_init,
+ .fini_ = gf119_disp_fini,
+ .intr_ = gf119_disp_intr,
.intr_error = gp102_disp_intr_error,
.uevent = &gf119_disp_chan_uevent,
.super = gf119_disp_super,
#include "ior.h"
#include "rootnv50.h"
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
gt200_disp = {
- .init = nv50_disp_init,
- .fini = nv50_disp_fini,
- .intr = nv50_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = nv50_disp_init,
+ .fini_ = nv50_disp_fini,
+ .intr_ = nv50_disp_intr,
.uevent = &nv50_disp_chan_uevent,
.super = nv50_disp_super,
.root = >200_disp_root_oclass,
#include "ior.h"
#include "rootnv50.h"
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
gt215_disp = {
- .init = nv50_disp_init,
- .fini = nv50_disp_fini,
- .intr = nv50_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = nv50_disp_init,
+ .fini_ = nv50_disp_fini,
+ .intr_ = nv50_disp_intr,
.uevent = &nv50_disp_chan_uevent,
.super = nv50_disp_super,
.root = >215_disp_root_oclass,
return 0;
}
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
gv100_disp = {
- .init = gv100_disp_init,
- .fini = gv100_disp_fini,
- .intr = gv100_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = gv100_disp_init,
+ .fini_ = gv100_disp_fini,
+ .intr_ = gv100_disp_intr,
.uevent = &gv100_disp_chan_uevent,
.super = gv100_disp_super,
.root = &gv100_disp_root_oclass,
#include "ior.h"
#include "rootnv50.h"
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
mcp77_disp = {
- .init = nv50_disp_init,
- .fini = nv50_disp_fini,
- .intr = nv50_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = nv50_disp_init,
+ .fini_ = nv50_disp_fini,
+ .intr_ = nv50_disp_intr,
.uevent = &nv50_disp_chan_uevent,
.super = nv50_disp_super,
.root = &g94_disp_root_oclass,
#include "ior.h"
#include "rootnv50.h"
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
mcp89_disp = {
- .init = nv50_disp_init,
- .fini = nv50_disp_fini,
- .intr = nv50_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = nv50_disp_init,
+ .fini_ = nv50_disp_fini,
+ .intr_ = nv50_disp_intr,
.uevent = &nv50_disp_chan_uevent,
.super = nv50_disp_super,
.root = >215_disp_root_oclass,
#include "priv.h"
#include "head.h"
-static const struct nvkm_disp_oclass *
-nv04_disp_root(struct nvkm_disp *disp)
-{
- return &nv04_disp_root_oclass;
-}
-
static void
nv04_disp_intr(struct nvkm_disp *disp)
{
static const struct nvkm_disp_func
nv04_disp = {
.intr = nv04_disp_intr,
- .root = nv04_disp_root,
+ .root = &nv04_disp_root_oclass,
};
int
#include <subdev/devinit.h>
#include <subdev/timer.h>
-static const struct nvkm_disp_oclass *
-nv50_disp_root_(struct nvkm_disp *base)
-{
- return nv50_disp(base)->func->root;
-}
-
-static void
+void
nv50_disp_intr_(struct nvkm_disp *base)
{
struct nv50_disp *disp = nv50_disp(base);
- disp->func->intr(disp);
+ disp->func->intr_(disp);
}
-static void
+void
nv50_disp_fini_(struct nvkm_disp *base)
{
struct nv50_disp *disp = nv50_disp(base);
- disp->func->fini(disp);
+ disp->func->fini_(disp);
}
-static int
+int
nv50_disp_init_(struct nvkm_disp *base)
{
struct nv50_disp *disp = nv50_disp(base);
- return disp->func->init(disp);
+ return disp->func->init_(disp);
}
-static void *
+void *
nv50_disp_dtor_(struct nvkm_disp *base)
{
struct nv50_disp *disp = nv50_disp(base);
return disp;
}
-static int
+int
nv50_disp_oneinit_(struct nvkm_disp *base)
{
struct nv50_disp *disp = nv50_disp(base);
- const struct nv50_disp_func *func = disp->func;
+ const struct nvkm_disp_func *func = disp->func;
struct nvkm_subdev *subdev = &disp->base.engine.subdev;
struct nvkm_device *device = subdev->device;
int ret, i;
0x1000, 0, disp->inst, &disp->ramht);
}
-static const struct nvkm_disp_func
-nv50_disp_ = {
- .dtor = nv50_disp_dtor_,
- .oneinit = nv50_disp_oneinit_,
- .init = nv50_disp_init_,
- .fini = nv50_disp_fini_,
- .intr = nv50_disp_intr_,
- .root = nv50_disp_root_,
-};
-
int
-nv50_disp_new_(const struct nv50_disp_func *func, struct nvkm_device *device,
+nv50_disp_new_(const struct nvkm_disp_func *func, struct nvkm_device *device,
enum nvkm_subdev_type type, int inst, struct nvkm_disp **pdisp)
{
struct nv50_disp *disp;
disp->func = func;
*pdisp = &disp->base;
- ret = nvkm_disp_ctor(&nv50_disp_, device, type, inst, &disp->base);
+ ret = nvkm_disp_ctor(func, device, type, inst, &disp->base);
if (ret)
return ret;
return 0;
}
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
nv50_disp = {
- .init = nv50_disp_init,
- .fini = nv50_disp_fini,
- .intr = nv50_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = nv50_disp_init,
+ .fini_ = nv50_disp_fini,
+ .intr_ = nv50_disp_intr,
.uevent = &nv50_disp_chan_uevent,
.super = nv50_disp_super,
.root = &nv50_disp_root_oclass,
#include <core/enum.h>
struct nv50_disp {
- const struct nv50_disp_func *func;
+ const struct nvkm_disp_func *func;
struct nvkm_disp base;
struct workqueue_struct *wq;
void nv50_disp_super_2_2(struct nv50_disp *, struct nvkm_head *);
void nv50_disp_super_3_0(struct nv50_disp *, struct nvkm_head *);
-int nv50_disp_new_(const struct nv50_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
+int nv50_disp_new_(const struct nvkm_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
struct nvkm_disp **);
-struct nv50_disp_func {
- int (*init)(struct nv50_disp *);
- void (*fini)(struct nv50_disp *);
- void (*intr)(struct nv50_disp *);
- void (*intr_error)(struct nv50_disp *, int chid);
-
- const struct nvkm_event_func *uevent;
- void (*super)(struct work_struct *);
-
- const struct nvkm_disp_oclass *root;
-
- struct {
- int (*cnt)(struct nvkm_disp *, unsigned long *mask);
- int (*new)(struct nvkm_disp *, int id);
- } wndw, head, dac, sor, pior;
-
- u16 ramht_size;
-};
-
int nv50_disp_init(struct nv50_disp *);
void nv50_disp_fini(struct nv50_disp *);
void nv50_disp_intr(struct nv50_disp *);
#define __NVKM_DISP_PRIV_H__
#include <engine/disp.h>
#include "outp.h"
+struct nv50_disp;
int nvkm_disp_ctor(const struct nvkm_disp_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
struct nvkm_disp *);
void (*fini)(struct nvkm_disp *);
void (*intr)(struct nvkm_disp *);
- const struct nvkm_disp_oclass *(*root)(struct nvkm_disp *);
+ const struct nvkm_disp_oclass *root;
+
+ int (*init_)(struct nv50_disp *);
+ void (*fini_)(struct nv50_disp *);
+ void (*intr_)(struct nv50_disp *);
+ void (*intr_error)(struct nv50_disp *, int chid);
+
+ const struct nvkm_event_func *uevent;
+ void (*super)(struct work_struct *);
+
+ struct {
+ int (*cnt)(struct nvkm_disp *, unsigned long *mask);
+ int (*new)(struct nvkm_disp *, int id);
+ } wndw, head, dac, sor, pior;
+
+ u16 ramht_size;
};
int nvkm_disp_ntfy(struct nvkm_object *, u32, struct nvkm_event **);
extern const struct nvkm_disp_oclass nv04_disp_root_oclass;
+void *nv50_disp_dtor_(struct nvkm_disp *);
+int nv50_disp_oneinit_(struct nvkm_disp *);
+int nv50_disp_init_(struct nvkm_disp *);
+void nv50_disp_fini_(struct nvkm_disp *);
+void nv50_disp_intr_(struct nvkm_disp *);
+
struct nvkm_disp_oclass {
int (*ctor)(struct nvkm_disp *, const struct nvkm_oclass *,
void *data, u32 size, struct nvkm_object **);
return 0;
}
-static const struct nv50_disp_func
+static const struct nvkm_disp_func
tu102_disp = {
- .init = tu102_disp_init,
- .fini = gv100_disp_fini,
- .intr = gv100_disp_intr,
+ .dtor = nv50_disp_dtor_,
+ .oneinit = nv50_disp_oneinit_,
+ .init = nv50_disp_init_,
+ .fini = nv50_disp_fini_,
+ .intr = nv50_disp_intr_,
+ .init_ = tu102_disp_init,
+ .fini_ = gv100_disp_fini,
+ .intr_ = gv100_disp_intr,
.uevent = &gv100_disp_chan_uevent,
.super = gv100_disp_super,
.root = &tu102_disp_root_oclass,