summaryrefslogtreecommitdiff
path: root/linux-core/r128_drv.c
diff options
context:
space:
mode:
authorRik Faith <faith@alephnull.com>2000-07-19 18:38:41 +0000
committerRik Faith <faith@alephnull.com>2000-07-19 18:38:41 +0000
commitaed8549e91ade1582505ebce50e4a79d99b4436f (patch)
tree75fae913a2327facdbd944b373a7e9ebe4ec9c8c /linux-core/r128_drv.c
parent7b888f87fa5ec559df97a7e911dd5a3328895f6f (diff)
Sync with Linux 2.4.0-test4 kernel
Diffstat (limited to 'linux-core/r128_drv.c')
-rw-r--r--linux-core/r128_drv.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/linux-core/r128_drv.c b/linux-core/r128_drv.c
index 8b669888..54c6e473 100644
--- a/linux-core/r128_drv.c
+++ b/linux-core/r128_drv.c
@@ -47,6 +47,10 @@ static drm_device_t r128_device;
drm_ctx_t r128_res_ctx;
static struct file_operations r128_fops = {
+#if LINUX_VERSION_CODE >= 0x020322
+ /* This started being used approx. 2.3.34 */
+ owner: THIS_MODULE,
+#endif
open: r128_open,
flush: drm_flush,
release: r128_release,
@@ -369,6 +373,13 @@ int r128_init(void)
#ifdef DRM_AGP
dev->agp = drm_agp_init();
+ if (dev->agp == NULL) {
+ DRM_ERROR("Cannot initialize agpgart module.\n");
+ drm_proc_cleanup();
+ misc_deregister(&r128_misc);
+ r128_takedown(dev);
+ return -ENOMEM;
+ }
#ifdef CONFIG_MTRR
dev->agp->agp_mtrr = mtrr_add(dev->agp->agp_info.aper_base,
@@ -664,19 +675,11 @@ int r128_lock(struct inode *inode, struct file *filp, unsigned int cmd,
}
}
-#if 0
- DRM_ERROR("pid = %5d, old counter = %5ld\n",
- current->pid, current->counter);
-#endif
+#if LINUX_VERSION_CODE < 0x020400
if (lock.context != r128_res_ctx.handle) {
current->counter = 5;
current->priority = DEF_PRIORITY/4;
}
-#if 0
- while (current->counter > 25)
- current->counter >>= 1; /* decrease time slice */
- DRM_ERROR("pid = %5d, new counter = %5ld\n",
- current->pid, current->counter);
#endif
DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock");
@@ -718,19 +721,11 @@ int r128_unlock(struct inode *inode, struct file *filp, unsigned int cmd,
}
}
-#if 0
- current->policy |= SCHED_YIELD;
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(1000);
-#endif
-
+#if LINUX_VERSION_CODE < 0x020400
if (lock.context != r128_res_ctx.handle) {
current->counter = 5;
current->priority = DEF_PRIORITY;
}
-#if 0
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(10);
#endif
return 0;