2.2.18pre21: DRM update
PATCH 1/1 2.2.18pre21: DRM update
This is an update from the main DRM tree, but with cosmetic changes removed and only meat left. This patch is already in VA's shipping kernel, so you know we really trust it. :-,
BTW, this patch is not fluff: It includes bug fixes. But it's pretty big, so if you want to wait until 2.2.19 I'll understand....
Index: drivers/char/Makefile
char/Makefile renamed from char/Makefile.prev +13 -13
@@ -12,5 +12,5 @@ SUB_DIRS := MOD_SUB_DIRS := $(SUB_DIRS) -ALL_SUB_DIRS := $(SUB_DIRS) rio ftape joystick drm agp +ALL_SUB_DIRS := $(SUB_DIRS) rio ftape joystick #
@@ -395,4 +395,16 @@ endif +ifeq ($(CONFIG_DRM),y) +O_OBJS += drm/drm.o +ALL_SUB_DIRS += drm +MOD_SUB_DIRS += drm +SUB_DIRS += drm +else + ifeq ($(CONFIG_DRM),m) + ALL_SUB_DIRS += drm + MOD_SUB_DIRS += drm + endif +endif + ifeq ($(CONFIG_INTEL_RNG),y) O_OBJS += i810_rng.o
@@ -650,16 +662,4 @@ OX_OBJS += h8.o endif - - -ifeq ($(CONFIG_DRM),y) -SUB_DIRS += drm -O_OBJS += drm/drm.o -MOD_SUB_DIRS += drm -else - ifeq ($(CONFIG_DRM),m) - MOD_SUB_DIRS += drm - endif -endif - ifeq ($(L_I2C),y)
Index: drivers/char/drm/drmP.h
char/drm/drmP.h renamed from char/drm/drmP.h.prev +97 -4
144 lines not on this page · raw message
Index: drivers/char/drm/mga_drm.h
char/drm/mga_drm.h renamed from char/drm/mga_drm.h.prev +16 -11
@@ -74,15 +74,17 @@/* 3d state excluding texture units: */ -#define MGA_CTXREG_DSTORG 0/* validated */ -#define MGA_CTXREG_MACCESS 1 -#define MGA_CTXREG_PLNWT 2 -#define MGA_CTXREG_DWGCTL 3 -#define MGA_CTXREG_ALPHACTRL 4 -#define MGA_CTXREG_FOGCOLOR 5 -#define MGA_CTXREG_WFLAG 6 -#define MGA_CTXREG_TDUAL0 7 -#define MGA_CTXREG_TDUAL1 8 -#define MGA_CTXREG_FCOL 9 -#define MGA_CTX_SETUP_SIZE 10 +#define MGA_CTXREG_DSTORG 0/* validated */ +#define MGA_CTXREG_MACCESS 1 +#define MGA_CTXREG_PLNWT 2 +#define MGA_CTXREG_DWGCTL 3 +#define MGA_CTXREG_ALPHACTRL 4 +#define MGA_CTXREG_FOGCOLOR 5 +#define MGA_CTXREG_WFLAG 6 +#define MGA_CTXREG_TDUAL0 7 +#define MGA_CTXREG_TDUAL1 8 +#define MGA_CTXREG_FCOL 9 +#define MGA_CTXREG_STENCIL 10 +#define MGA_CTXREG_STENCILCTL 11 +#define MGA_CTX_SETUP_SIZE 12/* 2d state
@@ -234,4 +236,5 @@*/ int ctxOwner; +int vertexsize; } drm_mga_sarea_t;
@@ -242,4 +245,6 @@unsigned int clear_depth;unsigned int flags; +unsigned int clear_depth_mask; +unsigned int clear_color_mask; } drm_mga_clear_t;
Index: drivers/char/drm/mga_drv.h
char/drm/mga_drv.h renamed from char/drm/mga_drv.h.prev +92 -18
142 lines not on this page · raw message
Index: drivers/char/drm/agpsupport.c
char/drm/agpsupport.c renamed from char/drm/agpsupport.c.prev +17 -2
@@ -288,4 +288,8 @@ drm_agp_head_t *drm_agp_init(void)memset ((void *)head,0 ,sizeof (*head)); (*drm_agp.copy_info)(&head->agp_info); +if (head->agp_info.chipset ==NOT_SUPPORTED ) { +drm_free (head,sizeof (*head),DRM_MEM_AGPLISTS ); +return NULL ; + } head->memory =NULL ;switch (head->agp_info.chipset) {
@@ -295,18 +299,29 @@ drm_agp_head_t *drm_agp_init(void)case INTEL_GX : head->chipset ="Intel 440GX" ;break ;case INTEL_I810 : head->chipset ="Intel i810" ;break ; +#if LINUX_VERSION_CODE >=0x020400 +case INTEL_I840 : head->chipset ="Intel i840" ;break ; +#endif +case VIA_GENERIC : head->chipset ="VIA" ;break ;case VIA_VP3 : head->chipset ="VIA VP3" ;break ;case VIA_MVP3 : head->chipset ="VIA MVP3" ;break ; +#if LINUX_VERSION_CODE >=0x020400 +case VIA_MVP4 : head->chipset ="VIA MVP4" ;break ; +#endif case VIA_APOLLO_PRO : head->chipset ="VIA Apollo Pro" ;break ;case VIA_APOLLO_KX133 : head->chipset ="VIA Apollo KX133" ;break ;case VIA_APOLLO_KT133 : head->chipset ="VIA Apollo KT133" ;break ; +case SIS_GENERIC : head->chipset ="SiS" ;break ; +case AMD_GENERIC : head->chipset ="AMD" ;break ;case AMD_IRONGATE : head->chipset ="AMD Irongate" ;break ; +case ALI_GENERIC : head->chipset ="ALi" ;break ;case ALI_M1541 : head->chipset ="ALi M1541" ;break ; -default : + +default : head->chipset ="Unknown" ;break ; } - DRM_INFO("AGP %d.%d on %s @ 0x%08lx %dMB\n", + DRM_INFO("AGP %d.%d on %s @ 0x%08lx %uMB\n", head->agp_info.version.major, head->agp_info.version.minor,
Index: drivers/char/drm/auth.c
char/drm/auth.c renamed from char/drm/auth.c.prev +2 -2
@@ -127,10 +127,10 @@ int drm_getmagic(struct inode *inode, st auth.magic = priv->magic; }else { -spin_lock (&lock);do { +spin_lock (&lock);if (!sequence) ++sequence;/* reserve 0 */ auth.magic = sequence++; +spin_unlock (&lock); }while (drm_find_file (dev, auth.magic)); -spin_unlock (&lock); priv->magic = auth.magic;drm_add_magic (dev, priv, auth.magic);
Index: drivers/char/drm/dma.c
char/drm/dma.c renamed from char/drm/dma.c.prev +1 -1
@@ -398,8 +398,8 @@ int drm_dma_enqueue(drm_device_t *dev, datomic_inc (&q->use_count);if (atomic_read (&q->block_write)) { - current->state =TASK_INTERRUPTIBLE ;add_wait_queue (&q->write_queue, &entry);atomic_inc (&q->block_count);for (;;) { + current->state =TASK_INTERRUPTIBLE ;if (!atomic_read (&q->block_write))break ;schedule ();
Index: drivers/char/drm/ffb_drv.c
char/drm/ffb_drv.c renamed from char/drm/ffb_drv.c.prev +1 -1
@@ -649,4 +649,5 @@ static int ffb_lock(struct inode *inode,add_wait_queue (&dev->lock.lock_queue, &entry);for (;;) { + current->state =TASK_INTERRUPTIBLE ;if (!dev->lock.hw_lock) {/* Device has been unregistered */
@@ -664,5 +665,4 @@ static int ffb_lock(struct inode *inode,/* Contention */ atomic_inc (&dev->total_sleeps); - current->state =TASK_INTERRUPTIBLE ; current->policy |=SCHED_YIELD ;schedule ();
Index: drivers/char/drm/fops.c
char/drm/fops.c renamed from char/drm/fops.c.prev +0 -6
@@ -216,11 +216,5 @@ int drm_write_string(drm_device_t *dev, } -#if LINUX_VERSION_CODE <0x020400 if (dev->buf_async)kill_fasync (dev->buf_async,SIGIO ,POLL_IN ); -#else -/* Type of first parameter changed in -Linux 2.4.0-test2... */ -if (dev->buf_async)kill_fasync (&dev->buf_async,SIGIO ,POLL_IN ); -#endif DRM_DEBUG ("waking\n" );wake_up_interruptible (&dev->buf_readers);
Index: drivers/char/drm/gamma_dma.c
char/drm/gamma_dma.c renamed from char/drm/gamma_dma.c.prev +2 -2
@@ -543,6 +543,6 @@ static int gamma_dma_send_buffers(drm_deif (d->flags & _DRM_DMA_BLOCK) {DRM_DEBUG ("%d waiting\n" , current->pid); - current->state =TASK_INTERRUPTIBLE ;for (;;) { + current->state =TASK_INTERRUPTIBLE ;if (!last_buf->waiting && !last_buf->pending)
@@ -775,4 +775,5 @@ int gamma_lock(struct inode *inode, struadd_wait_queue (&dev->lock.lock_queue, &entry);for (;;) { + current->state =TASK_INTERRUPTIBLE ;if (!dev->lock.hw_lock) {/* Device has been unregistered */
@@ -791,5 +792,4 @@ int gamma_lock(struct inode *inode, stru/* Contention */ atomic_inc (&dev->total_sleeps); - current->state =TASK_INTERRUPTIBLE ;schedule ();if (signal_pending (current)) {
Index: drivers/char/drm/gamma_drv.c
char/drm/gamma_drv.c renamed from char/drm/gamma_drv.c.prev +2 -2
@@ -58,6 +58,6 @@ static drm_device_t gamma_device;static struct file_operations gamma_fops = { -#if LINUX_VERSION_CODE >= 0x020322 -/* This started being used approx. 2.3.34 */ +#if LINUX_VERSION_CODE >= 0x020400 +/* This started being used during 2.4.0-test */ owner: THIS_MODULE, #endif
Index: drivers/char/drm/i810_dma.c
char/drm/i810_dma.c renamed from char/drm/i810_dma.c.prev +8 -8
@@ -283,6 +283,6 @@ static unsigned long i810_alloc_page(drmreturn 0 ; -atomic_inc (&mem_map[MAP_NR ((void *) address)].count); -set_bit (PG_locked, &mem_map[MAP_NR ((void *) address)].flags); +atomic_inc (&virt_to_page (address)->count); +set_bit (PG_locked, &virt_to_page (address)->flags);return address;
@@ -294,7 +294,7 @@ static void i810_free_page(drm_device_treturn ; -atomic_dec (&mem_map[MAP_NR ((void *) page)].count); -clear_bit (PG_locked, &mem_map[MAP_NR ((void *) page)].flags); -wake_up (&mem_map[MAP_NR ((void *) page)].wait); +atomic_dec (&virt_to_page (page)->count); +clear_bit (PG_locked, &virt_to_page (page)->flags); +wake_up (&virt_to_page (page)->wait);free_page (page);return ;
@@ -1069,9 +1069,9 @@ static void i810_dma_quiescent(drm_devic }atomic_set (&dev_priv->flush_done,0 ); - current->state =TASK_INTERRUPTIBLE ;add_wait_queue (&dev_priv->flush_queue, &entry); end = jiffies + (HZ *3 );for (;;) { + current->state =TASK_INTERRUPTIBLE ;i810_dma_quiescent_emit (dev);if (atomic_read (&dev_priv->flush_done) ==1 )break ;
@@ -1104,8 +1104,8 @@ static int i810_flush_queue(drm_device_t }atomic_set (&dev_priv->flush_done,0 ); - current->state =TASK_INTERRUPTIBLE ;add_wait_queue (&dev_priv->flush_queue, &entry); end = jiffies + (HZ *3 );for (;;) { + current->state =TASK_INTERRUPTIBLE ;i810_dma_emit_flush (dev);if (atomic_read (&dev_priv->flush_done) ==1 )break ;
@@ -1200,4 +1200,5 @@ int i810_lock(struct inode *inode, strucadd_wait_queue (&dev->lock.lock_queue, &entry);for (;;) { + current->state =TASK_INTERRUPTIBLE ;if (!dev->lock.hw_lock) {/* Device has been unregistered */
@@ -1215,5 +1216,4 @@ int i810_lock(struct inode *inode, struc/* Contention */ atomic_inc (&dev->total_sleeps); - current->state =TASK_INTERRUPTIBLE ;DRM_DEBUG ("Calling lock schedule\n" );schedule ();
Index: drivers/char/drm/i810_drv.c
char/drm/i810_drv.c renamed from char/drm/i810_drv.c.prev +1 -1
@@ -515,4 +515,5 @@ int i810_release(struct inode *inode, stadd_wait_queue (&dev->lock.lock_queue, &entry);for (;;) { + current->state =TASK_INTERRUPTIBLE ;if (!dev->lock.hw_lock) {/* Device has been unregistered */
@@ -529,5 +530,4 @@ int i810_release(struct inode *inode, st/* Contention */ atomic_inc (&dev->total_sleeps); - current->state =TASK_INTERRUPTIBLE ;schedule ();if (signal_pending (current)) {
Index: drivers/char/drm/lists.c
char/drm/lists.c renamed from char/drm/lists.c.prev +17 -32
80 lines not on this page · raw message
Index: drivers/char/drm/lock.c
char/drm/lock.c renamed from char/drm/lock.c.prev +1 -1
@@ -129,8 +129,8 @@ static int drm_flush_queue(drm_device_tif (atomic_read (&q->use_count) >1 ) {atomic_inc (&q->block_write); - current->state =TASK_INTERRUPTIBLE ;add_wait_queue (&q->flush_queue, &entry);atomic_inc (&q->block_count);for (;;) { + current->state =TASK_INTERRUPTIBLE ;if (!DRM_BUFCOUNT (&q->waitlist))break ;schedule ();
Index: drivers/char/drm/memory.c
char/drm/memory.c renamed from char/drm/memory.c.prev +11 -0
@@ -33,4 +33,5 @@#include <linux/config.h> #include "drmP.h" +#include <linux/wrapper.h> typedef struct drm_mem_stats {
@@ -247,5 +248,10 @@ unsigned long drm_alloc_pages(int order, sz >0 ; addr += PAGE_SIZE, sz -= PAGE_SIZE) { +#if LINUX_VERSION_CODE >=0x020400 +/* Argument type changed in 2.4.0-test6/pre8 */ +mem_map_reserve (virt_to_page (addr)); +#else mem_map_reserve (MAP_NR (addr)); +#endif }
@@ -268,5 +274,10 @@ void drm_free_pages(unsigned long addres sz >0 ; addr += PAGE_SIZE, sz -= PAGE_SIZE) { +#if LINUX_VERSION_CODE >=0x020400 +/* Argument type changed in 2.4.0-test6/pre8 */ +mem_map_unreserve (virt_to_page (addr)); +#else mem_map_unreserve (MAP_NR (addr)); +#endif }free_pages (address, order);
Index: drivers/char/drm/mga_context.c
char/drm/mga_context.c renamed from char/drm/mga_context.c.prev +4 -0
@@ -196,4 +196,8 @@ int mga_rmctx(struct inode *inode, struccopy_from_user_ret (&ctx, (drm_ctx_t *)arg,sizeof (ctx), -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);
Index: drivers/char/drm/mga_dma.c
char/drm/mga_dma.c renamed from char/drm/mga_dma.c.prev +52 -102
340 lines not on this page · raw message
Index: drivers/char/drm/mga_drv.c
char/drm/mga_drv.c renamed from char/drm/mga_drv.c.prev +33 -16
92 lines not on this page · raw message
Index: drivers/char/drm/mga_state.c
char/drm/mga_state.c renamed from char/drm/mga_state.c.prev +107 -135
416 lines not on this page · raw message
Index: drivers/char/drm/r128_dma.c
char/drm/r128_dma.c renamed from char/drm/r128_dma.c.prev +1 -17
@@ -69,22 +69,6 @@ int R128_READ_PLL(drm_device_t *dev, int } -static void r128_flush_write_combine (void ) -{ -int xchangeDummy; +#define r128_flush_write_combine () mb() - __asm__volatile ("push %%eax ;" -"xchg %%eax, %0 ;" -"pop %%eax" : :"m" (xchangeDummy)); - __asm__volatile ("push %%eax ;" -"push %%ebx ;" -"push %%ecx ;" -"push %%edx ;" -"movl $0,%%eax ;" -"cpuid ;" -"pop %%edx ;" -"pop %%ecx ;" -"pop %%ebx ;" -"pop %%eax" :/* no outputs */ :/* no inputs */ ); -}static void r128_status (drm_device_t *dev)
Index: drivers/char/drm/r128_drv.c
char/drm/r128_drv.c renamed from char/drm/r128_drv.c.prev +3 -4
@@ -52,6 +52,6 @@ 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 */ +#if LINUX_VERSION_CODE >= 0x020400 +/* This started being used during 2.4.0-test */ owner: THIS_MODULE, #endif
@@ -608,4 +608,5 @@ int r128_lock(struct inode *inode, strucadd_wait_queue (&dev->lock.lock_queue, &entry);for (;;) { + current->state =TASK_INTERRUPTIBLE ;if (!dev->lock.hw_lock) {/* Device has been unregistered */
@@ -620,8 +621,6 @@ int r128_lock(struct inode *inode, strucbreak ;/* Got lock */ } -/* Contention */ atomic_inc (&dev->total_sleeps); - current->state =TASK_INTERRUPTIBLE ;#if 1 current->policy |=SCHED_YIELD ;
Index: drivers/char/drm/tdfx_drv.c
char/drm/tdfx_drv.c renamed from char/drm/tdfx_drv.c.prev +1 -2
@@ -567,4 +567,5 @@ int tdfx_lock(struct inode *inode, strucadd_wait_queue (&dev->lock.lock_queue, &entry);for (;;) { + current->state =TASK_INTERRUPTIBLE ;if (!dev->lock.hw_lock) {/* Device has been unregistered */
@@ -579,8 +580,6 @@ int tdfx_lock(struct inode *inode, strucbreak ;/* Got lock */ } -/* Contention */ atomic_inc (&dev->total_sleeps); - current->state =TASK_INTERRUPTIBLE ;#if 1 current->policy |=SCHED_YIELD ;
Index: drivers/char/drm/vm.c
char/drm/vm.c renamed from char/drm/vm.c.prev +59 -6
101 lines not on this page · raw message
Signature · 6 lines
Chip Salzenberg - a.k.a. - <[email protected]> "Give me immortality, or give me death!" // Firesign Theatre - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] Please read the FAQ at http://www.tux.org/lkml/
I'll look over it. It may be worth doing the fixing for 2.2.18, since 2.2.17 doesnt have DRM anyway. As posted it doesnt build against vanilla 2.2.18pre but I can see why so not a problem
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
[Chip Salzenberg]
Quoted 10 lines
char/Makefile renamed from char/Makefile.prev +1
-1@@ -12,5 +12,5 @@ SUB_DIRS := MOD_SUB_DIRS := $(SUB_DIRS) -ALL_SUB_DIRS := $(SUB_DIRS) rio ftape joystick drm agp +ALL_SUB_DIRS := $(SUB_DIRS) rio ftape joystick #
char/Makefile line 400
Quoted 6 lines
char/Makefile renamed from char/Makefile.prev +4
-0@@ -395,4 +395,16 @@ endif +ifeq ($(CONFIG_DRM),y) +O_OBJS += drm/drm.o +ALL_SUB_DIRS += drm +MOD_SUB_DIRS += drm
The bits about ALL_SUB_DIRS are trivially wrong. You should define it unconditionally -- that way the user doesn't have to 'make dep' after every 'make *config'.
Not a very important point, granted.
char/Makefile
Quoted 4 lines
char/Makefile renamed from char/Makefile.prev +1
-0#ifndef __HAVE_ARCH_CMPXCHG /* Include this here so that driver can be used with older kernels. */ +#if defined(__alpha__)
This section ought to be in include/asm-{alpha,i386}/system.h like in 2.4 (and like sparc64 in 2.2). Then again, perhaps in 2.2 it is best to let sleeping dogs lie.
Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/