diff options
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/Makefile.kernel | 94 | ||||
-rw-r--r-- | linux-core/i810_drv.c | 4 | ||||
-rw-r--r-- | linux-core/mga_drv.c | 4 | ||||
-rw-r--r-- | linux-core/r128_drv.c | 31 | ||||
-rw-r--r-- | linux-core/tdfx_drv.c | 24 |
5 files changed, 102 insertions, 55 deletions
diff --git a/linux-core/Makefile.kernel b/linux-core/Makefile.kernel index e262213a..9039da81 100644 --- a/linux-core/Makefile.kernel +++ b/linux-core/Makefile.kernel @@ -9,9 +9,8 @@ # Note 2! The CFLAGS definitions are now inherited from the # parent makes.. # -# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel,v 1.6 2000/06/17 00:03:34 martin Exp $ -L_TARGET := libdrm.a +O_TARGET := drm.o L_OBJS := init.o memory.o proc.o auth.o context.o drawable.o bufs.o \ lists.o lock.o ioctl.o fops.o vm.o dma.o ctxbitmap.o \ @@ -19,35 +18,92 @@ L_OBJS := init.o memory.o proc.o auth.o context.o drawable.o bufs.o \ M_OBJS := -ifdef CONFIG_DRM_GAMMA -M_OBJS += gamma.o +ifeq ($(CONFIG_DRM_GAMMA),y) + OX_OBJS += gamma_drv.o + O_OBJS += gamma_dma.o +else + ifeq ($(CONFIG_DRM_GAMMA),m) + MIX_OBJS += gamma_drv.o + MI_OBJS += gamma_dma.o + M_OBJS += gamma.o + endif endif -ifdef CONFIG_DRM_TDFX -M_OBJS += tdfx.o +ifeq ($(CONFIG_DRM_TDFX),y) + OX_OBJS += tdfx_drv.o + O_OBJS += tdfx_context.o +else + ifeq ($(CONFIG_DRM_TDFX),m) + MIX_OBJS += tdfx_drv.o + MI_OBJS += tdfx_context.o + M_OBJS += tdfx.o + endif endif -ifdef CONFIG_DRM_MGA -M_OBJS += mga.o +ifeq ($(CONFIG_DRM_MGA),y) + OX_OBJS += mga_drv.o + O_OBJS += mga_context.o mga_dma.o mga_bufs.o mga_state.o +else + ifeq ($(CONFIG_DRM_MGA),m) + MIX_OBJS += mga_drv.o + MI_OBJS += mga_context.o mga_dma.o mga_bufs.o mga_state.o + M_OBJS += mga.o + endif endif -ifdef CONFIG_DRM_R128 -M_OBJS += r128.o +ifeq ($(CONFIG_DRM_I810),y) + OX_OBJS += i810_drv.o + O_OBJS += i810_context.o i810_bufs.o i810_dma.o +else + ifeq ($(CONFIG_DRM_I810),m) + MIX_OBJS += i810_drv.o + MI_OBJS += i810_context.o i810_bufs.o i810_dma.o + M_OBJS += i810.o + endif endif +ifeq ($(CONFIG_DRM_R128),y) + OX_OBJS += r128_drv.o + O_OBJS += r128_context.o +else + ifeq ($(CONFIG_DRM_I810),m) + MIX_OBJS += r128_drv.o + MI_OBJS += r128_context.o + M_OBJS += r128.o + endif +endif + +ifeq ($(CONFIG_DRM_FFB),y) + OX_OBJS += ffb_drv.o + O_OBJS += ffb_context.o +else + ifeq ($(CONFIG_DRM_FFB),m) + MIX_OBJC += ffb_drv.o + MI_OBJS += ffb_context.o + M_OBJS += ffb.o + endif +endif + +O_OBJS += $(L_OBJS) + include $(TOPDIR)/Rules.make -gamma.o: gamma_drv.o gamma_dma.o $(L_TARGET) - $(LD) $(LD_RFLAG) -r -o $@ gamma_drv.o gamma_dma.o -L. -ldrm +gamma.o : gamma_drv.o gamma_dma.o $(L_OBJS) + $(LD) $(LD_RFLAG) -r -o $@ gamma_drv.o gamma_dma.o $(L_OBJS) -tdfx.o: tdfx_drv.o tdfx_context.o $(L_TARGET) - $(LD) $(LD_RFLAG) -r -o $@ tdfx_drv.o tdfx_context.o -L. -ldrm +tdfx.o: tdfx_drv.o tdfx_context.o $(L_OBJS) + $(LD) $(LD_RFLAG) -r -o $@ tdfx_drv.o tdfx_context.o $(L_OBJS) -i810.o: i810_drv.o i810_context.o $(L_TARGET) - $(LD) $(LD_RFLAG) -r -o $@ i810_drv.o i810_bufs.o i810_dma.o i810_context.o -L. -ldrm +mga.o: mga_drv.o mga_context.o mga_dma.o mga_bufs.o mga_state.o $(L_OBJS) + $(LD) $(LD_RFLAG) -r -o $@ mga_drv.o mga_bufs.o mga_dma.o \ + mga_context.o mga_state.o $(L_OBJS) -mga.o: mga_drv.o mga_context.o mga_dma.o mga_bufs.o $(L_TARGET) - $(LD) $(LD_RFLAG) -r -o $@ mga_drv.o mga_bufs.o mga_dma.o mga_context.o mga_state.o -L. -ldrm +i810.o: i810_drv.o i810_context.o i810_bufs.o i810_dma.o $(L_TARGET) + $(LD) $(LD_RFLAG) -r -o $@ i810_drv.o i810_bufs.o i810_dma.o \ + i810_context.o $(L_OBJS) r128.o: r128_drv.o r128_context.o $(L_TARGET) - $(LD) $(LD_RFLAG) -r -o $@ r128_drv.o r128_context.o -L. -ldrm + $(LD) $(LD_RFLAG) -r -o $@ r128_drv.o r128_context.o $(L_OBJS) + +ffb.o: ffb_drv.o ffb_context.o $(L_OBJS) + $(LD) $(LD_RFLAG) -r -o $@ ffb_drv.o ffb_context.o $(L_OBJS) diff --git a/linux-core/i810_drv.c b/linux-core/i810_drv.c index d7fa9d88..44b03217 100644 --- a/linux-core/i810_drv.c +++ b/linux-core/i810_drv.c @@ -49,6 +49,10 @@ static drm_device_t i810_device; drm_ctx_t i810_res_ctx; static struct file_operations i810_fops = { +#if LINUX_VERSION_CODE >= 0x020322 + /* This started being used approx. 2.3.34 */ + owner: THIS_MODULE, +#endif open: i810_open, flush: drm_flush, release: i810_release, diff --git a/linux-core/mga_drv.c b/linux-core/mga_drv.c index e77d827b..1cc23fb8 100644 --- a/linux-core/mga_drv.c +++ b/linux-core/mga_drv.c @@ -48,6 +48,10 @@ static drm_device_t mga_device; drm_ctx_t mga_res_ctx; static struct file_operations mga_fops = { +#if LINUX_VERSION_CODE >= 0x020322 + /* This started being used approx. 2.3.34 */ + owner: THIS_MODULE, +#endif open: mga_open, flush: drm_flush, release: mga_release, 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; diff --git a/linux-core/tdfx_drv.c b/linux-core/tdfx_drv.c index 582832b5..e0a31c50 100644 --- a/linux-core/tdfx_drv.c +++ b/linux-core/tdfx_drv.c @@ -48,6 +48,10 @@ static drm_device_t tdfx_device; drm_ctx_t tdfx_res_ctx; static struct file_operations tdfx_fops = { +#if LINUX_VERSION_CODE >= 0x020322 + /* This started being used approx. 2.3.34 */ + owner: THIS_MODULE, +#endif open: tdfx_open, flush: drm_flush, release: tdfx_release, @@ -625,19 +629,11 @@ int tdfx_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 != tdfx_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"); @@ -679,19 +675,11 @@ int tdfx_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 != tdfx_res_ctx.handle) { current->counter = 5; current->priority = DEF_PRIORITY; } -#if 0 - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(10); #endif return 0; |