Commit dded35de authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/device: convert to engine, rather than subdev

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 2ecda48b
...@@ -53,15 +53,6 @@ nouveau-y += core/subdev/clock/nva3.o ...@@ -53,15 +53,6 @@ nouveau-y += core/subdev/clock/nva3.o
nouveau-y += core/subdev/clock/nvc0.o nouveau-y += core/subdev/clock/nvc0.o
nouveau-y += core/subdev/clock/pllnv04.o nouveau-y += core/subdev/clock/pllnv04.o
nouveau-y += core/subdev/clock/pllnva3.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/base.o
nouveau-y += core/subdev/devinit/nv04.o nouveau-y += core/subdev/devinit/nv04.o
nouveau-y += core/subdev/devinit/nv05.o nouveau-y += core/subdev/devinit/nv05.o
...@@ -151,6 +142,15 @@ nouveau-y += core/engine/copy/nvc0.o ...@@ -151,6 +142,15 @@ nouveau-y += core/engine/copy/nvc0.o
nouveau-y += core/engine/copy/nve0.o nouveau-y += core/engine/copy/nve0.o
nouveau-y += core/engine/crypt/nv84.o nouveau-y += core/engine/crypt/nv84.o
nouveau-y += core/engine/crypt/nv98.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/base.o
nouveau-y += core/engine/disp/nv04.o nouveau-y += core/engine/disp/nv04.o
nouveau-y += core/engine/disp/nv50.o nouveau-y += core/engine/disp/nv50.o
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <core/handle.h> #include <core/handle.h>
#include <core/option.h> #include <core/option.h>
#include <subdev/device.h> #include <engine/device.h>
static void static void
nouveau_client_dtor(struct nouveau_object *object) nouveau_client_dtor(struct nouveau_object *object)
......
...@@ -33,7 +33,6 @@ nouveau_engine_create_(struct nouveau_object *parent, ...@@ -33,7 +33,6 @@ nouveau_engine_create_(struct nouveau_object *parent,
const char *iname, const char *fname, const char *iname, const char *fname,
int length, void **pobject) int length, void **pobject)
{ {
struct nouveau_device *device = nv_device(parent);
struct nouveau_engine *engine; struct nouveau_engine *engine;
int ret; int ret;
...@@ -43,7 +42,8 @@ nouveau_engine_create_(struct nouveau_object *parent, ...@@ -43,7 +42,8 @@ nouveau_engine_create_(struct nouveau_object *parent,
if (ret) if (ret)
return ret; return ret;
if (!nouveau_boolopt(device->cfgopt, iname, enable)) { if ( parent &&
!nouveau_boolopt(nv_device(parent)->cfgopt, iname, enable)) {
if (!enable) if (!enable)
nv_warn(engine, "disabled, %s=1 to enable\n", iname); nv_warn(engine, "disabled, %s=1 to enable\n", iname);
return -ENODEV; return -ENODEV;
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <core/class.h> #include <core/class.h>
#include <subdev/device.h> #include <engine/device.h>
static DEFINE_MUTEX(nv_devices_mutex); static DEFINE_MUTEX(nv_devices_mutex);
static LIST_HEAD(nv_devices); static LIST_HEAD(nv_devices);
...@@ -428,15 +428,15 @@ nouveau_device_dtor(struct nouveau_object *object) ...@@ -428,15 +428,15 @@ nouveau_device_dtor(struct nouveau_object *object)
list_del(&device->head); list_del(&device->head);
mutex_unlock(&nv_devices_mutex); mutex_unlock(&nv_devices_mutex);
if (device->base.mmio) if (nv_subdev(device)->mmio)
iounmap(device->base.mmio); iounmap(nv_subdev(device)->mmio);
nouveau_subdev_destroy(&device->base); nouveau_engine_destroy(&device->base);
} }
static struct nouveau_oclass static struct nouveau_oclass
nouveau_device_oclass = { nouveau_device_oclass = {
.handle = NV_SUBDEV(DEVICE, 0x00), .handle = NV_ENGINE(DEVICE, 0x00),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nouveau_ofuncs) {
.dtor = nouveau_device_dtor, .dtor = nouveau_device_dtor,
}, },
...@@ -456,7 +456,7 @@ nouveau_device_create_(struct pci_dev *pdev, u64 name, const char *sname, ...@@ -456,7 +456,7 @@ nouveau_device_create_(struct pci_dev *pdev, u64 name, const char *sname,
goto done; 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", "device", length, pobject);
device = *pobject; device = *pobject;
if (ret) if (ret)
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/device.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
#include <subdev/i2c.h> #include <subdev/i2c.h>
...@@ -34,6 +33,7 @@ ...@@ -34,6 +33,7 @@
#include <subdev/instmem.h> #include <subdev/instmem.h>
#include <subdev/vm.h> #include <subdev/vm.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/software.h> #include <engine/software.h>
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/device.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
#include <subdev/gpio.h> #include <subdev/gpio.h>
...@@ -35,6 +34,7 @@ ...@@ -35,6 +34,7 @@
#include <subdev/instmem.h> #include <subdev/instmem.h>
#include <subdev/vm.h> #include <subdev/vm.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/software.h> #include <engine/software.h>
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/device.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
#include <subdev/gpio.h> #include <subdev/gpio.h>
...@@ -36,6 +35,7 @@ ...@@ -36,6 +35,7 @@
#include <subdev/instmem.h> #include <subdev/instmem.h>
#include <subdev/vm.h> #include <subdev/vm.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/software.h> #include <engine/software.h>
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/device.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
#include <subdev/gpio.h> #include <subdev/gpio.h>
...@@ -35,6 +34,7 @@ ...@@ -35,6 +34,7 @@
#include <subdev/instmem.h> #include <subdev/instmem.h>
#include <subdev/vm.h> #include <subdev/vm.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/software.h> #include <engine/software.h>
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/device.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
#include <subdev/vm.h> #include <subdev/vm.h>
...@@ -37,6 +36,7 @@ ...@@ -37,6 +36,7 @@
#include <subdev/instmem.h> #include <subdev/instmem.h>
#include <subdev/vm.h> #include <subdev/vm.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/software.h> #include <engine/software.h>
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/device.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
#include <subdev/gpio.h> #include <subdev/gpio.h>
...@@ -38,6 +37,7 @@ ...@@ -38,6 +37,7 @@
#include <subdev/vm.h> #include <subdev/vm.h>
#include <subdev/bar.h> #include <subdev/bar.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/software.h> #include <engine/software.h>
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/device.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
#include <subdev/gpio.h> #include <subdev/gpio.h>
...@@ -40,6 +39,7 @@ ...@@ -40,6 +39,7 @@
#include <subdev/vm.h> #include <subdev/vm.h>
#include <subdev/bar.h> #include <subdev/bar.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/software.h> #include <engine/software.h>
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/device.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bus.h> #include <subdev/bus.h>
#include <subdev/gpio.h> #include <subdev/gpio.h>
...@@ -40,6 +39,7 @@ ...@@ -40,6 +39,7 @@
#include <subdev/vm.h> #include <subdev/vm.h>
#include <subdev/bar.h> #include <subdev/bar.h>
#include <engine/device.h>
#include <engine/dmaobj.h> #include <engine/dmaobj.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/software.h> #include <engine/software.h>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <core/engine.h> #include <core/engine.h>
enum nv_subdev_type { enum nv_subdev_type {
NVDEV_SUBDEV_DEVICE, NVDEV_ENGINE_DEVICE,
NVDEV_SUBDEV_VBIOS, NVDEV_SUBDEV_VBIOS,
/* All subdevs from DEVINIT to DEVINIT_LAST will be created before /* All subdevs from DEVINIT to DEVINIT_LAST will be created before
...@@ -57,7 +57,7 @@ enum nv_subdev_type { ...@@ -57,7 +57,7 @@ enum nv_subdev_type {
}; };
struct nouveau_device { struct nouveau_device {
struct nouveau_subdev base; struct nouveau_engine base;
struct list_head head; struct list_head head;
struct pci_dev *pdev; struct pci_dev *pdev;
...@@ -99,7 +99,7 @@ nv_device(void *obj) ...@@ -99,7 +99,7 @@ nv_device(void *obj)
#if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA #if CONFIG_NOUVEAU_DEBUG >= NV_DBG_PARANOIA
if (unlikely(!nv_iclass(device, NV_SUBDEV_CLASS) || 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_assert("BAD CAST -> NvDevice, 0x%08x 0x%08x",
nv_hclass(object), nv_hclass(device)); nv_hclass(object), nv_hclass(device));
} }
......
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
#include <core/gpuobj.h> #include <core/gpuobj.h>
#include <core/class.h> #include <core/class.h>
#include <subdev/device.h> #include <engine/device.h>
#include <subdev/vm.h>
#include <engine/disp.h> #include <engine/disp.h>
#include <subdev/vm.h>
#include "nouveau_drm.h" #include "nouveau_drm.h"
#include "nouveau_dma.h" #include "nouveau_dma.h"
#include "nouveau_ttm.h" #include "nouveau_ttm.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment