aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Slusarz2012-05-01 16:24:45 -0500
committerBen Skeggs2012-05-02 06:21:09 -0500
commit5288729823ee1c243023758c35fbe8e3a70ccf9c (patch)
treedea09cdf405f5a36fbf3609cf0217184d84325ad /nouveau
parent754655c795fff1c6267d358e54ad5198aee0cdd6 (diff)
downloadlibdrm-5288729823ee1c243023758c35fbe8e3a70ccf9c.tar.gz
libdrm-5288729823ee1c243023758c35fbe8e3a70ccf9c.tar.xz
libdrm-5288729823ee1c243023758c35fbe8e3a70ccf9c.zip
nouveau: fix channel closing
Restore code lost in libdrm_nouveau rewrite. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'nouveau')
-rw-r--r--nouveau/nouveau.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c
index f0bc2c3f..5aa41070 100644
--- a/nouveau/nouveau.c
+++ b/nouveau/nouveau.c
@@ -278,15 +278,22 @@ nouveau_object_new(struct nouveau_object *parent, uint64_t handle,
278void 278void
279nouveau_object_del(struct nouveau_object **pobj) 279nouveau_object_del(struct nouveau_object **pobj)
280{ 280{
281 struct drm_nouveau_gpuobj_free req;
282 struct nouveau_object *obj = *pobj; 281 struct nouveau_object *obj = *pobj;
283 struct nouveau_device *dev; 282 struct nouveau_device *dev;
284 if (obj) { 283 if (obj) {
285 dev = nouveau_object_find(obj, NOUVEAU_DEVICE_CLASS); 284 dev = nouveau_object_find(obj, NOUVEAU_DEVICE_CLASS);
286 req.channel = obj->parent->handle; 285 if (obj->oclass == NOUVEAU_FIFO_CHANNEL_CLASS) {
287 req.handle = obj->handle; 286 struct drm_nouveau_channel_free req;
288 drmCommandWrite(dev->fd, DRM_NOUVEAU_GPUOBJ_FREE, 287 req.channel = obj->handle;
289 &req, sizeof(req)); 288 drmCommandWrite(dev->fd, DRM_NOUVEAU_CHANNEL_FREE,
289 &req, sizeof(req));
290 } else {
291 struct drm_nouveau_gpuobj_free req;
292 req.channel = obj->parent->handle;
293 req.handle = obj->handle;
294 drmCommandWrite(dev->fd, DRM_NOUVEAU_GPUOBJ_FREE,
295 &req, sizeof(req));
296 }
290 } 297 }
291 free(obj); 298 free(obj);
292 *pobj = NULL; 299 *pobj = NULL;