aboutsummaryrefslogtreecommitdiff
path: root/linux/mga_context.c
diff options
context:
space:
mode:
authorJeff Hartmann <jhartmann@valinux.com>2000-09-27 21:32:19 +0000
committerJeff Hartmann <jhartmann@valinux.com>2000-09-27 21:32:19 +0000
commit550dff98b0cf08687cdde697fc6909aeb9cef30f (patch)
tree9e5eb8724c64891cd1da1239b8798f16a167d19c /linux/mga_context.c
parentdbe7d55cb08487f688dfbdd29835500b3b087721 (diff)
Merged the mga-lock-debug-0-2-0-branch with the trunk. This includes
several fixes including: (Jeff) Really disable multitexture (Broken since Mesa 3.4 integration.) (Jeff) Various changes in mga_state.c in the kernel module, which includes a fix to the bug where the first OGL application hangs the machine w/out rendering anything. This also includes defines for the warp registers so they are easily human readable. (Rik and Jeff) Fixed all the schedule loops in the kernel to look like they are supposed too. (Jeff) Configurable agp modes: Add the option "AGPMode2x" or "AGPMode4x" to your XF86Config file. (Rik) Various cleanups to the mga kernel driver to make it easier to read and debug. (Rik) Removed alot of DRM_DEBUG statements from the kernel driver.
Diffstat (limited to 'linux/mga_context.c')
-rw-r--r--linux/mga_context.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/linux/mga_context.c b/linux/mga_context.c
index 36f23420..1494d5d6 100644
--- a/linux/mga_context.c
+++ b/linux/mga_context.c
@@ -36,9 +36,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)
@@ -103,7 +101,6 @@ int mga_resctx(struct inode *inode, struct file *filp, unsigned int cmd,
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) {
@@ -136,8 +133,6 @@ int mga_addctx(struct inode *inode, struct file *filp, unsigned int cmd,
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);
@@ -205,6 +200,10 @@ int mga_rmctx(struct inode *inode, struct file *filp, unsigned int cmd,
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);
}