Note for English Readers

If I write the articles in Indonesian, I will write a summary in English so that you can read my articles too. After you read the summary and you feel that you need more information about that, please do not hesitate to contact me via e-mail that can be found in my profile.

Thank you for reading my blogs.

Tuesday, March 22, 2011

ATI Catalyst Proprietary Display Driver 10.12 & kernel-2.6.38

If you want to use ATI Catalyst Proprietary Display Driver 10.12 on your PC/Laptop that running kernel 2.6.38, you will get error because the installer cannot create fglrx kernel module. You need to patch ATI Catalyst kernel module before you compile it manually. Here is the patch:

--- ./firegl_public.c   2010-12-02 22:28:43.000000000 +0100
+++ ./firegl_public.c.new       2011-01-09 17:40:22.000000000 +0100
@@ -320,7 +320,7 @@
     return firegl_release((KCL_IO_FILE_Handle)filp);
 }

-int ip_firegl_ioctl(struct inode* inode, struct file* filp, unsigned int cmd, unsigned long arg)
+int ip_firegl_ioctl(struct file* filp, unsigned int cmd, unsigned long arg)
 {
     return firegl_ioctl((KCL_IO_FILE_Handle)filp, cmd, arg);
 }
@@ -407,7 +407,7 @@
 #endif
     open:    ip_firegl_open,
     release: ip_firegl_release,
-    ioctl:   ip_firegl_ioctl,
+    unlocked_ioctl:   ip_firegl_ioctl,
     mmap:    ip_firegl_mmap,

     write:   ip_firegl_write,
@@ -840,7 +840,12 @@ static int fglrx_pci_suspend(struct pci_
      * happen much less frequent then without this workaround.
      */
     if (state == PM_EVENT_SUSPEND)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+        console_lock();
+#else
         acquire_console_sem();
+#endif
+

     if (firegl_cail_powerdown(privdev, state))
         ret = -EIO;
@@ -862,7 +867,11 @@ static int fglrx_pci_suspend(struct pci_
     }

     if (state == PM_EVENT_SUSPEND)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+        console_unlock();
+#else
         release_console_sem();
+#endif

     KCL_DEBUG_TRACEOUT(FN_FIREGL_ACPI, ret, NULL); 
    
@@ -886,7 +895,11 @@ static int fglrx_pci_resume(struct pci_d
     if (PMSG_EVENT(pdev->dev.power.power_state) == 0) return 0;

     if (PMSG_EVENT(pdev->dev.power.power_state) == PM_EVENT_SUSPEND)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+        console_lock();
+#else
         acquire_console_sem();
+#endif

 #ifdef FIREGL_USWC_SUPPORT
     // Restore the PAT after resuming from S3 or S4.
@@ -911,7 +924,11 @@ static int fglrx_pci_resume(struct pci_d
     firegl_cail_powerup(privdev);

     if (PMSG_EVENT(pdev->dev.power.power_state) == PM_EVENT_SUSPEND)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+        console_unlock();
+#else
         release_console_sem();
+#endif

     PMSG_EVENT(pdev->dev.power.power_state) = 0;
     KCL_DEBUG_TRACEOUT(FN_FIREGL_ACPI, 0, NULL); 

@@ -5107,7 +5107,7 @@
 unsigned int ATI_API_CALL KAS_Mutex_Initialize(void* hMutex)
 {
     kasMutex_t* mutex_obj = (kasMutex_t*)hMutex;
-    init_MUTEX(&(mutex_obj->mutex));
+    sema_init(&(mutex_obj->mutex),1);
     return 1;
 }

--- ./kcl_ioctl.c       2010-12-02 22:28:43.000000000 +0100
+++ ./kcl_ioctl.c.new   2011-01-09 17:40:22.000000000 +0100
@@ -193,7 +193,7 @@
  */
 void* ATI_API_CALL KCL_IOCTL_AllocUserSpace32(long size)
 {
-    void __user *ret = COMPAT_ALLOC_USER_SPACE(size);
+    void __user *ret = arch_compat_alloc_user_space(size);

     /* prevent stack overflow */
     if (!access_ok(VERIFY_WRITE, ret, size))

Save this patch to file and follow the instructions that I have written on http://henryhermawan.blogspot.com/2011/02/problem-when-using-ati-catalyst.html.

Reference: http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/3b716dfe326fef23?pli=1

No comments: