summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nouveau_drv.h
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2017-11-01 03:56:19 +1000
committerBen Skeggs <bskeggs@redhat.com>2017-11-02 13:32:21 +1000
commitcb7e88e70f52878f4be0fbcc04350cff72f67278 (patch)
tree84b9f512876fa08272a6958250cc7898ed28e8d1 /drivers/gpu/drm/nouveau/nouveau_drv.h
parent6be4421a9f5f6d1e980a88e189453cb766744cac (diff)
drm/nouveau: hang drm client of a master
TTM memory allocations will be hanging off the DRM's client, but the locking needed to do so gets really tricky with all the other use of the DRM's object tree. To solve this, we make the normal DRM client a child of a new master, where the memory allocations will be done from instead. This also solves a potential race with client creation. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drv.h')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 84b847042253..610245970c99 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -97,6 +97,8 @@ struct nouveau_cli {
struct list_head objects;
struct list_head notifys;
char name[32];
+
+ struct mutex lock;
};
static inline struct nouveau_cli *
@@ -109,6 +111,7 @@ nouveau_cli(struct drm_file *fpriv)
#include <nvif/device.h>
struct nouveau_drm {
+ struct nouveau_cli master;
struct nouveau_cli client;
struct drm_device *dev;