Skip to contentSkip to conversation

nouveau: fix channel closing

PATCH In review Marcin Slusarz 2 participants 2 messages May 1, 2012 – May 2, 2012 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nouveau: fix channel closing

Restore code lost in libdrm_nouveau rewrite.

---
 nouveau/nouveau.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)
nouveau/nouveau.c +12 -5
index f0bc2c3..5aa4107 100644
@@ -278,15 +278,22 @@ nouveau_object_new(struct nouveau_object *parent, uint64_t handle,
 void
 nouveau_object_del(struct nouveau_object **pobj)
 {
-	struct drm_nouveau_gpuobj_free req;
 	struct nouveau_object *obj = *pobj;
 	struct nouveau_device *dev;
 	if (obj) {
 		dev = nouveau_object_find(obj, NOUVEAU_DEVICE_CLASS);
-		req.channel = obj->parent->handle;
-		req.handle  = obj->handle;
-		drmCommandWrite(dev->fd, DRM_NOUVEAU_GPUOBJ_FREE,
-				&req, sizeof(req));
+		if (obj->oclass == NOUVEAU_FIFO_CHANNEL_CLASS) {
+			struct drm_nouveau_channel_free req;
+			req.channel = obj->handle;
+			drmCommandWrite(dev->fd, DRM_NOUVEAU_CHANNEL_FREE,
+					&req, sizeof(req));
+		} else {
+			struct drm_nouveau_gpuobj_free req;
+			req.channel = obj->parent->handle;
+			req.handle  = obj->handle;
+			drmCommandWrite(dev->fd, DRM_NOUVEAU_GPUOBJ_FREE,
+					&req, sizeof(req));
+		}
 	}
 	free(obj);
 	*pobj = NULL;
Signature · 1 line
1.7.8.5

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 1 line · Marcin Slusarz

Restore code lost in libdrm_nouveau rewrite.

Thanks, pushed.

Quoted 36 lines
---
 nouveau/nouveau.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)
nouveau/nouveau.c +12 -5
index f0bc2c3..5aa4107 100644
@@ -278,15 +278,22 @@ nouveau_object_new(struct nouveau_object *parent, uint64_t handle,
 void
 nouveau_object_del(struct nouveau_object **pobj)
 {
-	struct drm_nouveau_gpuobj_free req;
 	struct nouveau_object *obj = *pobj;
 	struct nouveau_device *dev;
 	if (obj) {
 		dev = nouveau_object_find(obj, NOUVEAU_DEVICE_CLASS);
-		req.channel = obj->parent->handle;
-		req.handle  = obj->handle;
-		drmCommandWrite(dev->fd, DRM_NOUVEAU_GPUOBJ_FREE,
-				&req, sizeof(req));
+		if (obj->oclass == NOUVEAU_FIFO_CHANNEL_CLASS) {
+			struct drm_nouveau_channel_free req;
+			req.channel = obj->handle;
+			drmCommandWrite(dev->fd, DRM_NOUVEAU_CHANNEL_FREE,
+					&req, sizeof(req));
+		} else {
+			struct drm_nouveau_gpuobj_free req;
+			req.channel = obj->parent->handle;
+			req.handle  = obj->handle;
+			drmCommandWrite(dev->fd, DRM_NOUVEAU_GPUOBJ_FREE,
+					&req, sizeof(req));
+		}
 	}
 	free(obj);
 	*pobj = NULL;