patch-2.4.0-test9 linux/drivers/char/drm/mga_context.c

Next file: linux/drivers/char/drm/mga_dma.c
Previous file: linux/drivers/char/drm/mga_bufs.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test8/linux/drivers/char/drm/mga_context.c linux/drivers/char/drm/mga_context.c
@@ -35,9 +35,7 @@
 
 static int mga_alloc_queue(drm_device_t *dev)
 {
-   	int temp = drm_ctxbitmap_next(dev);
-   	DRM_DEBUG("mga_alloc_queue: %d\n", temp);
-	return temp;
+   	return drm_ctxbitmap_next(dev);
 }
 
 int mga_context_switch(drm_device_t *dev, int old, int new)
@@ -102,7 +100,6 @@
 	drm_ctx_t	ctx;
 	int		i;
 
-	DRM_DEBUG("%d\n", DRM_RESERVED_CONTEXTS);
 	if (copy_from_user(&res, (drm_ctx_res_t *)arg, sizeof(res)))
 		return -EFAULT;
 	if (res.count >= DRM_RESERVED_CONTEXTS) {
@@ -135,8 +132,6 @@
 		ctx.handle = mga_alloc_queue(dev);
 	}
         if (ctx.handle == -1) {
-		DRM_DEBUG("Not enough free contexts.\n");
-				/* Should this return -EBUSY instead? */
 		return -ENOMEM;
 	}
 	DRM_DEBUG("%d\n", ctx.handle);
@@ -204,6 +199,8 @@
 	if (copy_from_user(&ctx, (drm_ctx_t *)arg, sizeof(ctx)))
 		return -EFAULT;
 	DRM_DEBUG("%d\n", ctx.handle);
+	if(ctx.handle == DRM_KERNEL_CONTEXT+1) priv->remove_auth_on_close = 1;
+
       	if(ctx.handle != DRM_KERNEL_CONTEXT) {
 	   	drm_ctxbitmap_free(dev, ctx.handle);
 	}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)