diff options
| author | Ben Skeggs <bskeggs@redhat.com> | 2013-04-25 03:56:03 -0400 |
|---|---|---|
| committer | Ben Skeggs <bskeggs@redhat.com> | 2013-04-26 01:38:11 -0400 |
| commit | 9aecbada751e6343e47cbefade718e571a8ecbbc (patch) | |
| tree | 60ae7fc1d6d2f25bf1d84ba81a0346b9879deea3 | |
| parent | dded35dee323e286ef444f148abaf88adb58d4f3 (diff) | |
drm/nouveau/device: have engine object initialised before creation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/core/client.c | 5 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/core/parent.c | 8 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/device/base.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/include/engine/device.h | 1 |
4 files changed, 12 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/core/core/client.c b/drivers/gpu/drm/nouveau/core/core/client.c index 2be389d72f52..9079c0ac58e6 100644 --- a/drivers/gpu/drm/nouveau/core/core/client.c +++ b/drivers/gpu/drm/nouveau/core/core/client.c | |||
| @@ -58,8 +58,9 @@ nouveau_client_create_(const char *name, u64 devname, const char *cfg, | |||
| 58 | return -ENODEV; | 58 | return -ENODEV; |
| 59 | 59 | ||
| 60 | ret = nouveau_namedb_create_(NULL, NULL, &nouveau_client_oclass, | 60 | ret = nouveau_namedb_create_(NULL, NULL, &nouveau_client_oclass, |
| 61 | NV_CLIENT_CLASS, nouveau_device_sclass, | 61 | NV_CLIENT_CLASS, NULL, |
| 62 | 0, length, pobject); | 62 | (1ULL << NVDEV_ENGINE_DEVICE), |
| 63 | length, pobject); | ||
| 63 | client = *pobject; | 64 | client = *pobject; |
| 64 | if (ret) | 65 | if (ret) |
| 65 | return ret; | 66 | return ret; |
diff --git a/drivers/gpu/drm/nouveau/core/core/parent.c b/drivers/gpu/drm/nouveau/core/core/parent.c index db7c54943102..313380ce632d 100644 --- a/drivers/gpu/drm/nouveau/core/core/parent.c +++ b/drivers/gpu/drm/nouveau/core/core/parent.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | #include <core/object.h> | 25 | #include <core/object.h> |
| 26 | #include <core/parent.h> | 26 | #include <core/parent.h> |
| 27 | #include <core/client.h> | ||
| 27 | 28 | ||
| 28 | int | 29 | int |
| 29 | nouveau_parent_sclass(struct nouveau_object *parent, u16 handle, | 30 | nouveau_parent_sclass(struct nouveau_object *parent, u16 handle, |
| @@ -50,7 +51,12 @@ nouveau_parent_sclass(struct nouveau_object *parent, u16 handle, | |||
| 50 | while (mask) { | 51 | while (mask) { |
| 51 | int i = ffsll(mask) - 1; | 52 | int i = ffsll(mask) - 1; |
| 52 | 53 | ||
| 53 | if ((engine = nouveau_engine(parent, i))) { | 54 | if (nv_iclass(parent, NV_CLIENT_CLASS)) |
| 55 | engine = nv_engine(nv_client(parent)->device); | ||
| 56 | else | ||
| 57 | engine = nouveau_engine(parent, i); | ||
| 58 | |||
| 59 | if (engine) { | ||
| 54 | oclass = engine->sclass; | 60 | oclass = engine->sclass; |
| 55 | while (oclass->ofuncs) { | 61 | while (oclass->ofuncs) { |
| 56 | if ((oclass->handle & 0xffff) == handle) { | 62 | if ((oclass->handle & 0xffff) == handle) { |
diff --git a/drivers/gpu/drm/nouveau/core/engine/device/base.c b/drivers/gpu/drm/nouveau/core/engine/device/base.c index 35616424f559..30723ee8114c 100644 --- a/drivers/gpu/drm/nouveau/core/engine/device/base.c +++ b/drivers/gpu/drm/nouveau/core/engine/device/base.c | |||
| @@ -413,7 +413,7 @@ nouveau_devobj_ofuncs = { | |||
| 413 | /****************************************************************************** | 413 | /****************************************************************************** |
| 414 | * nouveau_device: engine functions | 414 | * nouveau_device: engine functions |
| 415 | *****************************************************************************/ | 415 | *****************************************************************************/ |
| 416 | struct nouveau_oclass | 416 | static struct nouveau_oclass |
| 417 | nouveau_device_sclass[] = { | 417 | nouveau_device_sclass[] = { |
| 418 | { 0x0080, &nouveau_devobj_ofuncs }, | 418 | { 0x0080, &nouveau_devobj_ofuncs }, |
| 419 | {} | 419 | {} |
| @@ -470,6 +470,7 @@ nouveau_device_create_(struct pci_dev *pdev, u64 name, const char *sname, | |||
| 470 | device->name = sname; | 470 | device->name = sname; |
| 471 | 471 | ||
| 472 | nv_subdev(device)->debug = nouveau_dbgopt(device->dbgopt, "DEVICE"); | 472 | nv_subdev(device)->debug = nouveau_dbgopt(device->dbgopt, "DEVICE"); |
| 473 | nv_engine(device)->sclass = nouveau_device_sclass; | ||
| 473 | list_add(&device->head, &nv_devices); | 474 | list_add(&device->head, &nv_devices); |
| 474 | done: | 475 | done: |
| 475 | mutex_unlock(&nv_devices_mutex); | 476 | mutex_unlock(&nv_devices_mutex); |
diff --git a/drivers/gpu/drm/nouveau/core/include/engine/device.h b/drivers/gpu/drm/nouveau/core/include/engine/device.h index c9e4c4afa50e..b3dd2c4c2f1e 100644 --- a/drivers/gpu/drm/nouveau/core/include/engine/device.h +++ b/drivers/gpu/drm/nouveau/core/include/engine/device.h | |||
| @@ -18,7 +18,6 @@ int nv50_identify(struct nouveau_device *); | |||
| 18 | int nvc0_identify(struct nouveau_device *); | 18 | int nvc0_identify(struct nouveau_device *); |
| 19 | int nve0_identify(struct nouveau_device *); | 19 | int nve0_identify(struct nouveau_device *); |
| 20 | 20 | ||
| 21 | extern struct nouveau_oclass nouveau_device_sclass[]; | ||
| 22 | struct nouveau_device *nouveau_device_find(u64 name); | 21 | struct nouveau_device *nouveau_device_find(u64 name); |
| 23 | 22 | ||
| 24 | #endif | 23 | #endif |
