drm/nouveau/disp: add common class handling between <nv50 and >=nv50
authorBen Skeggs <bskeggs@redhat.com>
Wed, 1 Jun 2022 10:46:27 +0000 (20:46 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 26 Jul 2022 23:05:46 +0000 (09:05 +1000)
About to expose head/output path/connector objects everywhere, so we will
need support for child classes prior to nv50 now.

Somewhat cleaner than the code >=nv50 used previously.

v2:
- use ?: (lyude)

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
48 files changed:
drivers/gpu/drm/nouveau/include/nvif/class.h
drivers/gpu/drm/nouveau/include/nvif/if0010.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/include/nvif/printf.h
drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h
drivers/gpu/drm/nouveau/nvif/disp.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild
drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/capsgv100.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/g84.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/g94.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/ga102.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/gk104.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/gk110.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/gm107.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/gm200.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/gp100.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/gp102.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/gt200.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/gt215.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/gv100.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp77.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/mcp89.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/nv04.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/piocgf119.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/piocnv50.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootg84.c [deleted file]
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootg94.c [deleted file]
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootga102.c [deleted file]
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgf119.c [deleted file]
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgk104.c [deleted file]
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgk110.c [deleted file]
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgm107.c [deleted file]
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgm200.c [deleted file]
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgp100.c [deleted file]
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgp102.c [deleted file]
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgt200.c [deleted file]
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgt215.c [deleted file]
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgv100.c [deleted file]
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv04.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h [deleted file]
drivers/gpu/drm/nouveau/nvkm/engine/disp/roottu102.c [deleted file]
drivers/gpu/drm/nouveau/nvkm/engine/disp/tu102.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/udisp.c [new file with mode: 0644]

index a582c0cb0cb0d2c5919a0b6a2cbbaf685df1651e..2483a3787b00296cb58066995a351be0bfc69fdd 100644 (file)
@@ -32,6 +32,8 @@
 #define NVIF_CLASS_VMM_GM200                         /* ifb00d.h */  0x8000b00d
 #define NVIF_CLASS_VMM_GP100                         /* ifc00d.h */  0x8000c00d
 
+#define NVIF_CLASS_DISP                              /* if0010.h */  0x80000010
+
 /* the below match nvidia-assigned (either in hw, or sw) class numbers */
 #define NV_NULL_CLASS                                                0x00000030
 
 #define TURING_CHANNEL_GPFIFO_A                       /* clc36f.h */ 0x0000c46f
 #define AMPERE_CHANNEL_GPFIFO_B                       /* clc36f.h */ 0x0000c76f
 
-#define NV50_DISP                                     /* cl5070.h */ 0x00005070
-#define G82_DISP                                      /* cl5070.h */ 0x00008270
-#define GT200_DISP                                    /* cl5070.h */ 0x00008370
-#define GT214_DISP                                    /* cl5070.h */ 0x00008570
-#define GT206_DISP                                    /* cl5070.h */ 0x00008870
-#define GF110_DISP                                    /* cl5070.h */ 0x00009070
-#define GK104_DISP                                    /* cl5070.h */ 0x00009170
-#define GK110_DISP                                    /* cl5070.h */ 0x00009270
-#define GM107_DISP                                    /* cl5070.h */ 0x00009470
-#define GM200_DISP                                    /* cl5070.h */ 0x00009570
-#define GP100_DISP                                    /* cl5070.h */ 0x00009770
-#define GP102_DISP                                    /* cl5070.h */ 0x00009870
-#define GV100_DISP                                    /* cl5070.h */ 0x0000c370
-#define TU102_DISP                                    /* cl5070.h */ 0x0000c570
-#define GA102_DISP                                    /* cl5070.h */ 0x0000c670
+#define NV50_DISP                                     /* if0010.h */ 0x00005070
+#define G82_DISP                                      /* if0010.h */ 0x00008270
+#define GT200_DISP                                    /* if0010.h */ 0x00008370
+#define GT214_DISP                                    /* if0010.h */ 0x00008570
+#define GT206_DISP                                    /* if0010.h */ 0x00008870
+#define GF110_DISP                                    /* if0010.h */ 0x00009070
+#define GK104_DISP                                    /* if0010.h */ 0x00009170
+#define GK110_DISP                                    /* if0010.h */ 0x00009270
+#define GM107_DISP                                    /* if0010.h */ 0x00009470
+#define GM200_DISP                                    /* if0010.h */ 0x00009570
+#define GP100_DISP                                    /* if0010.h */ 0x00009770
+#define GP102_DISP                                    /* if0010.h */ 0x00009870
+#define GV100_DISP                                    /* if0010.h */ 0x0000c370
+#define TU102_DISP                                    /* if0010.h */ 0x0000c570
+#define GA102_DISP                                    /* if0010.h */ 0x0000c670
 
 #define GV100_DISP_CAPS                                              0x0000c373
 
diff --git a/drivers/gpu/drm/nouveau/include/nvif/if0010.h b/drivers/gpu/drm/nouveau/include/nvif/if0010.h
new file mode 100644 (file)
index 0000000..fc22191
--- /dev/null
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: MIT */
+#ifndef __NVIF_IF0010_H__
+#define __NVIF_IF0010_H__
+
+union nvif_disp_args {
+       struct nvif_disp_v0 {
+               __u8 version;
+               __u8 pad01[7];
+       } v0;
+};
+#endif
index 6c299ec6be21f77f2fbd38b4c3cd55f44ee2ea17..ec524b2faeae998d0542425c9e6ec1f593a460b4 100644 (file)
 #endif
 
 #define NVIF_ERROR(o,f,a...) NVIF_PRINT(errorf, (o), f, ##a)
+#define NVIF_ERRON(c,o,f,a...) do {                            \
+       struct nvif_object *_object = (o);                     \
+       int _cond = (c);                                       \
+       if (_cond) {                                           \
+               NVIF_ERROR(_object, f" (ret:%d)", ##a, _cond); \
+       } else {                                               \
+               NVIF_DEBUG(_object, f, ##a);                   \
+       }                                                      \
+} while(0)
 #endif
index b6b45730ab58ec028421416d82e3f9c55c975e0c..9125a98f125cb28c70b0d30e127156f494ecc99c 100644 (file)
@@ -3,6 +3,7 @@
 #define __NVKM_DISP_H__
 #define nvkm_disp(p) container_of((p), struct nvkm_disp, engine)
 #include <core/engine.h>
+#include <core/object.h>
 #include <core/event.h>
 
 struct nvkm_disp {
@@ -47,7 +48,7 @@ struct nvkm_disp {
 
        struct {
                spinlock_t lock;
-               struct nvkm_oproxy *object;
+               struct nvkm_object object;
        } client;
 };
 
index 529cb60d5efb020faf0e4a81b45b5cd133fa5a6f..3a6b7ffeb97a60077bc96ef2f7ec92cafa54d29e 100644 (file)
  */
 #include <nvif/disp.h>
 #include <nvif/device.h>
+#include <nvif/printf.h>
 
 #include <nvif/class.h>
+#include <nvif/if0010.h>
 
 void
 nvif_disp_dtor(struct nvif_disp *disp)
@@ -31,33 +33,41 @@ nvif_disp_dtor(struct nvif_disp *disp)
 }
 
 int
-nvif_disp_ctor(struct nvif_device *device, const char *name, s32 oclass,
-              struct nvif_disp *disp)
+nvif_disp_ctor(struct nvif_device *device, const char *name, s32 oclass, struct nvif_disp *disp)
 {
        static const struct nvif_mclass disps[] = {
-               { GA102_DISP, -1 },
-               { TU102_DISP, -1 },
-               { GV100_DISP, -1 },
-               { GP102_DISP, -1 },
-               { GP100_DISP, -1 },
-               { GM200_DISP, -1 },
-               { GM107_DISP, -1 },
-               { GK110_DISP, -1 },
-               { GK104_DISP, -1 },
-               { GF110_DISP, -1 },
-               { GT214_DISP, -1 },
-               { GT206_DISP, -1 },
-               { GT200_DISP, -1 },
-               {   G82_DISP, -1 },
-               {  NV50_DISP, -1 },
-               {  NV04_DISP, -1 },
+               { GA102_DISP, 0 },
+               { TU102_DISP, 0 },
+               { GV100_DISP, 0 },
+               { GP102_DISP, 0 },
+               { GP100_DISP, 0 },
+               { GM200_DISP, 0 },
+               { GM107_DISP, 0 },
+               { GK110_DISP, 0 },
+               { GK104_DISP, 0 },
+               { GF110_DISP, 0 },
+               { GT214_DISP, 0 },
+               { GT206_DISP, 0 },
+               { GT200_DISP, 0 },
+               {   G82_DISP, 0 },
+               {  NV50_DISP, 0 },
+               {  NV04_DISP, 0 },
                {}
        };
-       int cid = nvif_sclass(&device->object, disps, oclass);
+       struct nvif_disp_v0 args;
+       int cid, ret;
+
+       cid = nvif_sclass(&device->object, disps, oclass);
        disp->object.client = NULL;
-       if (cid < 0)
+       if (cid < 0) {
+               NVIF_ERRON(cid, &device->object, "[NEW disp%04x] not supported", oclass);
                return cid;
+       }
+
+       args.version = 0;
 
-       return nvif_object_ctor(&device->object, name ? name : "nvifDisp", 0,
-                               disps[cid].oclass, NULL, 0, &disp->object);
+       ret = nvif_object_ctor(&device->object, name ?: "nvifDisp", 0,
+                              disps[cid].oclass, &args, sizeof(args), &disp->object);
+       NVIF_ERRON(ret, &device->object, "[NEW disp%04x]", disps[cid].oclass);
+       return ret;
 }
index b03f043efe261542c267a0a7a3ead68858c36f82..314e68c750a44f5f74cf989315cce72d4aeeb026 100644 (file)
@@ -64,20 +64,6 @@ nvkm-y += nvkm/engine/disp/conn.o
 
 nvkm-y += nvkm/engine/disp/rootnv04.o
 nvkm-y += nvkm/engine/disp/rootnv50.o
-nvkm-y += nvkm/engine/disp/rootg84.o
-nvkm-y += nvkm/engine/disp/rootg94.o
-nvkm-y += nvkm/engine/disp/rootgt200.o
-nvkm-y += nvkm/engine/disp/rootgt215.o
-nvkm-y += nvkm/engine/disp/rootgf119.o
-nvkm-y += nvkm/engine/disp/rootgk104.o
-nvkm-y += nvkm/engine/disp/rootgk110.o
-nvkm-y += nvkm/engine/disp/rootgm107.o
-nvkm-y += nvkm/engine/disp/rootgm200.o
-nvkm-y += nvkm/engine/disp/rootgp100.o
-nvkm-y += nvkm/engine/disp/rootgp102.o
-nvkm-y += nvkm/engine/disp/rootgv100.o
-nvkm-y += nvkm/engine/disp/roottu102.o
-nvkm-y += nvkm/engine/disp/rootga102.o
 
 nvkm-y += nvkm/engine/disp/capsgv100.o
 
@@ -125,3 +111,5 @@ nvkm-y += nvkm/engine/disp/cursgv100.o
 nvkm-y += nvkm/engine/disp/oimmnv50.o
 nvkm-y += nvkm/engine/disp/oimmgf119.o
 nvkm-y += nvkm/engine/disp/oimmgp102.o
+
+nvkm-y += nvkm/engine/disp/udisp.o
index 9bf2a229b5959709c7355fbb65f49f546fa09320..d68d523fabddcb5fdfefc62734e6839c2edd7053 100644 (file)
@@ -30,7 +30,6 @@
 
 #include <core/client.h>
 #include <core/notify.h>
-#include <core/oproxy.h>
 #include <subdev/bios.h>
 #include <subdev/bios/dcb.h>
 
@@ -145,45 +144,12 @@ nvkm_disp_ntfy(struct nvkm_object *object, u32 type, struct nvkm_event **event)
        return -EINVAL;
 }
 
-static void
-nvkm_disp_class_del(struct nvkm_oproxy *oproxy)
-{
-       struct nvkm_disp *disp = nvkm_disp(oproxy->base.engine);
-       spin_lock(&disp->client.lock);
-       if (disp->client.object == oproxy)
-               disp->client.object = NULL;
-       spin_unlock(&disp->client.lock);
-}
-
-static const struct nvkm_oproxy_func
-nvkm_disp_class = {
-       .dtor[1] = nvkm_disp_class_del,
-};
-
 static int
 nvkm_disp_class_new(struct nvkm_device *device,
                    const struct nvkm_oclass *oclass, void *data, u32 size,
                    struct nvkm_object **pobject)
 {
-       const struct nvkm_disp_oclass *sclass = oclass->engn;
-       struct nvkm_disp *disp = nvkm_disp(oclass->engine);
-       struct nvkm_oproxy *oproxy;
-       int ret;
-
-       ret = nvkm_oproxy_new_(&nvkm_disp_class, oclass, &oproxy);
-       if (ret)
-               return ret;
-       *pobject = &oproxy->base;
-
-       spin_lock(&disp->client.lock);
-       if (disp->client.object) {
-               spin_unlock(&disp->client.lock);
-               return -EBUSY;
-       }
-       disp->client.object = oproxy;
-       spin_unlock(&disp->client.lock);
-
-       return sclass->ctor(disp, oclass, data, size, &oproxy->object);
+       return nvkm_udisp_new(oclass, data, size, pobject);
 }
 
 static const struct nvkm_device_oclass
@@ -197,8 +163,7 @@ nvkm_disp_class_get(struct nvkm_oclass *oclass, int index,
 {
        struct nvkm_disp *disp = nvkm_disp(oclass->engine);
        if (index == 0) {
-               oclass->base = disp->func->root->base;
-               oclass->engn = disp->func->root;
+               oclass->base = disp->func->root;
                *class = &nvkm_disp_sclass;
                return 0;
        }
index 52fda56e3cbf9b4426ecda339c98a1bbd0c75ac3..d7b3a509243406290fd4896becf7c3c60e8a7783 100644 (file)
@@ -20,7 +20,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 #define gv100_disp_caps(p) container_of((p), struct gv100_disp_caps, object)
-#include "rootnv50.h"
+#include "priv.h"
 
 struct gv100_disp_caps {
        struct nvkm_object object;
index 253a1c875c9f8c81832dd8c9811a3b84bef79720..0f042d59289e15d9331c6a3fab5c8586c74047cc 100644 (file)
@@ -22,7 +22,6 @@
  * Authors: Ben Skeggs
  */
 #include "channv50.h"
-#include "rootnv50.h"
 
 #include <core/client.h>
 #include <core/notify.h>
index fc07f298cb33540eb8eefb2dab84eded9931e4ca..752753d84de5cf81ef224d38e0e2718fda8e2d3c 100644 (file)
@@ -24,7 +24,9 @@
 #include "priv.h"
 #include "head.h"
 #include "ior.h"
-#include "rootnv50.h"
+#include "channv50.h"
+
+#include <nvif/class.h>
 
 static const struct nvkm_disp_func
 g84_disp = {
@@ -39,7 +41,15 @@ g84_disp = {
        .dac = { .cnt = nv50_dac_cnt, .new = nv50_dac_new },
        .sor = { .cnt = nv50_sor_cnt, .new = g84_sor_new },
        .pior = { .cnt = nv50_pior_cnt, .new = nv50_pior_new },
-       .root = &g84_disp_root_oclass,
+       .root = { 0,0,G82_DISP },
+       .user = {
+               {{0,0,G82_DISP_CURSOR             }, nv50_disp_curs_new },
+               {{0,0,G82_DISP_OVERLAY            }, nv50_disp_oimm_new },
+               {{0,0,G82_DISP_BASE_CHANNEL_DMA   },  g84_disp_base_new },
+               {{0,0,G82_DISP_CORE_CHANNEL_DMA   },  g84_disp_core_new },
+               {{0,0,G82_DISP_OVERLAY_CHANNEL_DMA},  g84_disp_ovly_new },
+               {}
+       },
 };
 
 int
index 5b23c8fe94a9709814c88c780facbedd0b1dd1ae..33af38f3b5ffd4a56880237f4a8d21311b7f6290 100644 (file)
@@ -24,7 +24,9 @@
 #include "priv.h"
 #include "head.h"
 #include "ior.h"
-#include "rootnv50.h"
+#include "channv50.h"
+
+#include <nvif/class.h>
 
 static const struct nvkm_disp_func
 g94_disp = {
@@ -39,7 +41,15 @@ g94_disp = {
        .dac = { .cnt = nv50_dac_cnt, .new = nv50_dac_new },
        .sor = { .cnt = g94_sor_cnt, .new = g94_sor_new },
        .pior = { .cnt = nv50_pior_cnt, .new = nv50_pior_new },
-       .root = &g94_disp_root_oclass,
+       .root = { 0,0,GT206_DISP },
+       .user = {
+               {{0,0,  G82_DISP_CURSOR             },  nv50_disp_curs_new },
+               {{0,0,  G82_DISP_OVERLAY            },  nv50_disp_oimm_new },
+               {{0,0,GT200_DISP_BASE_CHANNEL_DMA   },   g84_disp_base_new },
+               {{0,0,GT206_DISP_CORE_CHANNEL_DMA   },   g94_disp_core_new },
+               {{0,0,GT200_DISP_OVERLAY_CHANNEL_DMA}, gt200_disp_ovly_new },
+               {}
+       },
 };
 
 int
index dbbe5917efa7e14ea06ee11b1a5830d14c5c9968..600add5defbedf79ad372fe77995da225c6616ce 100644 (file)
@@ -23,7 +23,8 @@
 #include "head.h"
 #include "ior.h"
 #include "channv50.h"
-#include "rootnv50.h"
+
+#include <nvif/class.h>
 
 static const struct nvkm_disp_func
 ga102_disp = {
@@ -38,7 +39,15 @@ ga102_disp = {
        .head = { .cnt = gv100_head_cnt, .new = gv100_head_new },
        .sor = { .cnt = gv100_sor_cnt, .new = ga102_sor_new },
        .ramht_size = 0x2000,
-       .root = &ga102_disp_root_oclass,
+       .root = {  0, 0,GA102_DISP },
+       .user = {
+               {{-1,-1,GV100_DISP_CAPS                  }, gv100_disp_caps_new },
+               {{ 0, 0,GA102_DISP_CURSOR                }, gv100_disp_curs_new },
+               {{ 0, 0,GA102_DISP_WINDOW_IMM_CHANNEL_DMA}, gv100_disp_wimm_new },
+               {{ 0, 0,GA102_DISP_CORE_CHANNEL_DMA      }, gv100_disp_core_new },
+               {{ 0, 0,GA102_DISP_WINDOW_CHANNEL_DMA    }, gv100_disp_wndw_new },
+               {}
+       },
 };
 
 int
index 28f015c8a08017003cda3e67b7356c7efa6ac70f..1d81816498f910b90153ab4ba3e48c49b71fe0b4 100644 (file)
 #include "ior.h"
 #include "outp.h"
 #include "channv50.h"
-#include "rootnv50.h"
 
 #include <core/ramht.h>
 #include <subdev/timer.h>
 
+#include <nvif/class.h>
+
 void
 gf119_disp_super(struct work_struct *work)
 {
@@ -264,7 +265,15 @@ gf119_disp = {
        .head = { .cnt = gf119_head_cnt, .new = gf119_head_new },
        .dac = { .cnt = gf119_dac_cnt, .new = gf119_dac_new },
        .sor = { .cnt = gf119_sor_cnt, .new = gf119_sor_new },
-       .root = &gf119_disp_root_oclass,
+       .root = { 0,0,GF110_DISP },
+       .user = {
+               {{0,0,GF110_DISP_CURSOR             }, gf119_disp_curs_new },
+               {{0,0,GF110_DISP_OVERLAY            }, gf119_disp_oimm_new },
+               {{0,0,GF110_DISP_BASE_CHANNEL_DMA   }, gf119_disp_base_new },
+               {{0,0,GF110_DISP_CORE_CHANNEL_DMA   }, gf119_disp_core_new },
+               {{0,0,GF110_DISP_OVERLAY_CONTROL_DMA}, gf119_disp_ovly_new },
+               {}
+       },
 };
 
 int
index 6635aa0798402e461bd9cd0de200b5dcd6f1c7f6..1c1bc25e634028d00821ab75b7c68fae853ff7a2 100644 (file)
@@ -24,7 +24,9 @@
 #include "priv.h"
 #include "head.h"
 #include "ior.h"
-#include "rootnv50.h"
+#include "channv50.h"
+
+#include <nvif/class.h>
 
 static const struct nvkm_disp_func
 gk104_disp = {
@@ -39,7 +41,15 @@ gk104_disp = {
        .head = { .cnt = gf119_head_cnt, .new = gf119_head_new },
        .dac = { .cnt = gf119_dac_cnt, .new = gf119_dac_new },
        .sor = { .cnt = gf119_sor_cnt, .new = gk104_sor_new },
-       .root = &gk104_disp_root_oclass,
+       .root = { 0,0,GK104_DISP },
+       .user = {
+               {{0,0,GK104_DISP_CURSOR             }, gf119_disp_curs_new },
+               {{0,0,GK104_DISP_OVERLAY            }, gf119_disp_oimm_new },
+               {{0,0,GK104_DISP_BASE_CHANNEL_DMA   }, gf119_disp_base_new },
+               {{0,0,GK104_DISP_CORE_CHANNEL_DMA   }, gk104_disp_core_new },
+               {{0,0,GK104_DISP_OVERLAY_CONTROL_DMA}, gk104_disp_ovly_new },
+               {}
+       },
 };
 
 int
index 6c0dae1e94aaa8e3d08b16e708dbd70b7668b166..491d931cbd6ead55680c4fa882b02e55ae95f74a 100644 (file)
@@ -24,7 +24,9 @@
 #include "priv.h"
 #include "head.h"
 #include "ior.h"
-#include "rootnv50.h"
+#include "channv50.h"
+
+#include <nvif/class.h>
 
 static const struct nvkm_disp_func
 gk110_disp = {
@@ -39,7 +41,15 @@ gk110_disp = {
        .head = { .cnt = gf119_head_cnt, .new = gf119_head_new },
        .dac = { .cnt = gf119_dac_cnt, .new = gf119_dac_new },
        .sor = { .cnt = gf119_sor_cnt, .new = gk104_sor_new },
-       .root = &gk110_disp_root_oclass,
+       .root = { 0,0,GK110_DISP },
+       .user = {
+               {{0,0,GK104_DISP_CURSOR             }, gf119_disp_curs_new },
+               {{0,0,GK104_DISP_OVERLAY            }, gf119_disp_oimm_new },
+               {{0,0,GK110_DISP_BASE_CHANNEL_DMA   }, gf119_disp_base_new },
+               {{0,0,GK110_DISP_CORE_CHANNEL_DMA   }, gk104_disp_core_new },
+               {{0,0,GK104_DISP_OVERLAY_CONTROL_DMA}, gk104_disp_ovly_new },
+               {}
+       },
 };
 
 int
index b7cdc1df81a01d9426b1e46e39302c3c60bc646a..613e1692b61fc2206d79f92607303e9c8e5bfba0 100644 (file)
@@ -24,7 +24,9 @@
 #include "priv.h"
 #include "head.h"
 #include "ior.h"
-#include "rootnv50.h"
+#include "channv50.h"
+
+#include <nvif/class.h>
 
 static const struct nvkm_disp_func
 gm107_disp = {
@@ -39,7 +41,15 @@ gm107_disp = {
        .head = { .cnt = gf119_head_cnt, .new = gf119_head_new },
        .dac = { .cnt = gf119_dac_cnt, .new = gf119_dac_new },
        .sor = { .cnt = gf119_sor_cnt, .new = gm107_sor_new },
-       .root = &gm107_disp_root_oclass,
+       .root = { 0,0,GM107_DISP },
+       .user = {
+               {{0,0,GK104_DISP_CURSOR             }, gf119_disp_curs_new },
+               {{0,0,GK104_DISP_OVERLAY            }, gf119_disp_oimm_new },
+               {{0,0,GK110_DISP_BASE_CHANNEL_DMA   }, gf119_disp_base_new },
+               {{0,0,GM107_DISP_CORE_CHANNEL_DMA   }, gk104_disp_core_new },
+               {{0,0,GK104_DISP_OVERLAY_CONTROL_DMA}, gk104_disp_ovly_new },
+               {}
+       },
 };
 
 int
index af0ab684772015693328dde8f19bbafe04522d81..a039195abae279da6dd35096ab08a76194af4c4c 100644 (file)
@@ -24,7 +24,9 @@
 #include "priv.h"
 #include "head.h"
 #include "ior.h"
-#include "rootnv50.h"
+#include "channv50.h"
+
+#include <nvif/class.h>
 
 static const struct nvkm_disp_func
 gm200_disp = {
@@ -39,7 +41,15 @@ gm200_disp = {
        .head = { .cnt = gf119_head_cnt, .new = gf119_head_new },
        .dac = { .cnt = gf119_dac_cnt, .new = gf119_dac_new },
        .sor = { .cnt = gf119_sor_cnt, .new = gm200_sor_new },
-       .root = &gm200_disp_root_oclass,
+       .root = { 0,0,GM200_DISP },
+       .user = {
+               {{0,0,GK104_DISP_CURSOR             }, gf119_disp_curs_new },
+               {{0,0,GK104_DISP_OVERLAY            }, gf119_disp_oimm_new },
+               {{0,0,GK110_DISP_BASE_CHANNEL_DMA   }, gf119_disp_base_new },
+               {{0,0,GM200_DISP_CORE_CHANNEL_DMA   }, gk104_disp_core_new },
+               {{0,0,GK104_DISP_OVERLAY_CONTROL_DMA}, gk104_disp_ovly_new },
+               {}
+       },
 };
 
 int
index deed1c75a35bb740fa6918edff2be875074c1e05..3da98e8f8427971de229eff312e0abbeb7e8c1f7 100644 (file)
@@ -24,7 +24,9 @@
 #include "priv.h"
 #include "head.h"
 #include "ior.h"
-#include "rootnv50.h"
+#include "channv50.h"
+
+#include <nvif/class.h>
 
 static const struct nvkm_disp_func
 gp100_disp = {
@@ -38,7 +40,15 @@ gp100_disp = {
        .uevent = &gf119_disp_chan_uevent,
        .head = { .cnt = gf119_head_cnt, .new = gf119_head_new },
        .sor = { .cnt = gf119_sor_cnt, .new = gp100_sor_new },
-       .root = &gp100_disp_root_oclass,
+       .root = { 0,0,GP100_DISP },
+       .user = {
+               {{0,0,GK104_DISP_CURSOR             }, gf119_disp_curs_new },
+               {{0,0,GK104_DISP_OVERLAY            }, gf119_disp_oimm_new },
+               {{0,0,GK110_DISP_BASE_CHANNEL_DMA   }, gf119_disp_base_new },
+               {{0,0,GP100_DISP_CORE_CHANNEL_DMA   }, gk104_disp_core_new },
+               {{0,0,GK104_DISP_OVERLAY_CONTROL_DMA}, gk104_disp_ovly_new },
+               {}
+       },
 };
 
 int
index 551bf2925aaa013edc9ddc2bf17d44ed77b12189..3e3acb8b7c43f2f6e2f8203ff4dbedb4c978907f 100644 (file)
@@ -25,7 +25,8 @@
 #include "head.h"
 #include "ior.h"
 #include "channv50.h"
-#include "rootnv50.h"
+
+#include <nvif/class.h>
 
 static void
 gp102_disp_intr_error(struct nvkm_disp *disp, int chid)
@@ -65,7 +66,15 @@ gp102_disp = {
        .uevent = &gf119_disp_chan_uevent,
        .head = { .cnt = gf119_head_cnt, .new = gf119_head_new },
        .sor = { .cnt = gf119_sor_cnt, .new = gp100_sor_new },
-       .root = &gp102_disp_root_oclass,
+       .root = { 0,0,GP102_DISP },
+       .user = {
+               {{0,0,GK104_DISP_CURSOR             }, gp102_disp_curs_new },
+               {{0,0,GK104_DISP_OVERLAY            }, gp102_disp_oimm_new },
+               {{0,0,GK110_DISP_BASE_CHANNEL_DMA   }, gp102_disp_base_new },
+               {{0,0,GP102_DISP_CORE_CHANNEL_DMA   }, gp102_disp_core_new },
+               {{0,0,GK104_DISP_OVERLAY_CONTROL_DMA}, gp102_disp_ovly_new },
+               {}
+       },
 };
 
 int
index c60e8a5cd4ed640a9d548a3fdf05cb77904ba363..3daad1154ca61465343fc8418dcb0dd8451ab988 100644 (file)
@@ -24,7 +24,9 @@
 #include "priv.h"
 #include "head.h"
 #include "ior.h"
-#include "rootnv50.h"
+#include "channv50.h"
+
+#include <nvif/class.h>
 
 static const struct nvkm_disp_func
 gt200_disp = {
@@ -39,7 +41,15 @@ gt200_disp = {
        .dac = { .cnt = nv50_dac_cnt, .new = nv50_dac_new },
        .sor = { .cnt = nv50_sor_cnt, .new = g84_sor_new },
        .pior = { .cnt = nv50_pior_cnt, .new = nv50_pior_new },
-       .root = &gt200_disp_root_oclass,
+       .root = { 0,0,GT200_DISP },
+       .user = {
+               {{0,0,  G82_DISP_CURSOR             },  nv50_disp_curs_new },
+               {{0,0,  G82_DISP_OVERLAY            },  nv50_disp_oimm_new },
+               {{0,0,GT200_DISP_BASE_CHANNEL_DMA   },   g84_disp_base_new },
+               {{0,0,GT200_DISP_CORE_CHANNEL_DMA   },   g84_disp_core_new },
+               {{0,0,GT200_DISP_OVERLAY_CHANNEL_DMA}, gt200_disp_ovly_new },
+               {}
+       },
 };
 
 int
index 2d641bbcce48b923dd99ce7894290f15db0de79e..885ad44fddb3b4c768dcfce2d7ae29eb4c54ecea 100644 (file)
@@ -24,7 +24,9 @@
 #include "priv.h"
 #include "head.h"
 #include "ior.h"
-#include "rootnv50.h"
+#include "channv50.h"
+
+#include <nvif/class.h>
 
 static const struct nvkm_disp_func
 gt215_disp = {
@@ -39,7 +41,15 @@ gt215_disp = {
        .dac = { .cnt = nv50_dac_cnt, .new = nv50_dac_new },
        .sor = { .cnt = g94_sor_cnt, .new = gt215_sor_new },
        .pior = { .cnt = nv50_pior_cnt, .new = nv50_pior_new },
-       .root = &gt215_disp_root_oclass,
+       .root = { 0,0,GT214_DISP },
+       .user = {
+               {{0,0,GT214_DISP_CURSOR             },  nv50_disp_curs_new },
+               {{0,0,GT214_DISP_OVERLAY            },  nv50_disp_oimm_new },
+               {{0,0,GT214_DISP_BASE_CHANNEL_DMA   },   g84_disp_base_new },
+               {{0,0,GT214_DISP_CORE_CHANNEL_DMA   },   g94_disp_core_new },
+               {{0,0,GT214_DISP_OVERLAY_CHANNEL_DMA},   g84_disp_ovly_new },
+               {}
+       },
 };
 
 int
index fe57920909de5cc0cd03845eb4c0524c50e7f6f2..fcd4d81d2a90702261be2aadc19a65b5e4aff291 100644 (file)
 #include "ior.h"
 #include "outp.h"
 #include "channv50.h"
-#include "rootnv50.h"
 
 #include <core/gpuobj.h>
 #include <subdev/timer.h>
 
+#include <nvif/class.h>
+
 int
 gv100_disp_wndw_cnt(struct nvkm_disp *disp, unsigned long *pmask)
 {
@@ -439,7 +440,15 @@ gv100_disp = {
        .head = { .cnt = gv100_head_cnt, .new = gv100_head_new },
        .sor = { .cnt = gv100_sor_cnt, .new = gv100_sor_new },
        .ramht_size = 0x2000,
-       .root = &gv100_disp_root_oclass,
+       .root = {  0, 0,GV100_DISP },
+       .user = {
+               {{-1,-1,GV100_DISP_CAPS                  }, gv100_disp_caps_new },
+               {{ 0, 0,GV100_DISP_CURSOR                }, gv100_disp_curs_new },
+               {{ 0, 0,GV100_DISP_WINDOW_IMM_CHANNEL_DMA}, gv100_disp_wimm_new },
+               {{ 0, 0,GV100_DISP_CORE_CHANNEL_DMA      }, gv100_disp_core_new },
+               {{ 0, 0,GV100_DISP_WINDOW_CHANNEL_DMA    }, gv100_disp_wndw_new },
+               {}
+       },
 };
 
 int
index bbf1a8f28f5942e793056e5c247d99d46a6ca35f..01fd421f13995ec40fb8392e63d9ee6bc1a07ea6 100644 (file)
@@ -22,7 +22,9 @@
 #include "priv.h"
 #include "head.h"
 #include "ior.h"
-#include "rootnv50.h"
+#include "channv50.h"
+
+#include <nvif/class.h>
 
 static const struct nvkm_disp_func
 mcp77_disp = {
@@ -37,7 +39,15 @@ mcp77_disp = {
        .dac = { .cnt = nv50_dac_cnt, .new = nv50_dac_new },
        .sor = { .cnt = g94_sor_cnt, .new = mcp77_sor_new },
        .pior = { .cnt = nv50_pior_cnt, .new = nv50_pior_new },
-       .root = &g94_disp_root_oclass,
+       .root = { 0,0,GT206_DISP },
+       .user = {
+               {{0,0,  G82_DISP_CURSOR             },  nv50_disp_curs_new },
+               {{0,0,  G82_DISP_OVERLAY            },  nv50_disp_oimm_new },
+               {{0,0,GT200_DISP_BASE_CHANNEL_DMA   },   g84_disp_base_new },
+               {{0,0,GT206_DISP_CORE_CHANNEL_DMA   },   g94_disp_core_new },
+               {{0,0,GT200_DISP_OVERLAY_CHANNEL_DMA}, gt200_disp_ovly_new },
+               {}
+       },
 };
 
 int
index 1352c2be004c8740b6e5568f7e093a39fa5a6e36..825274b5a8f824edeec149b7052552faa165f2ae 100644 (file)
@@ -22,7 +22,9 @@
 #include "priv.h"
 #include "head.h"
 #include "ior.h"
-#include "rootnv50.h"
+#include "channv50.h"
+
+#include <nvif/class.h>
 
 static const struct nvkm_disp_func
 mcp89_disp = {
@@ -37,7 +39,15 @@ mcp89_disp = {
        .dac = { .cnt = nv50_dac_cnt, .new = nv50_dac_new },
        .sor = { .cnt = g94_sor_cnt, .new = mcp89_sor_new },
        .pior = { .cnt = nv50_pior_cnt, .new = nv50_pior_new },
-       .root = &gt215_disp_root_oclass,
+       .root = { 0,0,GT214_DISP },
+       .user = {
+               {{0,0,GT214_DISP_CURSOR             },  nv50_disp_curs_new },
+               {{0,0,GT214_DISP_OVERLAY            },  nv50_disp_oimm_new },
+               {{0,0,GT214_DISP_BASE_CHANNEL_DMA   },   g84_disp_base_new },
+               {{0,0,GT214_DISP_CORE_CHANNEL_DMA   },   g94_disp_core_new },
+               {{0,0,GT214_DISP_OVERLAY_CHANNEL_DMA},   g84_disp_ovly_new },
+               {}
+       },
 };
 
 int
index 454199cc88fba9c399e869d2a8409c2e7a34e083..02bfc52b5b145190b350c0bdfa3ae81aceb2a86f 100644 (file)
@@ -24,6 +24,8 @@
 #include "priv.h"
 #include "head.h"
 
+#include <nvif/class.h>
+
 static void
 nv04_disp_intr(struct nvkm_disp *disp)
 {
@@ -54,7 +56,8 @@ nv04_disp_intr(struct nvkm_disp *disp)
 static const struct nvkm_disp_func
 nv04_disp = {
        .intr = nv04_disp_intr,
-       .root = &nv04_disp_root_oclass,
+       .root = { 0, 0, NV04_DISP },
+       .user = { {} },
 };
 
 int
index 42674fb3a8d85c84129aba08fd023cfafe3f48aa..0e8c0413d887c63080e9b92f75d4cf29c7e5c259 100644 (file)
@@ -26,7 +26,6 @@
 #include "ior.h"
 #include "outp.h"
 #include "channv50.h"
-#include "rootnv50.h"
 
 #include <core/client.h>
 #include <core/ramht.h>
@@ -37,6 +36,8 @@
 #include <subdev/devinit.h>
 #include <subdev/timer.h>
 
+#include <nvif/class.h>
+
 void *
 nv50_disp_dtor_(struct nvkm_disp *disp)
 {
@@ -727,7 +728,15 @@ nv50_disp = {
        .dac = { .cnt = nv50_dac_cnt, .new = nv50_dac_new },
        .sor = { .cnt = nv50_sor_cnt, .new = nv50_sor_new },
        .pior = { .cnt = nv50_pior_cnt, .new = nv50_pior_new },
-       .root = &nv50_disp_root_oclass,
+       .root = { 0, 0, NV50_DISP },
+       .user = {
+               {{0,0,NV50_DISP_CURSOR             }, nv50_disp_curs_new },
+               {{0,0,NV50_DISP_OVERLAY            }, nv50_disp_oimm_new },
+               {{0,0,NV50_DISP_BASE_CHANNEL_DMA   }, nv50_disp_base_new },
+               {{0,0,NV50_DISP_CORE_CHANNEL_DMA   }, nv50_disp_core_new },
+               {{0,0,NV50_DISP_OVERLAY_CHANNEL_DMA}, nv50_disp_ovly_new },
+               {}
+       }
 };
 
 int
index b7deb77f4bdb53a810b5d6f6a37e44bd3658b1c7..e562930264e293e4fec04c365d3542c1c10543a1 100644 (file)
@@ -22,7 +22,6 @@
  * Authors: Ben Skeggs
  */
 #include "channv50.h"
-#include "rootnv50.h"
 
 #include <subdev/timer.h>
 
index 981483eaaec0019deb3eae847249001f99229c8c..8190134f258b0b596f8ae3ecdd2b942a7d886b3c 100644 (file)
@@ -22,7 +22,6 @@
  * Authors: Ben Skeggs
  */
 #include "channv50.h"
-#include "rootnv50.h"
 
 #include <subdev/timer.h>
 
index bffe0006442119489c0266106e39368206f13824..c63c067319f5d23bed4f70b4f961c2fa4a405414 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: MIT */
 #ifndef __NVKM_DISP_PRIV_H__
 #define __NVKM_DISP_PRIV_H__
+#define nvkm_udisp(p) container_of((p), struct nvkm_disp, client.object)
 #include <engine/disp.h>
 #include <core/enum.h>
 struct nvkm_head;
@@ -32,12 +33,18 @@ struct nvkm_disp_func {
 
        u16 ramht_size;
 
-       const struct nvkm_disp_oclass *root;
+       const struct nvkm_sclass root;
+
+       struct nvkm_disp_user {
+               struct nvkm_sclass base;
+               int (*ctor)(const struct nvkm_oclass *, void *argv, u32 argc, struct nvkm_disp *,
+                           struct nvkm_object **);
+       } user[];
 };
 
 int  nvkm_disp_ntfy(struct nvkm_object *, u32, struct nvkm_event **);
-
-extern const struct nvkm_disp_oclass nv04_disp_root_oclass;
+int nv04_disp_mthd(struct nvkm_object *, u32, void *, u32);
+int nv50_disp_root_mthd_(struct nvkm_object *, u32, void *, u32);
 
 void *nv50_disp_dtor_(struct nvkm_disp *);
 int nv50_disp_oneinit_(struct nvkm_disp *);
@@ -71,6 +78,8 @@ void gv100_disp_fini(struct nvkm_disp *);
 void gv100_disp_intr(struct nvkm_disp *);
 void gv100_disp_super(struct work_struct *);
 int gv100_disp_wndw_cnt(struct nvkm_disp *, unsigned long *);
+int gv100_disp_caps_new(const struct nvkm_oclass *, void *, u32,
+                       struct nvkm_disp *, struct nvkm_object **);
 
 int tu102_disp_init(struct nvkm_disp *);
 
@@ -86,9 +95,5 @@ void nv50_disp_chan_uevent_send(struct nvkm_disp *, int);
 extern const struct nvkm_event_func gf119_disp_chan_uevent;
 extern const struct nvkm_event_func gv100_disp_chan_uevent;
 
-struct nvkm_disp_oclass {
-       int (*ctor)(struct nvkm_disp *, const struct nvkm_oclass *,
-                   void *data, u32 size, struct nvkm_object **);
-       struct nvkm_sclass base;
-};
+int nvkm_udisp_new(const struct nvkm_oclass *, void *, u32, struct nvkm_object **);
 #endif
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootg84.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootg84.c
deleted file mode 100644 (file)
index 1ed371f..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2012 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: Ben Skeggs
- */
-#include "rootnv50.h"
-#include "channv50.h"
-
-#include <nvif/class.h>
-
-static const struct nv50_disp_root_func
-g84_disp_root = {
-       .user = {
-               {{0,0,G82_DISP_CURSOR             }, nv50_disp_curs_new },
-               {{0,0,G82_DISP_OVERLAY            }, nv50_disp_oimm_new },
-               {{0,0,G82_DISP_BASE_CHANNEL_DMA   },  g84_disp_base_new },
-               {{0,0,G82_DISP_CORE_CHANNEL_DMA   },  g84_disp_core_new },
-               {{0,0,G82_DISP_OVERLAY_CHANNEL_DMA},  g84_disp_ovly_new },
-               {}
-       },
-};
-
-static int
-g84_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                 void *data, u32 size, struct nvkm_object **pobject)
-{
-       return nv50_disp_root_new_(&g84_disp_root, disp, oclass,
-                                  data, size, pobject);
-}
-
-const struct nvkm_disp_oclass
-g84_disp_root_oclass = {
-       .base.oclass = G82_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = g84_disp_root_new,
-};
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootg94.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootg94.c
deleted file mode 100644 (file)
index ef579eb..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2012 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: Ben Skeggs
- */
-#include "rootnv50.h"
-#include "channv50.h"
-
-#include <nvif/class.h>
-
-static const struct nv50_disp_root_func
-g94_disp_root = {
-       .user = {
-               {{0,0,  G82_DISP_CURSOR             },  nv50_disp_curs_new },
-               {{0,0,  G82_DISP_OVERLAY            },  nv50_disp_oimm_new },
-               {{0,0,GT200_DISP_BASE_CHANNEL_DMA   },   g84_disp_base_new },
-               {{0,0,GT206_DISP_CORE_CHANNEL_DMA   },   g94_disp_core_new },
-               {{0,0,GT200_DISP_OVERLAY_CHANNEL_DMA}, gt200_disp_ovly_new },
-               {}
-       },
-};
-
-static int
-g94_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                 void *data, u32 size, struct nvkm_object **pobject)
-{
-       return nv50_disp_root_new_(&g94_disp_root, disp, oclass,
-                                  data, size, pobject);
-}
-
-const struct nvkm_disp_oclass
-g94_disp_root_oclass = {
-       .base.oclass = GT206_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = g94_disp_root_new,
-};
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootga102.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootga102.c
deleted file mode 100644 (file)
index 9af07c3..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2021 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-#include "rootnv50.h"
-#include "channv50.h"
-
-#include <nvif/class.h>
-
-static const struct nv50_disp_root_func
-ga102_disp_root = {
-       .user = {
-               {{-1,-1,GV100_DISP_CAPS                }, gv100_disp_caps_new },
-               {{0,0,GA102_DISP_CURSOR                }, gv100_disp_curs_new },
-               {{0,0,GA102_DISP_WINDOW_IMM_CHANNEL_DMA}, gv100_disp_wimm_new },
-               {{0,0,GA102_DISP_CORE_CHANNEL_DMA      }, gv100_disp_core_new },
-               {{0,0,GA102_DISP_WINDOW_CHANNEL_DMA    }, gv100_disp_wndw_new },
-               {}
-       },
-};
-
-static int
-ga102_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                   void *data, u32 size, struct nvkm_object **pobject)
-{
-       return nv50_disp_root_new_(&ga102_disp_root, disp, oclass, data, size, pobject);
-}
-
-const struct nvkm_disp_oclass
-ga102_disp_root_oclass = {
-       .base.oclass = GA102_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = ga102_disp_root_new,
-};
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgf119.c
deleted file mode 100644 (file)
index fe01116..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2012 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: Ben Skeggs
- */
-#include "rootnv50.h"
-#include "channv50.h"
-
-#include <nvif/class.h>
-
-static const struct nv50_disp_root_func
-gf119_disp_root = {
-       .user = {
-               {{0,0,GF110_DISP_CURSOR             }, gf119_disp_curs_new },
-               {{0,0,GF110_DISP_OVERLAY            }, gf119_disp_oimm_new },
-               {{0,0,GF110_DISP_BASE_CHANNEL_DMA   }, gf119_disp_base_new },
-               {{0,0,GF110_DISP_CORE_CHANNEL_DMA   }, gf119_disp_core_new },
-               {{0,0,GF110_DISP_OVERLAY_CONTROL_DMA}, gf119_disp_ovly_new },
-               {}
-       },
-};
-
-static int
-gf119_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                   void *data, u32 size, struct nvkm_object **pobject)
-{
-       return nv50_disp_root_new_(&gf119_disp_root, disp, oclass,
-                                  data, size, pobject);
-}
-
-const struct nvkm_disp_oclass
-gf119_disp_root_oclass = {
-       .base.oclass = GF110_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = gf119_disp_root_new,
-};
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgk104.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgk104.c
deleted file mode 100644 (file)
index 9e8ffd3..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2012 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: Ben Skeggs
- */
-#include "rootnv50.h"
-#include "channv50.h"
-
-#include <nvif/class.h>
-
-static const struct nv50_disp_root_func
-gk104_disp_root = {
-       .user = {
-               {{0,0,GK104_DISP_CURSOR             }, gf119_disp_curs_new },
-               {{0,0,GK104_DISP_OVERLAY            }, gf119_disp_oimm_new },
-               {{0,0,GK104_DISP_BASE_CHANNEL_DMA   }, gf119_disp_base_new },
-               {{0,0,GK104_DISP_CORE_CHANNEL_DMA   }, gk104_disp_core_new },
-               {{0,0,GK104_DISP_OVERLAY_CONTROL_DMA}, gk104_disp_ovly_new },
-               {}
-       },
-};
-
-static int
-gk104_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                   void *data, u32 size, struct nvkm_object **pobject)
-{
-       return nv50_disp_root_new_(&gk104_disp_root, disp, oclass,
-                                  data, size, pobject);
-}
-
-const struct nvkm_disp_oclass
-gk104_disp_root_oclass = {
-       .base.oclass = GK104_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = gk104_disp_root_new,
-};
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgk110.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgk110.c
deleted file mode 100644 (file)
index dc85cc1..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2012 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: Ben Skeggs
- */
-#include "rootnv50.h"
-#include "channv50.h"
-
-#include <nvif/class.h>
-
-static const struct nv50_disp_root_func
-gk110_disp_root = {
-       .user = {
-               {{0,0,GK104_DISP_CURSOR             }, gf119_disp_curs_new },
-               {{0,0,GK104_DISP_OVERLAY            }, gf119_disp_oimm_new },
-               {{0,0,GK110_DISP_BASE_CHANNEL_DMA   }, gf119_disp_base_new },
-               {{0,0,GK110_DISP_CORE_CHANNEL_DMA   }, gk104_disp_core_new },
-               {{0,0,GK104_DISP_OVERLAY_CONTROL_DMA}, gk104_disp_ovly_new },
-               {}
-       },
-};
-
-static int
-gk110_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                   void *data, u32 size, struct nvkm_object **pobject)
-{
-       return nv50_disp_root_new_(&gk110_disp_root, disp, oclass,
-                                  data, size, pobject);
-}
-
-const struct nvkm_disp_oclass
-gk110_disp_root_oclass = {
-       .base.oclass = GK110_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = gk110_disp_root_new,
-};
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgm107.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgm107.c
deleted file mode 100644 (file)
index e0181ca..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2012 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: Ben Skeggs
- */
-#include "rootnv50.h"
-#include "channv50.h"
-
-#include <nvif/class.h>
-
-static const struct nv50_disp_root_func
-gm107_disp_root = {
-       .user = {
-               {{0,0,GK104_DISP_CURSOR             }, gf119_disp_curs_new },
-               {{0,0,GK104_DISP_OVERLAY            }, gf119_disp_oimm_new },
-               {{0,0,GK110_DISP_BASE_CHANNEL_DMA   }, gf119_disp_base_new },
-               {{0,0,GM107_DISP_CORE_CHANNEL_DMA   }, gk104_disp_core_new },
-               {{0,0,GK104_DISP_OVERLAY_CONTROL_DMA}, gk104_disp_ovly_new },
-               {}
-       },
-};
-
-static int
-gm107_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                   void *data, u32 size, struct nvkm_object **pobject)
-{
-       return nv50_disp_root_new_(&gm107_disp_root, disp, oclass,
-                                  data, size, pobject);
-}
-
-const struct nvkm_disp_oclass
-gm107_disp_root_oclass = {
-       .base.oclass = GM107_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = gm107_disp_root_new,
-};
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgm200.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgm200.c
deleted file mode 100644 (file)
index e5e590e..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2012 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: Ben Skeggs
- */
-#include "rootnv50.h"
-#include "channv50.h"
-
-#include <nvif/class.h>
-
-static const struct nv50_disp_root_func
-gm200_disp_root = {
-       .user = {
-               {{0,0,GK104_DISP_CURSOR             }, gf119_disp_curs_new },
-               {{0,0,GK104_DISP_OVERLAY            }, gf119_disp_oimm_new },
-               {{0,0,GK110_DISP_BASE_CHANNEL_DMA   }, gf119_disp_base_new },
-               {{0,0,GM200_DISP_CORE_CHANNEL_DMA   }, gk104_disp_core_new },
-               {{0,0,GK104_DISP_OVERLAY_CONTROL_DMA}, gk104_disp_ovly_new },
-               {}
-       },
-};
-
-static int
-gm200_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                   void *data, u32 size, struct nvkm_object **pobject)
-{
-       return nv50_disp_root_new_(&gm200_disp_root, disp, oclass,
-                                  data, size, pobject);
-}
-
-const struct nvkm_disp_oclass
-gm200_disp_root_oclass = {
-       .base.oclass = GM200_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = gm200_disp_root_new,
-};
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgp100.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgp100.c
deleted file mode 100644 (file)
index 762a1a9..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2015 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: Ben Skeggs <bskeggs@redhat.com>
- */
-#include "rootnv50.h"
-#include "channv50.h"
-
-#include <nvif/class.h>
-
-static const struct nv50_disp_root_func
-gp100_disp_root = {
-       .user = {
-               {{0,0,GK104_DISP_CURSOR             }, gf119_disp_curs_new },
-               {{0,0,GK104_DISP_OVERLAY            }, gf119_disp_oimm_new },
-               {{0,0,GK110_DISP_BASE_CHANNEL_DMA   }, gf119_disp_base_new },
-               {{0,0,GP100_DISP_CORE_CHANNEL_DMA   }, gk104_disp_core_new },
-               {{0,0,GK104_DISP_OVERLAY_CONTROL_DMA}, gk104_disp_ovly_new },
-               {}
-       },
-};
-
-static int
-gp100_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                   void *data, u32 size, struct nvkm_object **pobject)
-{
-       return nv50_disp_root_new_(&gp100_disp_root, disp, oclass,
-                                  data, size, pobject);
-}
-
-const struct nvkm_disp_oclass
-gp100_disp_root_oclass = {
-       .base.oclass = GP100_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = gp100_disp_root_new,
-};
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgp102.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgp102.c
deleted file mode 100644 (file)
index c7f0094..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2016 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: Ben Skeggs <bskeggs@redhat.com>
- */
-#include "rootnv50.h"
-#include "channv50.h"
-
-#include <nvif/class.h>
-
-static const struct nv50_disp_root_func
-gp102_disp_root = {
-       .user = {
-               {{0,0,GK104_DISP_CURSOR             }, gp102_disp_curs_new },
-               {{0,0,GK104_DISP_OVERLAY            }, gp102_disp_oimm_new },
-               {{0,0,GK110_DISP_BASE_CHANNEL_DMA   }, gp102_disp_base_new },
-               {{0,0,GP102_DISP_CORE_CHANNEL_DMA   }, gp102_disp_core_new },
-               {{0,0,GK104_DISP_OVERLAY_CONTROL_DMA}, gp102_disp_ovly_new },
-               {}
-       },
-};
-
-static int
-gp102_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                   void *data, u32 size, struct nvkm_object **pobject)
-{
-       return nv50_disp_root_new_(&gp102_disp_root, disp, oclass,
-                                  data, size, pobject);
-}
-
-const struct nvkm_disp_oclass
-gp102_disp_root_oclass = {
-       .base.oclass = GP102_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = gp102_disp_root_new,
-};
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgt200.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgt200.c
deleted file mode 100644 (file)
index a696365..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2012 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: Ben Skeggs
- */
-#include "rootnv50.h"
-#include "channv50.h"
-
-#include <nvif/class.h>
-
-static const struct nv50_disp_root_func
-gt200_disp_root = {
-       .user = {
-               {{0,0,  G82_DISP_CURSOR             },  nv50_disp_curs_new },
-               {{0,0,  G82_DISP_OVERLAY            },  nv50_disp_oimm_new },
-               {{0,0,GT200_DISP_BASE_CHANNEL_DMA   },   g84_disp_base_new },
-               {{0,0,GT200_DISP_CORE_CHANNEL_DMA   },   g84_disp_core_new },
-               {{0,0,GT200_DISP_OVERLAY_CHANNEL_DMA}, gt200_disp_ovly_new },
-               {}
-       },
-};
-
-static int
-gt200_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                   void *data, u32 size, struct nvkm_object **pobject)
-{
-       return nv50_disp_root_new_(&gt200_disp_root, disp, oclass,
-                                  data, size, pobject);
-}
-
-const struct nvkm_disp_oclass
-gt200_disp_root_oclass = {
-       .base.oclass = GT200_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = gt200_disp_root_new,
-};
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgt215.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgt215.c
deleted file mode 100644 (file)
index 4fe0a3a..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2012 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: Ben Skeggs
- */
-#include "rootnv50.h"
-#include "channv50.h"
-
-#include <nvif/class.h>
-
-static const struct nv50_disp_root_func
-gt215_disp_root = {
-       .user = {
-               {{0,0,GT214_DISP_CURSOR             },  nv50_disp_curs_new },
-               {{0,0,GT214_DISP_OVERLAY            },  nv50_disp_oimm_new },
-               {{0,0,GT214_DISP_BASE_CHANNEL_DMA   },   g84_disp_base_new },
-               {{0,0,GT214_DISP_CORE_CHANNEL_DMA   },   g94_disp_core_new },
-               {{0,0,GT214_DISP_OVERLAY_CHANNEL_DMA},   g84_disp_ovly_new },
-               {}
-       },
-};
-
-static int
-gt215_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                   void *data, u32 size, struct nvkm_object **pobject)
-{
-       return nv50_disp_root_new_(&gt215_disp_root, disp, oclass,
-                                  data, size, pobject);
-}
-
-const struct nvkm_disp_oclass
-gt215_disp_root_oclass = {
-       .base.oclass = GT214_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = gt215_disp_root_new,
-};
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgv100.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgv100.c
deleted file mode 100644 (file)
index 47efb48..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2018 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-#include "rootnv50.h"
-#include "channv50.h"
-
-#include <nvif/class.h>
-
-static const struct nv50_disp_root_func
-gv100_disp_root = {
-       .user = {
-               {{-1,-1,GV100_DISP_CAPS                }, gv100_disp_caps_new },
-               {{0,0,GV100_DISP_CURSOR                }, gv100_disp_curs_new },
-               {{0,0,GV100_DISP_WINDOW_IMM_CHANNEL_DMA}, gv100_disp_wimm_new },
-               {{0,0,GV100_DISP_CORE_CHANNEL_DMA      }, gv100_disp_core_new },
-               {{0,0,GV100_DISP_WINDOW_CHANNEL_DMA    }, gv100_disp_wndw_new },
-               {}
-       },
-};
-
-static int
-gv100_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                   void *data, u32 size, struct nvkm_object **pobject)
-{
-       return nv50_disp_root_new_(&gv100_disp_root, disp, oclass,
-                                  data, size, pobject);
-}
-
-const struct nvkm_disp_oclass
-gv100_disp_root_oclass = {
-       .base.oclass = GV100_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = gv100_disp_root_new,
-};
index 7f3e2554a83d104e79c197af9fbb5fb81d578438..9acaec5c271e66e509778ed884bc93288116e402 100644 (file)
  *
  * Authors: Ben Skeggs
  */
-#define nv04_disp_root(p) container_of((p), struct nv04_disp_root, object)
 #include "priv.h"
 #include "head.h"
 
 #include <core/client.h>
 
-#include <nvif/class.h>
 #include <nvif/cl0046.h>
 #include <nvif/unpack.h>
 
-struct nv04_disp_root {
-       struct nvkm_object object;
-       struct nvkm_disp *disp;
-};
-
-static int
+int
 nv04_disp_mthd(struct nvkm_object *object, u32 mthd, void *data, u32 size)
 {
-       struct nv04_disp_root *root = nv04_disp_root(object);
+       struct nvkm_disp *disp = nvkm_disp(object->engine);
        union {
                struct nv04_disp_mthd_v0 v0;
        } *args = data;
@@ -55,7 +48,7 @@ nv04_disp_mthd(struct nvkm_object *object, u32 mthd, void *data, u32 size)
        } else
                return ret;
 
-       if (!(head = nvkm_head_find(root->disp, id)))
+       if (!(head = nvkm_head_find(disp, id)))
                return -ENXIO;
 
        switch (mthd) {
@@ -67,32 +60,3 @@ nv04_disp_mthd(struct nvkm_object *object, u32 mthd, void *data, u32 size)
 
        return -EINVAL;
 }
-
-static const struct nvkm_object_func
-nv04_disp_root = {
-       .mthd = nv04_disp_mthd,
-       .ntfy = nvkm_disp_ntfy,
-};
-
-static int
-nv04_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                  void *data, u32 size, struct nvkm_object **pobject)
-{
-       struct nv04_disp_root *root;
-
-       if (!(root = kzalloc(sizeof(*root), GFP_KERNEL)))
-               return -ENOMEM;
-       root->disp = disp;
-       *pobject = &root->object;
-
-       nvkm_object_ctor(&nv04_disp_root, oclass, &root->object);
-       return 0;
-}
-
-const struct nvkm_disp_oclass
-nv04_disp_root_oclass = {
-       .base.oclass = NV04_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = nv04_disp_root_new,
-};
index 97964179ac61632d11d0b6feaa381d0dde56fc78..8821bf12868570f354d8764a9c1058d3461d4efc 100644 (file)
@@ -21,7 +21,6 @@
  *
  * Authors: Ben Skeggs
  */
-#include "rootnv50.h"
 #include "channv50.h"
 #include "head.h"
 #include "ior.h"
 #include <nvif/cl5070.h>
 #include <nvif/unpack.h>
 
-static int
+int
 nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size)
 {
        union {
                struct nv50_disp_mthd_v0 v0;
                struct nv50_disp_mthd_v1 v1;
        } *args = data;
-       struct nv50_disp_root *root = nv50_disp_root(object);
-       struct nvkm_disp *disp = root->disp;
+       struct nvkm_disp *disp = nvkm_udisp(object);
        struct nvkm_outp *temp, *outp = NULL;
        struct nvkm_head *head;
        u16 type, mask = 0;
@@ -271,88 +269,3 @@ nv50_disp_root_mthd_(struct nvkm_object *object, u32 mthd, void *data, u32 size)
 
        return -EINVAL;
 }
-
-static int
-nv50_disp_root_child_new_(const struct nvkm_oclass *oclass,
-                         void *argv, u32 argc, struct nvkm_object **pobject)
-{
-       struct nvkm_disp *disp = nv50_disp_root(oclass->parent)->disp;
-       const struct nv50_disp_user *user = oclass->priv;
-       return user->ctor(oclass, argv, argc, disp, pobject);
-}
-
-static int
-nv50_disp_root_child_get_(struct nvkm_object *object, int index,
-                         struct nvkm_oclass *sclass)
-{
-       struct nv50_disp_root *root = nv50_disp_root(object);
-
-       if (root->func->user[index].ctor) {
-               sclass->base = root->func->user[index].base;
-               sclass->priv = root->func->user + index;
-               sclass->ctor = nv50_disp_root_child_new_;
-               return 0;
-       }
-
-       return -EINVAL;
-}
-
-static void *
-nv50_disp_root_dtor_(struct nvkm_object *object)
-{
-       struct nv50_disp_root *root = nv50_disp_root(object);
-       return root;
-}
-
-static const struct nvkm_object_func
-nv50_disp_root_ = {
-       .dtor = nv50_disp_root_dtor_,
-       .mthd = nv50_disp_root_mthd_,
-       .ntfy = nvkm_disp_ntfy,
-       .sclass = nv50_disp_root_child_get_,
-};
-
-int
-nv50_disp_root_new_(const struct nv50_disp_root_func *func,
-                   struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                   void *data, u32 size, struct nvkm_object **pobject)
-{
-       struct nv50_disp_root *root;
-
-       if (!(root = kzalloc(sizeof(*root), GFP_KERNEL)))
-               return -ENOMEM;
-       *pobject = &root->object;
-
-       nvkm_object_ctor(&nv50_disp_root_, oclass, &root->object);
-       root->func = func;
-       root->disp = disp;
-       return 0;
-}
-
-static const struct nv50_disp_root_func
-nv50_disp_root = {
-       .user = {
-               {{0,0,NV50_DISP_CURSOR             }, nv50_disp_curs_new },
-               {{0,0,NV50_DISP_OVERLAY            }, nv50_disp_oimm_new },
-               {{0,0,NV50_DISP_BASE_CHANNEL_DMA   }, nv50_disp_base_new },
-               {{0,0,NV50_DISP_CORE_CHANNEL_DMA   }, nv50_disp_core_new },
-               {{0,0,NV50_DISP_OVERLAY_CHANNEL_DMA}, nv50_disp_ovly_new },
-               {}
-       },
-};
-
-static int
-nv50_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                  void *data, u32 size, struct nvkm_object **pobject)
-{
-       return nv50_disp_root_new_(&nv50_disp_root, disp, oclass,
-                                  data, size, pobject);
-}
-
-const struct nvkm_disp_oclass
-nv50_disp_root_oclass = {
-       .base.oclass = NV50_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = nv50_disp_root_new,
-};
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h
deleted file mode 100644 (file)
index eee2518..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-#ifndef __NV50_DISP_ROOT_H__
-#define __NV50_DISP_ROOT_H__
-#define nv50_disp_root(p) container_of((p), struct nv50_disp_root, object)
-#include <core/object.h>
-#include "priv.h"
-
-struct nv50_disp_root {
-       const struct nv50_disp_root_func *func;
-       struct nvkm_disp *disp;
-       struct nvkm_object object;
-};
-
-struct nv50_disp_root_func {
-       int blah;
-       struct nv50_disp_user {
-               struct nvkm_sclass base;
-               int (*ctor)(const struct nvkm_oclass *, void *argv, u32 argc,
-                           struct nvkm_disp *, struct nvkm_object **);
-       } user[];
-};
-
-int  nv50_disp_root_new_(const struct nv50_disp_root_func *, struct nvkm_disp *,
-                        const struct nvkm_oclass *, void *data, u32 size,
-                        struct nvkm_object **);
-
-int gv100_disp_caps_new(const struct nvkm_oclass *, void *, u32,
-                       struct nvkm_disp *, struct nvkm_object **);
-
-extern const struct nvkm_disp_oclass nv50_disp_root_oclass;
-extern const struct nvkm_disp_oclass g84_disp_root_oclass;
-extern const struct nvkm_disp_oclass g94_disp_root_oclass;
-extern const struct nvkm_disp_oclass gt200_disp_root_oclass;
-extern const struct nvkm_disp_oclass gt215_disp_root_oclass;
-extern const struct nvkm_disp_oclass gf119_disp_root_oclass;
-extern const struct nvkm_disp_oclass gk104_disp_root_oclass;
-extern const struct nvkm_disp_oclass gk110_disp_root_oclass;
-extern const struct nvkm_disp_oclass gm107_disp_root_oclass;
-extern const struct nvkm_disp_oclass gm200_disp_root_oclass;
-extern const struct nvkm_disp_oclass gp100_disp_root_oclass;
-extern const struct nvkm_disp_oclass gp102_disp_root_oclass;
-extern const struct nvkm_disp_oclass gv100_disp_root_oclass;
-extern const struct nvkm_disp_oclass tu102_disp_root_oclass;
-extern const struct nvkm_disp_oclass ga102_disp_root_oclass;
-#endif
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/roottu102.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/roottu102.c
deleted file mode 100644 (file)
index d8719d3..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2018 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
-#include "rootnv50.h"
-#include "channv50.h"
-
-#include <nvif/class.h>
-
-static const struct nv50_disp_root_func
-tu102_disp_root = {
-       .user = {
-               {{-1,-1,GV100_DISP_CAPS                }, gv100_disp_caps_new },
-               {{0,0,TU102_DISP_CURSOR                }, gv100_disp_curs_new },
-               {{0,0,TU102_DISP_WINDOW_IMM_CHANNEL_DMA}, gv100_disp_wimm_new },
-               {{0,0,TU102_DISP_CORE_CHANNEL_DMA      }, gv100_disp_core_new },
-               {{0,0,TU102_DISP_WINDOW_CHANNEL_DMA    }, gv100_disp_wndw_new },
-               {}
-       },
-};
-
-static int
-tu102_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass,
-                   void *data, u32 size, struct nvkm_object **pobject)
-{
-       return nv50_disp_root_new_(&tu102_disp_root, disp, oclass,
-                                  data, size, pobject);
-}
-
-const struct nvkm_disp_oclass
-tu102_disp_root_oclass = {
-       .base.oclass = TU102_DISP,
-       .base.minver = -1,
-       .base.maxver = -1,
-       .ctor = tu102_disp_root_new,
-};
index 727f7ac29f86eedd88ec70a69302757268bcea0b..d904a9b19fec7603a2ceb6435cf10c49b46f70d1 100644 (file)
 #include "head.h"
 #include "ior.h"
 #include "channv50.h"
-#include "rootnv50.h"
 
 #include <core/gpuobj.h>
 #include <subdev/timer.h>
 
+#include <nvif/class.h>
+
 int
 tu102_disp_init(struct nvkm_disp *disp)
 {
@@ -144,7 +145,15 @@ tu102_disp = {
        .head = { .cnt = gv100_head_cnt, .new = gv100_head_new },
        .sor = { .cnt = gv100_sor_cnt, .new = tu102_sor_new },
        .ramht_size = 0x2000,
-       .root = &tu102_disp_root_oclass,
+       .root = {  0, 0,TU102_DISP },
+       .user = {
+               {{-1,-1,GV100_DISP_CAPS                  }, gv100_disp_caps_new },
+               {{ 0, 0,TU102_DISP_CURSOR                }, gv100_disp_curs_new },
+               {{ 0, 0,TU102_DISP_WINDOW_IMM_CHANNEL_DMA}, gv100_disp_wimm_new },
+               {{ 0, 0,TU102_DISP_CORE_CHANNEL_DMA      }, gv100_disp_core_new },
+               {{ 0, 0,TU102_DISP_WINDOW_CHANNEL_DMA    }, gv100_disp_wndw_new },
+               {}
+       },
 };
 
 int
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/udisp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/udisp.c
new file mode 100644 (file)
index 0000000..ec17254
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2021 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include "priv.h"
+
+#include <nvif/if0010.h>
+
+static int
+nvkm_udisp_sclass_new(const struct nvkm_oclass *oclass, void *argv, u32 argc,
+                     struct nvkm_object **pobject)
+{
+       struct nvkm_disp *disp = nvkm_udisp(oclass->parent);
+       const struct nvkm_disp_user *user = oclass->priv;
+
+       return user->ctor(oclass, argv, argc, disp, pobject);
+}
+
+static int
+nvkm_udisp_sclass(struct nvkm_object *object, int index, struct nvkm_oclass *sclass)
+{
+       struct nvkm_disp *disp = nvkm_udisp(object);
+
+       if (disp->func->user[index].ctor) {
+               sclass->base = disp->func->user[index].base;
+               sclass->priv = disp->func->user + index;
+               sclass->ctor = nvkm_udisp_sclass_new;
+               return 0;
+       }
+
+       return -EINVAL;
+}
+
+static int
+nvkm_udisp_mthd(struct nvkm_object *object, u32 mthd, void *argv, u32 argc)
+{
+       struct nvkm_disp *disp = nvkm_udisp(object);
+
+       if (disp->engine.subdev.device->card_type >= NV_50)
+               return nv50_disp_root_mthd_(object, mthd, argv, argc);
+
+       return nv04_disp_mthd(object, mthd, argv, argc);
+}
+
+static void *
+nvkm_udisp_dtor(struct nvkm_object *object)
+{
+       struct nvkm_disp *disp = nvkm_udisp(object);
+
+       spin_lock(&disp->client.lock);
+       if (object == &disp->client.object)
+               disp->client.object.func = NULL;
+       spin_unlock(&disp->client.lock);
+       return NULL;
+}
+
+static const struct nvkm_object_func
+nvkm_udisp = {
+       .dtor = nvkm_udisp_dtor,
+       .mthd = nvkm_udisp_mthd,
+       .ntfy = nvkm_disp_ntfy,
+       .sclass = nvkm_udisp_sclass,
+};
+
+int
+nvkm_udisp_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, struct nvkm_object **pobject)
+{
+       struct nvkm_disp *disp = nvkm_disp(oclass->engine);
+       union nvif_disp_args *args = argv;
+
+       if (argc != sizeof(args->v0) || args->v0.version != 0)
+               return -ENOSYS;
+
+       spin_lock(&disp->client.lock);
+       if (disp->client.object.func) {
+               spin_unlock(&disp->client.lock);
+               return -EBUSY;
+       }
+       nvkm_object_ctor(&nvkm_udisp, oclass, &disp->client.object);
+       *pobject = &disp->client.object;
+       spin_unlock(&disp->client.lock);
+       return 0;
+}