summarylogtreecommitdiffstats
path: root/lano1106_kcl_agp_13_4.patch
blob: d39c5aaeb108add7849a6a53500fbcb662b8e9d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
--- 13.4/common/lib/modules/fglrx/build_mod/kcl_agp.c	2013-05-24 16:45:52.236740084 -0400
+++ 13.4/common/lib/modules/fglrx/build_mod/kcl_agp.c	2013-05-24 16:49:29.283579408 -0400
@@ -56,6 +56,43 @@ unsigned int KCL_AGP_IsInUse(void)
     return kcl_agp_is_in_use;
 }

+/** \brief Find AGP caps registers in PCI config space
+ ** \param dev PCI device handle
+ ** \return Positive register index on success, negative errno on error
+ */
+int ATI_API_CALL KCL_AGP_FindCapsRegisters(KCL_PCI_DevHandle dev)
+{
+    u8 capndx;
+    u32 cap_id;
+
+    if (!dev)
+    {
+        return -ENODEV;
+    }
+
+    pci_read_config_byte((struct pci_dev*)dev, 0x34, &capndx);
+
+    if (capndx == 0x00)
+    {
+        return -ENODATA;
+    }
+
+    do
+    { // search capability list for AGP caps
+        pci_read_config_dword((struct pci_dev*)dev, capndx, &cap_id);
+
+        if ((cap_id & 0xff) == 0x02)
+        {
+            return capndx;
+        }
+
+        capndx = (cap_id >> 8) & 0xff;
+    }
+    while (capndx != 0x00);
+
+    return -ENODATA;
+}
+
 #if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)

 typedef struct {
@@ -272,43 +309,6 @@ int ATI_API_CALL KCL_AGP_Enable(unsigned
     }
 }

-/** \brief Find AGP caps registers in PCI config space
- ** \param dev PCI device handle
- ** \return Positive register index on success, negative errno on error
- */
-int ATI_API_CALL KCL_AGP_FindCapsRegisters(KCL_PCI_DevHandle dev)
-{
-    u8 capndx;
-    u32 cap_id;
-
-    if (!dev)
-    {
-        return -ENODEV;
-    }
-
-    pci_read_config_byte((struct pci_dev*)dev, 0x34, &capndx);
-
-    if (capndx == 0x00)
-    {
-        return -ENODATA;
-    }
-
-    do
-    { // search capability list for AGP caps
-        pci_read_config_dword((struct pci_dev*)dev, capndx, &cap_id);
-
-        if ((cap_id & 0xff) == 0x02)
-        {
-            return capndx;
-        }
-
-        capndx = (cap_id >> 8) & 0xff;
-    }
-    while (capndx != 0x00);
-
-    return -ENODATA;
-}
-
 /** \brief Get AGP caps
  ** \param dev PCI device handle
  ** \param caps pointer to caps vector