SOURCES: xorg-driver-video-fglrx-2.6.26.patch (NEW) - kernel 2.6.26 compila...

hawk hawk at pld-linux.org
Tue Jul 29 11:41:59 CEST 2008


Author: hawk                         Date: Tue Jul 29 09:41:59 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- kernel 2.6.26 compilation fix, taken from gentoo bugzilla

---- Files affected:
SOURCES:
   xorg-driver-video-fglrx-2.6.26.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/xorg-driver-video-fglrx-2.6.26.patch
diff -u /dev/null SOURCES/xorg-driver-video-fglrx-2.6.26.patch:1.1
--- /dev/null	Tue Jul 29 11:41:59 2008
+++ SOURCES/xorg-driver-video-fglrx-2.6.26.patch	Tue Jul 29 11:41:53 2008
@@ -0,0 +1,1619 @@
+--- common/lib/modules/fglrx/build_mod/firegl_public.c	2008-07-21 14:32:08.000000000 -0400
++++ common/lib/modules/fglrx/build_mod/firegl_public.c	2008-07-21 14:31:48.000000000 -0400
+@@ -24,13 +24,13 @@
+ // ============================================================
+ #include <linux/version.h>
+ 
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+ #error Kernel versions older than 2.6.0 are no longer supported by this module.
+-#endif 
++#endif
+ 
+ #include <linux/autoconf.h>
+ 
+-#if !defined(CONFIG_X86_PC) 
++#if !defined(CONFIG_X86_PC)
+ #if !defined(CONFIG_X86_64)
+ #if !defined(CONFIG_X86_VOYAGER)
+ #if !defined(CONFIG_X86_NUMAQ)
+@@ -62,10 +62,10 @@
+  * distribution would even include such a kernel patch. */
+ #ifdef CONFIG_MEM_MIRROR
+ /* Prevent asm/mm_track.h from being included in subsequent
+- * kernel headers as that would redefine CONFIG_MEM_MIRROR. */ 
++ * kernel headers as that would redefine CONFIG_MEM_MIRROR. */
+ #ifndef CONFIG_X86_64
+ #define __I386_MMTRACK_H__
+-#define mm_track(ptep)                 
++#define mm_track(ptep)
+ #else
+ #define __X86_64_MMTRACK_H__
+ #define mm_track_pte(ptep)
+@@ -93,7 +93,7 @@
+ #include <linux/kernel.h>
+ #include <linux/fs.h>
+ #include <linux/proc_fs.h>
+-#include <linux/init.h>
++//#include <linux/init.h>
+ #include <linux/file.h>
+ #include <linux/pci.h>
+ #include <linux/wait.h>
+@@ -151,8 +151,8 @@
+ #include "linux/freezer.h"
+ #endif
+ 
+-//  For 2.6.18 or higher, the UTS_RELEASE is defined in the linux/utsrelease.h. 
+-#ifndef UTS_RELEASE 
++//  For 2.6.18 or higher, the UTS_RELEASE is defined in the linux/utsrelease.h.
++#ifndef UTS_RELEASE
+ #include <linux/utsrelease.h>
+ #endif
+ 
+@@ -215,7 +215,7 @@
+ 
+ static void ATI_API_CALL __ke_printstr(const char *str);
+ 
+-static struct pci_device_id fglrx_pci_table[] = 
++static struct pci_device_id fglrx_pci_table[] =
+ {
+ #define FGL_ASIC_ID(x)                      \
+    {                           \
+@@ -283,7 +283,7 @@
+ 
+ static int firegl_pat_enabled = 0;
+ static unsigned long KCL_pat[2];
+-static unsigned long KCL_orig_pat[2]; 
++static unsigned long KCL_orig_pat[2];
+ 
+ static int ATI_API_CALL KCL_enable_pat(void);
+ static void ATI_API_CALL KCL_disable_pat(void);
+@@ -322,7 +322,7 @@
+ #endif
+ 
+ __ke_ssize_t ip_firegl_read( struct file *filp,
+-                         char *buf, 
++                         char *buf,
+                          __ke_size_t size,
+                          __ke_loff_t *off_ptr)
+ {
+@@ -334,7 +334,7 @@
+ }
+ 
+ __ke_ssize_t ip_firegl_write( struct file *filp,
+-                          const char *buf, 
++                          const char *buf,
+                           __ke_size_t size,
+                           __ke_loff_t *off_ptr)
+ {
+@@ -477,34 +477,34 @@
+     return firegl_debug_proc_write(file, buffer, count, data);     
+ }
+ 
+-static int 
++static int
+ firegl_interrupt_open_wrap(
+-        struct inode *inode, 
+-        struct file *file) 
++        struct inode *inode,
++        struct file *file)
+ {
+     return firegl_interrupt_open(inode, file);
+ }
+ 
+-static int 
++static int
+ firegl_interrupt_release_wrap(
+-        struct inode *inode, 
+-        struct file *file) 
++        struct inode *inode,
++        struct file *file)
+ {
+     return firegl_interrupt_release(inode, file);
+ }
+ 
+-static ssize_t 
++static ssize_t
+ firegl_interrupt_read_wrap(
+-        struct file *user_file, 
+-        char __user *user_buf, 
+-        size_t user_buf_size, 
++        struct file *user_file,
++        char __user *user_buf,
++        size_t user_buf_size,
+         loff_t *user_file_pos)
+ {
+     return (ssize_t) firegl_interrupt_read(user_file, user_buf, user_buf_size, user_file_pos);
+ }
+ 
+-static unsigned int 
+-firegl_interrupt_poll_wrap(struct file *user_file, poll_table *pt) 
++static unsigned int
++firegl_interrupt_poll_wrap(struct file *user_file, poll_table *pt)
+ {
+     if(firegl_interrupt_poll(user_file, (__ke_poll_table*)pt))
+     {
+@@ -516,11 +516,11 @@
+     }
+ }
+ 
+-static ssize_t 
++static ssize_t
+ firegl_interrupt_write_wrap(
+-        struct file *user_file, 
+-        const char __user *user_buf, 
+-        size_t user_buf_size, 
++        struct file *user_file,
++        const char __user *user_buf,
++        size_t user_buf_size,
+         loff_t *user_file_pos)
+ {
+     return (ssize_t) firegl_interrupt_write(user_file, user_buf, user_buf_size, user_file_pos);
+@@ -530,7 +530,7 @@
+  *  \param func function to be wrapped
+  *  \return None */
+ 
+-static void 
++static void
+ firegl_smp_func_parameter_wrap(
+ void *func)
+ {
+@@ -545,7 +545,7 @@
+     .write      = firegl_interrupt_write_wrap
+ };
+ 
+-__ke_proc_list_t firegl_proc_list[] = 
++__ke_proc_list_t firegl_proc_list[] =
+ {
+     { "name",           drm_name_info_wrap,         NULL},
+     { "mem",            drm_mem_info_wrap,          NULL},
+@@ -613,11 +613,11 @@
+         {
+ 		    ent->proc_fops = (struct file_operations*)list->fops;
+         }
+-       
++
+         {
+             ent->data = (dev->pubdev.signature == FGL_DEVICE_SIGNATURE)? firegl_find_device(minor) : (dev);
+         }
+-        
++
+         list++;
+ 	}
+ 
+@@ -663,7 +663,7 @@
+     {
+         remove_proc_entry("dri", NULL);
+         __KE_DEBUG("remove proc dri. \n");
+-    }    
++    }
+     return 0;
+ }
+ 
+@@ -701,12 +701,12 @@
+ {
+ 	int i;
+         int count = 0;
+-        
++
+         __KE_DEBUG("firegl_stub_getminor: name=\"%s\"\n", name);
+ 
+-	for( i = 0; i < FIREGL_STUB_MAXCARDS; i++ ) 
++	for( i = 0; i < FIREGL_STUB_MAXCARDS; i++ )
+         {
+-	    if( !firegl_stub_list[i].fops ) 
++	    if( !firegl_stub_list[i].fops )
+             {
+ 		firegl_stub_list[i].name = name;
+ 		firegl_stub_list[i].fops = fops;
+@@ -733,16 +733,16 @@
+     if (minor < 0 || minor >= FIREGL_STUB_MAXCARDS)
+     {
+         return -1;
+-    }    
++    }
+     firegl_proc_cleanup(minor, firegl_stub_root, firegl_stub_list[minor].dev_root, firegl_stub_list[minor].proclist);
+     firegl_stub_list[minor].name = NULL;
+     firegl_stub_list[minor].fops = NULL;
+     firegl_stub_list[minor].proclist = NULL;
+ 
+-    if( minor == (firegl_minors-1) ) 
++    if( minor == (firegl_minors-1) )
+     {
+         unregister_chrdev(DRM_MAJOR, "drm");
+-    }   
++    }
+     return 0;
+ }
+ 
+@@ -766,7 +766,7 @@
+         return -1;
+     } else if(err == -EBUSY) {
+ 
+-        // the registering of the module's device has failed 
++        // the registering of the module's device has failed
+         // because there was already some other drm module loaded.
+         __KE_DEBUG("register_chrdev() failed with -EBUSY\n");
+ 	return -1;
+@@ -798,7 +798,7 @@
+ /* Starting from 2.6.14, kernel has new struct defined for pm_message_t,
+    we have to handle this case separately.
+    2.6.11/12/13 kernels have pm_message_t defined as int and older kernels
+-   don't have pm_message_t defined. 
++   don't have pm_message_t defined.
+  */
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
+ static int fglrx_pci_suspend(struct pci_dev *pdev, pm_message_t pm_event)
+@@ -834,9 +834,9 @@
+ 
+     if (!ret)
+     {
+-        
+-    // since privdev->pcidev is acquired in X server, use pdev 
+-    // directly here to allow suspend/resume without X server start. 
++
++    // since privdev->pcidev is acquired in X server, use pdev
++    // directly here to allow suspend/resume without X server start.
+         firegl_pci_save_state((__ke_pci_dev_t*)pdev, privdev);
+         pci_disable_device(pdev);
+         PMSG_EVENT(pdev->dev.power.power_state) = state;
+@@ -888,13 +888,13 @@
+     // before pci_set_master!
+     firegl_pci_restore_state((__ke_pci_dev_t*)pdev, privdev);
+ 
+-    if (pci_enable_device(pdev)) 
++    if (pci_enable_device(pdev))
+     {
+         __KE_ERROR("Cannot enable PCI device.\n");
+-    }    
++    }
+ 
+     pci_set_master(pdev);
+- 
++
+     firegl_cail_powerup(privdev);
+ 
+     if (PMSG_EVENT(pdev->dev.power.power_state) == PM_EVENT_SUSPEND)
+@@ -905,7 +905,7 @@
+     return 0;
+ }
+ 
+-static struct pci_driver fglrx_pci_driver = 
++static struct pci_driver fglrx_pci_driver =
+ {
+     .name           = "fglrx_pci",
+     .id_table       = fglrx_pci_table,
+@@ -961,10 +961,10 @@
+     {
+         pid = (struct pci_device_id *) &fglrx_pci_table[i];
+         pdev = NULL;
+-        while (( pdev = pci_get_subsys(pid->vendor, 
+-                                       pid->device, 
+-                                       PCI_ANY_ID, 
+-                                       PCI_ANY_ID, 
++        while (( pdev = pci_get_subsys(pid->vendor,
++                                       pid->device,
++                                       PCI_ANY_ID,
++                                       PCI_ANY_ID,
+                                        pdev)) != NULL)
+         {
+             num_of_devices++;
+@@ -974,7 +974,7 @@
+ 
+     if (firegl_init_device_heads(num_of_devices))
+     {
+-        return -ENOMEM;     
++        return -ENOMEM;
+     }
+ 
+     for (i=0; fglrx_pci_table[i].vendor != 0; i++)
+@@ -982,15 +982,15 @@
+         pid = (struct pci_device_id *) &fglrx_pci_table[i];
+ 
+         pdev = NULL;
+-        while (( pdev = pci_get_subsys(pid->vendor, 
+-                                       pid->device, 
+-                                       PCI_ANY_ID, 
+-                                       PCI_ANY_ID, 
++        while (( pdev = pci_get_subsys(pid->vendor,
++                                       pid->device,
++                                       PCI_ANY_ID,
++                                       PCI_ANY_ID,
+                                        pdev)) != NULL)
+         {
+             if ((ret_code = firegl_get_dev(pubdev, pdev)))
+             {
+-                return ret_code; 
++                return ret_code;
+             }
+ 
+             j++;
+@@ -1023,7 +1023,7 @@
+     // init global vars that are in fact constants
+     __ke_HZ = HZ;
+ 
+-#ifdef _KE_SERIAL_DEBUG  
++#ifdef _KE_SERIAL_DEBUG
+     __ke_SetSerialPort();
+ #endif
+ 
+@@ -1035,11 +1035,11 @@
+         return retcode;
+     }
+ 
+-#ifdef FIREGL_CF_SUPPORT    
++#ifdef FIREGL_CF_SUPPORT
+     adapter_chain_init();
+     cf_object_init();
+-#endif    
+-     
++#endif
++
+     // init DRM proc list
+     drm_proclist = kmalloc((DRM_PROC_ENTRIES + 1) * sizeof(__ke_proc_list_t), GFP_KERNEL);
+     if ( drm_proclist == NULL )
+@@ -1127,7 +1127,7 @@
+ 	        dev->pubdev.date,
+ 		    firegl_minors);
+ 
+-    
++
+ #ifdef FIREGL_POWER_MANAGEMENT
+     if (pci_register_driver (&fglrx_pci_driver) < 0)
+     {
+@@ -1157,12 +1157,12 @@
+     {
+        KCL_disable_pat();
+        __KE_INFO("Disable PAT\n");
+-    }   
++    }
+ #endif // FIREGL_USWC_SUPPORT
+ 
+     for (i = 0; i < count; i++)
+     {
+-        if ( firegl_stub_unregister(i) ) 
++        if ( firegl_stub_unregister(i) )
+         {
+             __KE_ERROR("Cannot unload module on minor: %d\n", i);
+         }
+@@ -1184,10 +1184,10 @@
+ 	        dev->pubdev.patchlevel,
+ 	        dev->pubdev.date);
+ 
+-#ifdef FIREGL_CF_SUPPORT    
++#ifdef FIREGL_CF_SUPPORT
+     cf_object_cleanup();
+-    adapter_chain_cleanup();    
+-#endif // FIREGL_CF_SUPPORT   
++    adapter_chain_cleanup();
++#endif // FIREGL_CF_SUPPORT
+ 
+     firegl_private_cleanup (&dev->pubdev);
+ 
+@@ -1265,18 +1265,18 @@
+ void ATI_API_CALL __ke_remove_wait_queue(__ke_wait_queue_head_t* queue_head, __ke_wait_queue_t* entry)
+ {
+ //    current->state = TASK_RUNNING;
+-    remove_wait_queue((wait_queue_head_t*)(void *)queue_head, 
++    remove_wait_queue((wait_queue_head_t*)(void *)queue_head,
+ 									(wait_queue_t*)(void *)entry);
+ }
+ 
+ void ATI_API_CALL __ke_init_waitqueue_head(__ke_wait_queue_head_t* queue_head)
+ {
+-    init_waitqueue_head((wait_queue_head_t*)(void *)queue_head); 
++    init_waitqueue_head((wait_queue_head_t*)(void *)queue_head);
+ }
+ 
+ void ATI_API_CALL __ke_wait_event_interruptible(__ke_wait_queue_head_t* queue_head, int condition)
+ {
+-    wait_event_interruptible(*((wait_queue_head_t*)(void *)queue_head), condition); 
++    wait_event_interruptible(*((wait_queue_head_t*)(void *)queue_head), condition);
+ }
+ 
+ void ATI_API_CALL __ke_poll_wait(struct file* filp, __ke_wait_queue_head_t* queue_head, __ke_poll_table* pt)
+@@ -1287,13 +1287,13 @@
+ void ATI_API_CALL *__ke_asyncio_alloc_sema()
+ {
+     int i;
+-    
++
+     for(i=0; i<FIREGL_ASYNCIO_MAX_SEMA; i++)
+     {
+         if(fireglAsyncioSemaphoreUsed[i] != 1)
+         {
+             fireglAsyncioSemaphoreUsed[i] = 1;
+-            
++
+             return &(fireglAsyncioSemaphore[i]);
+         }
+     }
+@@ -1303,7 +1303,7 @@
+ void ATI_API_CALL __ke_asyncio_free_sema(struct semaphore *pSema)
+ {
+     int i;
+-    
++
+     for(i=0; i<FIREGL_ASYNCIO_MAX_SEMA; i++)
+     {
+         if( &(fireglAsyncioSemaphore[i]) == pSema )
+@@ -1317,15 +1317,15 @@
+ void ATI_API_CALL __ke_asyncio_init_sema(void)
+ {
+     int i;
+-    
++
+     for(i=0; i<FIREGL_ASYNCIO_MAX_SEMA; i++)
+     {
+         fireglAsyncioSemaphoreUsed[i] = 0;
+     }
+-}    
++}
+ 
+-int ATI_API_CALL __ke_fasync_helper( int fd, 
+-                        struct file *filep, 
++int ATI_API_CALL __ke_fasync_helper( int fd,
++                        struct file *filep,
+                         int mode,
+                         struct fasync_struct **pasync_queue)
+ {
+@@ -1403,33 +1403,33 @@
+ {
+    struct task_struct *p;
+    int process_terminated = 1;
+-  
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)  
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
+    rcu_read_lock();
+-#else   
++#else
+    read_lock(&tasklist_lock);
+-#endif   
+-   p = find_task_by_pid( pid );
+-   if (p) 
++#endif
++   p = find_task_by_vpid( pid );
++   if (p)
+    {
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
+-      if (p->exit_state != EXIT_ZOMBIE && p->exit_state != EXIT_DEAD) 
++      if (p->exit_state != EXIT_ZOMBIE && p->exit_state != EXIT_DEAD)
+ #else
+-      if (!(p->flags & PF_EXITING)) 
++      if (!(p->flags & PF_EXITING))
+ #endif
+       {
+          process_terminated = 0;
+       }
+-   }   
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)  
++   }
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
+    rcu_read_unlock();
+-#else   
++#else
+    read_unlock(&tasklist_lock);
+-#endif   
++#endif
+    return process_terminated;
+ }
+ 
+-/** /brief Call global OS kernel task/thread scheduler 
++/** /brief Call global OS kernel task/thread scheduler
+  *  /return Nonzero if a system call was awakened by a signal
+  */
+ int ATI_API_CALL KCL_GetSignalStatus(void)
+@@ -1483,15 +1483,15 @@
+     unblock_all_signals();
+ }
+ 
+-#if defined(__i386__) 
++#if defined(__i386__)
+ #ifndef __HAVE_ARCH_CMPXCHG
+-static inline 
+-unsigned long __fgl_cmpxchg(volatile void *ptr, unsigned long old,            
+-                        unsigned long new, int size)                      
+-{                                                                                       
+-    unsigned long prev;                                                             
+-    switch (size) {                                                                 
+-    case 1:                                                                         
++static inline
++unsigned long __fgl_cmpxchg(volatile void *ptr, unsigned long old,
++                        unsigned long new, int size)
++{
++    unsigned long prev;
++    switch (size) {
++    case 1:
+         __asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
+                              : "=a"(prev)
+                              : "q"(new), "m"(*__xg(ptr)), "0"(old)
+@@ -1602,7 +1602,7 @@
+  */
+ KCL_TYPE_Pid ATI_API_CALL KCL_GetPid(void)
+ {
+-    return current->pid; 
++    return current->pid;
+ }
+ 
+ /** /brief Return the current Thread Group ID
+@@ -1610,7 +1610,7 @@
+  */
+ KCL_TYPE_Pid ATI_API_CALL KCL_GetTgid(void)
+ {
+-    return current->tgid; 
++    return current->tgid;
+ }
+ 
+ /** /brief Return the effective user ID
+@@ -1706,7 +1706,7 @@
+     1
+ #else
+     0
+-#endif 
++#endif
+ };
+ 
+ /** /brief Check whether a kernel configuration parameter is defined
+@@ -1792,13 +1792,13 @@
+ #if defined(__x86_64__) || defined(__ia64__)
+ void* ATI_API_CALL __ke_pci_alloc_consistent(__ke_pci_dev_t* dev, int size, void *dma_handle)
+ {
+-	return (pci_alloc_consistent( (struct pci_dev*)(void *)dev, size, dma_handle)); 
++	return (pci_alloc_consistent( (struct pci_dev*)(void *)dev, size, dma_handle));
+ }
+ 
+ void ATI_API_CALL __ke_pci_free_consistent(__ke_pci_dev_t* dev, int size, unsigned long cpu_addr,
+ 						 unsigned int dma_handle)
+ {
+-	pci_free_consistent( (struct pci_dev*)(void *)dev, size, (void *)cpu_addr, 
++	pci_free_consistent( (struct pci_dev*)(void *)dev, size, (void *)cpu_addr,
+ 		(unsigned long)dma_handle);
+ }
+ #endif // __ia64__
+@@ -1822,7 +1822,7 @@
+ 
+ /** \brief This function maps OS independent error conditions to OS defined error codes
+  *  \param errcode OS independent error condition code
+- *  \return OS kernel defined error code corresponding to the requested error condition 
++ *  \return OS kernel defined error code corresponding to the requested error condition
+  */
+ int ATI_API_CALL KCL_GetErrorCode(KCL_ENUM_ErrorCode errcode)
+ {
+@@ -1840,7 +1840,7 @@
+ int ATI_API_CALL firegl_get_user_ptr(u32 *src, void **dst)
+ {
+   unsigned long temp;
+-  int err = get_user(temp, src); 
++  int err = get_user(temp, src);
+   *dst = (void*) temp;
+   return err;
+ }
<<Diff was trimmed, longer than 597 lines>>


More information about the pld-cvs-commit mailing list