summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/include/nvkm
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2015-08-20 14:54:05 +1000
committerBen Skeggs <bskeggs@redhat.com>2015-08-28 12:40:06 +1000
commitd351b8569e3c57bf5dc3dd5a1295974a9e04316e (patch)
tree37bee5277efff81600a6457c758da1bdae6fb23b /drivers/gpu/drm/nouveau/include/nvkm
parent0d5dd3f301bbc66c41b219f50fa97a6df1965cfe (diff)
drm/nouveau/subdev: add direct pointer to nvkm_device
Will be utilised in upcoming commits to remove the need for heuristics to lookup the device a subdev belongs to. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/include/nvkm')
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/device.h3
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h
index 333db33a162c..5983b307e127 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h
@@ -49,9 +49,8 @@ int nvkm_device_list(u64 *name, int size);
struct nvkm_device *nv_device(void *obj);
static inline bool
-nv_device_match(struct nvkm_object *object, u16 dev, u16 ven, u16 sub)
+nv_device_match(struct nvkm_device *device, u16 dev, u16 ven, u16 sub)
{
- struct nvkm_device *device = nv_device(object);
return device->pdev->device == dev &&
device->pdev->subsystem_vendor == ven &&
device->pdev->subsystem_device == sub;
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h b/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h
index 6fdc39116aac..8357319f5a14 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h
@@ -8,6 +8,9 @@
struct nvkm_subdev {
struct nvkm_object object;
+
+ struct nvkm_device *device;
+
struct mutex mutex;
const char *name;
void __iomem *mmio;