AMD Catalyst 12.6 安裝錯誤記錄及解決方法。

1.make日誌提示如下:

.../firegl_public.c:In function ‘kasInitExecutionLevels’:
.../firegl_public.c:4157:5:error: ‘cpu_possible_map’ undeclared (first use in this function)
.../firegl_public.c:4157:5:note: each undeclared identifier is reported only once for each function it appears in
.../firegl_public.c:4157:5:warning: left-hand opercpu_possible_mapcpu_possible_mapand of comma expression
has no effect [-Wunused-value]

解決方案(cpu_possible_map.patch),3.4及以後的內核可能需要此補丁:

--- /common/lib/modules/fglrx/build_mod/firegl_public.c
+++ /common/lib/modules/fglrx/build_mod/firegl_public.c
@@ -34,6 +34,11 @@
 #include <linux/autoconf.h>
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
+#define cpu_possible_map    (*(cpumask_t *)cpu_possible_mask)
+#define cpu_online_map        (*(cpumask_t *)cpu_online_mask)
+#endif
+
 #if !defined(CONFIG_X86)
 #if !defined(CONFIG_X86_PC)
 #if !defined(CONFIG_X86_XEN)
@@ -4156,7 +4161,7 @@
 {
     unsigned int p;
     KCL_DEBUG5(FN_FIREGL_KAS, "%d\n", level_init);
-    for_each_cpu_mask(p, cpu_possible_map)
+    for_each_possible_cpu(p)
     {
         KCL_DEBUG1(FN_FIREGL_KAS,"Setting initial execution level for CPU # %d\n", p);
         preempt_disable();

--- /common/lib/modules/fglrx/build_mod/kcl_ioctl.c
+++ /common/lib/modules/fglrx/build_mod/kcl_ioctl.c
@@ -217,6 +217,9 @@
  *  \param size [in] Number of bytes to allocate
  *  \return Pointer to allocated memory
  */
+#ifndef CONFIG_X86_X32
+DEFINE_PER_CPU(unsigned long, old_rsp);
+#endif
 void* ATI_API_CALL KCL_IOCTL_AllocUserSpace32(long size)
 {
     void __user *ret = COMPAT_ALLOC_USER_SPACE(size);

2.make日誌提示如下:

.../firegl_public.c: In function ‘KCL_MEM_AllocLinearAddrInterval’:
.../firegl_public.c:2149:5: error: implicit declaration of function ‘do_mmap’ [-Werror=implicit-function-declaration]
.../firegl_public.c:2149:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

解決方案(do_mmap.patch,請先打上面的補丁),3.5以後的內核需要此補丁:

--- /common/lib/modules/fglrx/build_mod/firegl_public.c
+++ /common/lib/modules/fglrx/build_mod/firegl_public.c
@@ -2113,6 +2113,12 @@
     }
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+# define NO_DO_MMAP
+# define do_mmap(a,b,c,d,e,f) vm_mmap(a, b, c, d, e, f)
+# define do_munmap(a,b,c) vm_munmap(b, c)
+#endif
+
 unsigned long ATI_API_CALL KCL_MEM_AllocLinearAddrInterval(
                                         KCL_IO_FILE_Handle file,
                                         unsigned long addr,
@@ -2124,10 +2130,13 @@
 
     flags = MAP_SHARED;
     prot  = PROT_READ|PROT_WRITE;
-
+#ifdef NO_DO_MMAP
+    vaddr = (void *) vm_mmap(file, 0, len, prot, flags, pgoff);
+#else
     down_write(&current->mm->mmap_sem);
     vaddr = (void *) do_mmap(file, 0, len, prot, flags, pgoff);
     up_write(&current->mm->mmap_sem);
+#endif
     if (IS_ERR(vaddr))
        return 0;
     else
@@ -2138,7 +2147,9 @@
 {
     int retcode = 0;
 
+#ifndef NO_DO_MMAP
     down_write(&current->mm->mmap_sem);
+#endif
 #ifdef FGL_LINUX_RHEL_MUNMAP_API
     retcode = do_munmap(current->mm,
                         addr,
@@ -2148,8 +2159,10 @@
     retcode = do_munmap(current->mm,
                         addr,
                         len);
-#endif                       
+#endif 
+#ifndef NO_DO_MMAP                     
     up_write(&current->mm->mmap_sem);
+#endif
     return retcode;
 }

 

一般來說,出錯了之後先卸載驅動,解壓run文件,修改./common/lib/modules/fglrx/build_mod/make.sh文件中的logfile變量,使日誌導出到固定目錄,然後用關鍵字一搜解決方案就出來了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章