drm/nouveau/device: convert to engine, rather than subdev
authorBen Skeggs <bskeggs@redhat.com>
Thu, 25 Apr 2013 07:23:43 +0000 (17:23 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 26 Apr 2013 05:38:10 +0000 (15:38 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
15 files changed:
drivers/gpu/drm/nouveau/Makefile
drivers/gpu/drm/nouveau/core/core/client.c
drivers/gpu/drm/nouveau/core/core/engine.c
drivers/gpu/drm/nouveau/core/engine/device/base.c [moved from drivers/gpu/drm/nouveau/core/subdev/device/base.c with 98% similarity]
drivers/gpu/drm/nouveau/core/engine/device/nv04.c [moved from drivers/gpu/drm/nouveau/core/subdev/device/nv04.c with 99% similarity]
drivers/gpu/drm/nouveau/core/engine/device/nv10.c [moved from drivers/gpu/drm/nouveau/core/subdev/device/nv10.c with 99% similarity]
drivers/gpu/drm/nouveau/core/engine/device/nv20.c [moved from drivers/gpu/drm/nouveau/core/subdev/device/nv20.c with 99% similarity]
drivers/gpu/drm/nouveau/core/engine/device/nv30.c [moved from drivers/gpu/drm/nouveau/core/subdev/device/nv30.c with 99% similarity]
drivers/gpu/drm/nouveau/core/engine/device/nv40.c [moved from drivers/gpu/drm/nouveau/core/subdev/device/nv40.c with 99% similarity]
drivers/gpu/drm/nouveau/core/engine/device/nv50.c [moved from drivers/gpu/drm/nouveau/core/subdev/device/nv50.c with 99% similarity]
drivers/gpu/drm/nouveau/core/engine/device/nvc0.c [moved from drivers/gpu/drm/nouveau/core/subdev/device/nvc0.c with 99% similarity]
drivers/gpu/drm/nouveau/core/engine/device/nve0.c [moved from drivers/gpu/drm/nouveau/core/subdev/device/nve0.c with 99% similarity]
drivers/gpu/drm/nouveau/core/include/core/device.h
drivers/gpu/drm/nouveau/core/include/engine/device.h [moved from drivers/gpu/drm/nouveau/core/include/subdev/device.h with 100% similarity]
drivers/gpu/drm/nouveau/nouveau_drm.c

index d77d05671fe65d5ed0ce9efa00a77159268d506d..52930a20d8f887b0d867a38a3699ed9a0a6ef427 100644 (file)
@@ -53,15 +53,6 @@ nouveau-y += core/subdev/clock/nva3.o
 nouveau-y += core/subdev/clock/nvc0.o
 nouveau-y += core/subdev/clock/pllnv04.o
 nouveau-y += core/subdev/clock/pllnva3.o
-nouveau-y += core/subdev/device/base.o
-nouveau-y += core/subdev/device/nv04.o
-nouveau-y += core/subdev/device/nv10.o
-nouveau-y += core/subdev/device/nv20.o
-nouveau-y += core/subdev/device/nv30.o
-nouveau-y += core/subdev/device/nv40.o
-nouveau-y += core/subdev/device/nv50.o
-nouveau-y += core/subdev/device/nvc0.o
-nouveau-y += core/subdev/device/nve0.o
 nouveau-y += core/subdev/devinit/base.o
 nouveau-y += core/subdev/devinit/nv04.o
 nouveau-y += core/subdev/devinit/nv05.o
@@ -151,6 +142,15 @@ nouveau-y += core/engine/copy/nvc0.o
 nouveau-y += core/engine/copy/nve0.o
 nouveau-y += core/engine/crypt/nv84.o
 nouveau-y += core/engine/crypt/nv98.o
+nouveau-y += core/engine/device/base.o
+nouveau-y += core/engine/device/nv04.o
+nouveau-y += core/engine/device/nv10.o
+nouveau-y += core/engine/device/nv20.o
+nouveau-y += core/engine/device/nv30.o
+nouveau-y += core/engine/device/nv40.o
+nouveau-y += core/engine/device/nv50.o
+nouveau-y += core/engine/device/nvc0.o
+nouveau-y += core/engine/device/nve0.o
 nouveau-y += core/engine/disp/base.o
 nouveau-y += core/engine/disp/nv04.o
 nouveau-y += core/engine/disp/nv50.o
index 295c22165eac76e4493ab13a3a229a213405384d..2be389d72f52f2039bbfa54b9f5d8f3542837200 100644 (file)
@@ -27,7 +27,7 @@
 #include <core/handle.h>
 #include <core/option.h>
 
-#include <subdev/device.h>
+#include <engine/device.h>
 
 static void
 nouveau_client_dtor(struct nouveau_object *object)
index 09b3bd502fd05daccaf3292d1cd872e5e741e312..c8bed4a2683339072786a0b4d146b06c9594cc5b 100644 (file)
@@ -33,7 +33,6 @@ nouveau_engine_create_(struct nouveau_object *parent,
                       const char *iname, const char *fname,
                       int length, void **pobject)
 {
-       struct nouveau_device *device = nv_device(parent);
        struct nouveau_engine *engine;
        int ret;
 
@@ -43,7 +42,8 @@ nouveau_engine_create_(struct nouveau_object *parent,
        if (ret)
                return ret;
 
-       if (!nouveau_boolopt(device->cfgopt, iname, enable)) {
+       if ( parent &&
+           !nouveau_boolopt(nv_device(parent)->cfgopt, iname, enable)) {
                if (!enable)
                        nv_warn(engine, "disabled, %s=1 to enable\n", iname);
                return -ENODEV;
similarity index 98%
rename from drivers/gpu/drm/nouveau/core/subdev/device/base.c
rename to drivers/gpu/drm/nouveau/core/engine/device/base.c
index 3937ced5c75310ce7978aa606e4a5a6afae5d1eb..35616424f559aaac98ea86946b0fc727b1ca8d9f 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <core/class.h>
 
-#include <subdev/device.h>
+#include <engine/device.h>
 
 static DEFINE_MUTEX(nv_devices_mutex);
 static LIST_HEAD(nv_devices);
@@ -428,15 +428,15 @@ nouveau_device_dtor(struct nouveau_object *object)
        list_del(&device->head);
        mutex_unlock(&nv_devices_mutex);
 
-       if (device->base.mmio)
-               iounmap(device->base.mmio);
+       if (nv_subdev(device)->mmio)
+               iounmap(nv_subdev(device)->mmio);
 
-       nouveau_subdev_destroy(&device->base);
+       nouveau_engine_destroy(&device->base);
 }
 
 static struct nouveau_oclass
 nouveau_device_oclass = {
-       .handle = NV_SUBDEV(DEVICE, 0x00),
+       .handle = NV_ENGINE(DEVICE, 0x00),
        .ofuncs = &(struct nouveau_ofuncs) {
                .dtor = nouveau_device_dtor,
        },
@@ -456,7 +456,7 @@ nouveau_device_create_(struct pci_dev *pdev, u64 name, const char *sname,
                        goto done;
        }
 
-       ret = nouveau_subdev_create_(NULL, NULL, &nouveau_device_oclass, 0,
+       ret = nouveau_engine_create_(NULL, NULL, &nouveau_device_oclass, true,
                                     "DEVICE", "device", length, pobject);
        device = *pobject;
        if (ret)
similarity index 99%
rename from drivers/gpu/drm/nouveau/core/subdev/device/nv04.c
rename to drivers/gpu/drm/nouveau/core/engine/device/nv04.c
index 473c5c03d3c97189456fed469886d8fd1e0323cd..a0284cf09c0f724a1b963287382992035a75bbfc 100644 (file)
@@ -22,7 +22,6 @@
  * Authors: Ben Skeggs
  */
 
-#include <subdev/device.h>
 #include <subdev/bios.h>
 #include <subdev/bus.h>
 #include <subdev/i2c.h>
@@ -34,6 +33,7 @@
 #include <subdev/instmem.h>
 #include <subdev/vm.h>
 
+#include <engine/device.h>
 #include <engine/dmaobj.h>
 #include <engine/fifo.h>
 #include <engine/software.h>
similarity index 99%
rename from drivers/gpu/drm/nouveau/core/subdev/device/nv10.c
rename to drivers/gpu/drm/nouveau/core/engine/device/nv10.c
index d0774f5bebe12e2b4cb4385ea55901bf414c0005..1b7809a095c3b51b24dc5ba3d40c4adced824a1e 100644 (file)
@@ -22,7 +22,6 @@
  * Authors: Ben Skeggs
  */
 
-#include <subdev/device.h>
 #include <subdev/bios.h>
 #include <subdev/bus.h>
 #include <subdev/gpio.h>
@@ -35,6 +34,7 @@
 #include <subdev/instmem.h>
 #include <subdev/vm.h>
 
+#include <engine/device.h>
 #include <engine/dmaobj.h>
 #include <engine/fifo.h>
 #include <engine/software.h>
similarity index 99%
rename from drivers/gpu/drm/nouveau/core/subdev/device/nv20.c
rename to drivers/gpu/drm/nouveau/core/engine/device/nv20.c
index ab920e0dc45b21d1c1261c9ff190212456b0998b..12a4005fa619ce0412deca5e393378c01322f9bd 100644 (file)
@@ -22,7 +22,6 @@
  * Authors: Ben Skeggs
  */
 
-#include <subdev/device.h>
 #include <subdev/bios.h>
 #include <subdev/bus.h>
 #include <subdev/gpio.h>
@@ -36,6 +35,7 @@
 #include <subdev/instmem.h>
 #include <subdev/vm.h>
 
+#include <engine/device.h>
 #include <engine/dmaobj.h>
 #include <engine/fifo.h>
 #include <engine/software.h>
similarity index 99%
rename from drivers/gpu/drm/nouveau/core/subdev/device/nv30.c
rename to drivers/gpu/drm/nouveau/core/engine/device/nv30.c
index 5f2110261b04c4ad0e253cf56a5f1cb8b2635c9b..cef0f1ea4c217a1ae430b6dfde0fdf66459bf948 100644 (file)
@@ -22,7 +22,6 @@
  * Authors: Ben Skeggs
  */
 
-#include <subdev/device.h>
 #include <subdev/bios.h>
 #include <subdev/bus.h>
 #include <subdev/gpio.h>
@@ -35,6 +34,7 @@
 #include <subdev/instmem.h>
 #include <subdev/vm.h>
 
+#include <engine/device.h>
 #include <engine/dmaobj.h>
 #include <engine/fifo.h>
 #include <engine/software.h>
similarity index 99%
rename from drivers/gpu/drm/nouveau/core/subdev/device/nv40.c
rename to drivers/gpu/drm/nouveau/core/engine/device/nv40.c
index f3d55efe9ac9e281ca5a1e032bd198350c7c9466..1719cb0ee595ed701da589cde8e446b379340886 100644 (file)
@@ -22,7 +22,6 @@
  * Authors: Ben Skeggs
  */
 
-#include <subdev/device.h>
 #include <subdev/bios.h>
 #include <subdev/bus.h>
 #include <subdev/vm.h>
@@ -37,6 +36,7 @@
 #include <subdev/instmem.h>
 #include <subdev/vm.h>
 
+#include <engine/device.h>
 #include <engine/dmaobj.h>
 #include <engine/fifo.h>
 #include <engine/software.h>
similarity index 99%
rename from drivers/gpu/drm/nouveau/core/subdev/device/nv50.c
rename to drivers/gpu/drm/nouveau/core/engine/device/nv50.c
index 04b2d75f464388fffda0c791bf8ca8d509343db7..5e8c3de75593d04390f4e95964363d86ffb1551d 100644 (file)
@@ -22,7 +22,6 @@
  * Authors: Ben Skeggs
  */
 
-#include <subdev/device.h>
 #include <subdev/bios.h>
 #include <subdev/bus.h>
 #include <subdev/gpio.h>
@@ -38,6 +37,7 @@
 #include <subdev/vm.h>
 #include <subdev/bar.h>
 
+#include <engine/device.h>
 #include <engine/dmaobj.h>
 #include <engine/fifo.h>
 #include <engine/software.h>
similarity index 99%
rename from drivers/gpu/drm/nouveau/core/subdev/device/nvc0.c
rename to drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
index 00f869ee53e36878b4ec9f72d82eb3fa852ef504..955af122c3a68dc06eb0cea0360e746447416966 100644 (file)
@@ -22,7 +22,6 @@
  * Authors: Ben Skeggs
  */
 
-#include <subdev/device.h>
 #include <subdev/bios.h>
 #include <subdev/bus.h>
 #include <subdev/gpio.h>
@@ -40,6 +39,7 @@
 #include <subdev/vm.h>
 #include <subdev/bar.h>
 
+#include <engine/device.h>
 #include <engine/dmaobj.h>
 #include <engine/fifo.h>
 #include <engine/software.h>
similarity index 99%
rename from drivers/gpu/drm/nouveau/core/subdev/device/nve0.c
rename to drivers/gpu/drm/nouveau/core/engine/device/nve0.c
index 5c12391619fd309f2be79641d709c9757d18ba1d..e6a77944f43b0b05e8bbffe4a69d76f3441f53fd 100644 (file)
@@ -22,7 +22,6 @@
  * Authors: Ben Skeggs
  */
 
-#include <subdev/device.h>
 #include <subdev/bios.h>
 #include <subdev/bus.h>
 #include <subdev/gpio.h>
@@ -40,6 +39,7 @@
 #include <subdev/vm.h>
 #include <subdev/bar.h>
 
+#include <engine/device.h>
 #include <engine/dmaobj.h>
 #include <engine/fifo.h>
 #include <engine/software.h>
index d351a4e5819cda1d5f7b9a204a7347a89e209648..05840f3eee985ca8b261601b1a6154305ce31617 100644 (file)
@@ -6,7 +6,7 @@
 #include <core/engine.h>
 
 enum nv_subdev_type {
-       NVDEV_SUBDEV_DEVICE,
+       NVDEV_ENGINE_DEVICE,
        NVDEV_SUBDEV_VBIOS,
 
        /* All subdevs from DEVINIT to DEVINIT_LAST will be created before
@@ -57,7 +57,7 @@ enum nv_subdev_type {
 };
 
 struct nouveau_device {
-       struct nouveau_subdev base;
+       struct nouveau_engine base;
        struct list_head head;
 
        struct pci_dev *pdev;
@@ -99,7 +99,7 @@ nv_device(void *obj)
 
 #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA
        if (unlikely(!nv_iclass(device, NV_SUBDEV_CLASS) ||
-                    (nv_hclass(device) & 0xff) != NVDEV_SUBDEV_DEVICE)) {
+                    (nv_hclass(device) & 0xff) != NVDEV_ENGINE_DEVICE)) {
                nv_assert("BAD CAST -> NvDevice, 0x%08x 0x%08x",
                          nv_hclass(object), nv_hclass(device));
        }
index 994574ff8d8985cff8a7046e048e2b8337acb23e..c33b13fb18db08f25565753b46ebc6b1420d30f4 100644 (file)
 #include <core/gpuobj.h>
 #include <core/class.h>
 
-#include <subdev/device.h>
-#include <subdev/vm.h>
-
+#include <engine/device.h>
 #include <engine/disp.h>
 
+#include <subdev/vm.h>
+
 #include "nouveau_drm.h"
 #include "nouveau_dma.h"
 #include "nouveau_ttm.h"