summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_state.c
diff options
context:
space:
mode:
authorBen Skeggs2011-06-03 02:07:08 +0200
committerBen Skeggs2011-06-23 07:58:46 +0200
commitfe32b16e7998bae28209834c0f7c21766d7524ec (patch)
treef018bd86a2bfd565e0d126eaca5d63e2ab823981 /drivers/gpu/drm/nouveau/nouveau_state.c
parentdrm/nv50-nvc0/vm: don't touch chan_vm (diff)
downloadkernel-qcow2-linux-fe32b16e7998bae28209834c0f7c21766d7524ec.tar.gz
kernel-qcow2-linux-fe32b16e7998bae28209834c0f7c21766d7524ec.tar.xz
kernel-qcow2-linux-fe32b16e7998bae28209834c0f7c21766d7524ec.zip
drm/nv50-nvc0/vm: take client reference on shared channel vm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_state.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_state.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
index b38b28066836..12b34710a76f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -767,6 +767,7 @@ static void nouveau_card_takedown(struct drm_device *dev)
int
nouveau_open(struct drm_device *dev, struct drm_file *file_priv)
{
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_fpriv *fpriv;
fpriv = kzalloc(sizeof(*fpriv), GFP_KERNEL);
@@ -776,6 +777,9 @@ nouveau_open(struct drm_device *dev, struct drm_file *file_priv)
spin_lock_init(&fpriv->lock);
INIT_LIST_HEAD(&fpriv->channels);
+ if (dev_priv->card_type >= NV_50)
+ nouveau_vm_ref(dev_priv->chan_vm, &fpriv->vm, NULL);
+
file_priv->driver_priv = fpriv;
return 0;
}
@@ -791,6 +795,7 @@ void
nouveau_postclose(struct drm_device *dev, struct drm_file *file_priv)
{
struct nouveau_fpriv *fpriv = nouveau_fpriv(file_priv);
+ nouveau_vm_ref(NULL, &fpriv->vm, NULL);
kfree(fpriv);
}