|
@@ -59,9 +59,44 @@ nv50_disp_dtor_(struct nvkm_disp *base)
|
|
return disp;
|
|
return disp;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int
|
|
|
|
+nv50_disp_oneinit_(struct nvkm_disp *base)
|
|
|
|
+{
|
|
|
|
+ struct nv50_disp *disp = nv50_disp(base);
|
|
|
|
+ const struct nv50_disp_func *func = disp->func;
|
|
|
|
+ int ret, i;
|
|
|
|
+
|
|
|
|
+ for (i = 0; func->head.new && i < disp->head.nr; i++) {
|
|
|
|
+ ret = func->head.new(&disp->base, i);
|
|
|
|
+ if (ret)
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (i = 0; func->dac.new && i < func->dac.nr; i++) {
|
|
|
|
+ ret = func->dac.new(&disp->base, i);
|
|
|
|
+ if (ret)
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (i = 0; func->pior.new && i < func->pior.nr; i++) {
|
|
|
|
+ ret = func->pior.new(&disp->base, i);
|
|
|
|
+ if (ret)
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (i = 0; func->sor.new && i < func->sor.nr; i++) {
|
|
|
|
+ ret = func->sor.new(&disp->base, i);
|
|
|
|
+ if (ret)
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
static const struct nvkm_disp_func
|
|
static const struct nvkm_disp_func
|
|
nv50_disp_ = {
|
|
nv50_disp_ = {
|
|
.dtor = nv50_disp_dtor_,
|
|
.dtor = nv50_disp_dtor_,
|
|
|
|
+ .oneinit = nv50_disp_oneinit_,
|
|
.intr = nv50_disp_intr_,
|
|
.intr = nv50_disp_intr_,
|
|
.root = nv50_disp_root_,
|
|
.root = nv50_disp_root_,
|
|
};
|
|
};
|
|
@@ -71,7 +106,7 @@ nv50_disp_new_(const struct nv50_disp_func *func, struct nvkm_device *device,
|
|
int index, int heads, struct nvkm_disp **pdisp)
|
|
int index, int heads, struct nvkm_disp **pdisp)
|
|
{
|
|
{
|
|
struct nv50_disp *disp;
|
|
struct nv50_disp *disp;
|
|
- int ret, i;
|
|
|
|
|
|
+ int ret;
|
|
|
|
|
|
if (!(disp = kzalloc(sizeof(*disp), GFP_KERNEL)))
|
|
if (!(disp = kzalloc(sizeof(*disp), GFP_KERNEL)))
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
@@ -85,33 +120,12 @@ nv50_disp_new_(const struct nv50_disp_func *func, struct nvkm_device *device,
|
|
disp->wq = create_singlethread_workqueue("nvkm-disp");
|
|
disp->wq = create_singlethread_workqueue("nvkm-disp");
|
|
if (!disp->wq)
|
|
if (!disp->wq)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
- INIT_WORK(&disp->supervisor, func->super);
|
|
|
|
-
|
|
|
|
- for (i = 0; func->head.new && i < heads; i++) {
|
|
|
|
- ret = func->head.new(&disp->base, i);
|
|
|
|
- if (ret)
|
|
|
|
- return ret;
|
|
|
|
- }
|
|
|
|
|
|
|
|
- for (i = 0; func->dac.new && i < func->dac.nr; i++) {
|
|
|
|
- ret = func->dac.new(&disp->base, i);
|
|
|
|
- if (ret)
|
|
|
|
- return ret;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- for (i = 0; func->pior.new && i < func->pior.nr; i++) {
|
|
|
|
- ret = func->pior.new(&disp->base, i);
|
|
|
|
- if (ret)
|
|
|
|
- return ret;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- for (i = 0; func->sor.new && i < func->sor.nr; i++) {
|
|
|
|
- ret = func->sor.new(&disp->base, i);
|
|
|
|
- if (ret)
|
|
|
|
- return ret;
|
|
|
|
- }
|
|
|
|
|
|
+ INIT_WORK(&disp->supervisor, func->super);
|
|
|
|
+ disp->head.nr = heads;
|
|
|
|
|
|
- return nvkm_event_init(func->uevent, 1, 1 + (heads * 4), &disp->uevent);
|
|
|
|
|
|
+ return nvkm_event_init(func->uevent, 1, ARRAY_SIZE(disp->chan),
|
|
|
|
+ &disp->uevent);
|
|
}
|
|
}
|
|
|
|
|
|
static u32
|
|
static u32
|