dev->driver->context_ctor(dev, ctx.handle);
if (!dev->driver->context_ctor(dev, ctx.handle)) { DRM_DEBUG( "Running out of ctxs or memory.\n"); return -ENOMEM; }
int drm_addctx(struct inode *inode, struct file *filp,	       unsigned int cmd, unsigned long arg){	drm_file_t *priv = filp->private_data;	drm_device_t *dev = priv->head->dev;	drm_ctx_list_t *ctx_entry;	drm_ctx_t __user *argp = (void __user *)arg;	drm_ctx_t ctx;	if (copy_from_user(&ctx, argp, sizeof(ctx)))		return -EFAULT;	ctx.handle = drm_ctxbitmap_next(dev);	if (ctx.handle == DRM_KERNEL_CONTEXT) {		/* Skip kernel's context and get a new one. */		ctx.handle = drm_ctxbitmap_next(dev);	}	DRM_DEBUG("%d\n", ctx.handle);	if (ctx.handle == -1) {		DRM_DEBUG("Not enough free contexts.\n");		/* Should this return -EBUSY instead? */		return -ENOMEM;	}	if (ctx.handle != DRM_KERNEL_CONTEXT) {		if (dev->driver->context_ctor)			dev->driver->context_ctor(dev, ctx.handle);	}	ctx_entry = drm_alloc(sizeof(*ctx_entry), DRM_MEM_CTXLIST);	if (!ctx_entry) {		DRM_DEBUG("out of memory\n");		return -ENOMEM;	}	INIT_LIST_HEAD(&ctx_entry->head);	ctx_entry->handle = ctx.handle;	ctx_entry->tag = priv;	down(&dev->ctxlist_sem);	list_add(&ctx_entry->head, &dev->ctxlist->head);	++dev->ctx_count;	up(&dev->ctxlist_sem);	if (copy_to_user(argp, &ctx, sizeof(ctx)))		return -EFAULT;	return 0;}