diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-08-09 22:10:24 +0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-08-09 23:13:21 +0400 |
commit | 586491e6fc27f1783081955fd26d70789ddb3a07 (patch) | |
tree | 6a17f58b88e0c4e723f94f38225bf8b9252c38ba /drivers/gpu/drm/nouveau/nouveau_drm.c | |
parent | aedf43d5fc0e6b0f5902e00603881869ef733d05 (diff) | |
download | linux-586491e6fc27f1783081955fd26d70789ddb3a07.tar.xz |
drm/nouveau/device: audit and version NV_DEVICE class
The full object interfaces are about to be exposed to userspace, so we
need to check for any security-related issues and version the structs
to make it easier to handle any changes we may need in the future.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drm.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drm.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 9d0ad53b99d6..f9f2e0efd07c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -383,18 +383,18 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) * (possibly) execute vbios init tables (see nouveau_agp.h) */ if (pdev && drm_pci_device_is_agp(dev) && dev->agp) { + const u64 enables = NV_DEVICE_V0_DISABLE_IDENTIFY | + NV_DEVICE_V0_DISABLE_MMIO; /* dummy device object, doesn't init anything, but allows * agp code access to registers */ ret = nvif_device_init(&drm->client.base.base, NULL, - NVDRM_DEVICE, NV_DEVICE_CLASS, - &(struct nv_device_class) { + NVDRM_DEVICE, NV_DEVICE, + &(struct nv_device_v0) { .device = ~0, - .disable = - ~(NV_DEVICE_DISABLE_MMIO | - NV_DEVICE_DISABLE_IDENTIFY), + .disable = ~enables, .debug0 = ~0, - }, sizeof(struct nv_device_class), + }, sizeof(struct nv_device_v0), &drm->device); if (ret) goto fail_device; @@ -404,12 +404,12 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) } ret = nvif_device_init(&drm->client.base.base, NULL, NVDRM_DEVICE, - NV_DEVICE_CLASS, - &(struct nv_device_class) { + NV_DEVICE, + &(struct nv_device_v0) { .device = ~0, .disable = 0, .debug0 = 0, - }, sizeof(struct nv_device_class), + }, sizeof(struct nv_device_v0), &drm->device); if (ret) goto fail_device; |