diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/compote/compote-driver.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/compote/compote-driver.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/compote/compote-driver.c b/drivers/gpu/drm/nouveau/compote/compote-driver.c index 62b4edd1ca7e..002290d5c9f6 100644 --- a/drivers/gpu/drm/nouveau/compote/compote-driver.c +++ b/drivers/gpu/drm/nouveau/compote/compote-driver.c @@ -109,6 +109,8 @@ static int compote_open(struct inode *inode, struct file *file) snprintf(name, sizeof(name), "%s[%d]", tmpname, pid_nr(get_pid(task_pid(current)))); + INIT_LIST_HEAD(&cfile->channels); + init_rwsem(&cfile->rwsem); cfile->cdevice = cdevice; cfile->file = file; @@ -149,6 +151,7 @@ error: static int compote_close(struct inode *inode, struct file *file) { struct compote_file *cfile = file->private_data; + struct compote_channel *channel, *tmp; struct compote_device *cdevice; if(cfile == NULL) @@ -156,6 +159,10 @@ static int compote_close(struct inode *inode, struct file *file) pm_runtime_get_sync(cfile->cdevice->nvdrm->dev->dev); + list_for_each_entry_safe (channel, tmp, &cfile->channels, list) { + compote_channel_unref(channel); + } + compote_client_fini(&cfile->nvclient); cdevice = cfile->cdevice; kfree(cfile); @@ -213,6 +220,12 @@ static long compote_ioctl(struct file *file, case COMPOTE_IOCTL_MEM_FREE: ret = compote_ioctl_mem_free(cfile, uarg); break; + case COMPOTE_IOCTL_CHAN_ALLOC: + ret = compote_ioctl_channel_alloc(cfile, uarg); + break; + case COMPOTE_IOCTL_CHAN_FREE: + ret = compote_ioctl_channel_free(cfile, uarg); + break; default: ret = -EINVAL; break; |