aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/ni.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-04-12 13:52:52 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-06-27 10:49:18 -0400
commit2948f5e6c211eccd58b81c15a410d9f3d9cda657 (patch)
tree86324d51dc6edbd9f279a4c955d6444aed23c1c1 /drivers/gpu/drm/radeon/ni.c
parent138e4e16f0e1d7dee8e6d0534147e15c0a3d94d5 (diff)
drm/radeon: properly set up the RLC on ON/LN/TN (v3)
This is required for certain advanced functionality. v2: save/restore list takes dword offsets v3: rebase on gpu reset changes Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/ni.c')
-rw-r--r--drivers/gpu/drm/radeon/ni.c141
1 files changed, 136 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
index 92843461320d..c73d71340d27 100644
--- a/drivers/gpu/drm/radeon/ni.c
+++ b/drivers/gpu/drm/radeon/ni.c
@@ -34,6 +34,134 @@
34#include "ni_reg.h" 34#include "ni_reg.h"
35#include "cayman_blit_shaders.h" 35#include "cayman_blit_shaders.h"
36#include "radeon_ucode.h" 36#include "radeon_ucode.h"
37#include "clearstate_cayman.h"
38
39static u32 tn_rlc_save_restore_register_list[] =
40{
41 0x98fc,
42 0x98f0,
43 0x9834,
44 0x9838,
45 0x9870,
46 0x9874,
47 0x8a14,
48 0x8b24,
49 0x8bcc,
50 0x8b10,
51 0x8c30,
52 0x8d00,
53 0x8d04,
54 0x8c00,
55 0x8c04,
56 0x8c10,
57 0x8c14,
58 0x8d8c,
59 0x8cf0,
60 0x8e38,
61 0x9508,
62 0x9688,
63 0x9608,
64 0x960c,
65 0x9610,
66 0x9614,
67 0x88c4,
68 0x8978,
69 0x88d4,
70 0x900c,
71 0x9100,
72 0x913c,
73 0x90e8,
74 0x9354,
75 0xa008,
76 0x98f8,
77 0x9148,
78 0x914c,
79 0x3f94,
80 0x98f4,
81 0x9b7c,
82 0x3f8c,
83 0x8950,
84 0x8954,
85 0x8a18,
86 0x8b28,
87 0x9144,
88 0x3f90,
89 0x915c,
90 0x9160,
91 0x9178,
92 0x917c,
93 0x9180,
94 0x918c,
95 0x9190,
96 0x9194,
97 0x9198,
98 0x919c,
99 0x91a8,
100 0x91ac,
101 0x91b0,
102 0x91b4,
103 0x91b8,
104 0x91c4,
105 0x91c8,
106 0x91cc,
107 0x91d0,
108 0x91d4,
109 0x91e0,
110 0x91e4,
111 0x91ec,
112 0x91f0,
113 0x91f4,
114 0x9200,
115 0x9204,
116 0x929c,
117 0x8030,
118 0x9150,
119 0x9a60,
120 0x920c,
121 0x9210,
122 0x9228,
123 0x922c,
124 0x9244,
125 0x9248,
126 0x91e8,
127 0x9294,
128 0x9208,
129 0x9224,
130 0x9240,
131 0x9220,
132 0x923c,
133 0x9258,
134 0x9744,
135 0xa200,
136 0xa204,
137 0xa208,
138 0xa20c,
139 0x8d58,
140 0x9030,
141 0x9034,
142 0x9038,
143 0x903c,
144 0x9040,
145 0x9654,
146 0x897c,
147 0xa210,
148 0xa214,
149 0x9868,
150 0xa02c,
151 0x9664,
152 0x9698,
153 0x949c,
154 0x8e10,
155 0x8e18,
156 0x8c50,
157 0x8c58,
158 0x8c60,
159 0x8c68,
160 0x89b4,
161 0x9830,
162 0x802c,
163};
164static u32 tn_rlc_save_restore_register_list_size = ARRAY_SIZE(tn_rlc_save_restore_register_list);
37 165
38extern bool evergreen_is_display_hung(struct radeon_device *rdev); 166extern bool evergreen_is_display_hung(struct radeon_device *rdev);
39extern void evergreen_print_gpu_status_regs(struct radeon_device *rdev); 167extern void evergreen_print_gpu_status_regs(struct radeon_device *rdev);
@@ -45,8 +173,8 @@ extern void evergreen_irq_suspend(struct radeon_device *rdev);
45extern int evergreen_mc_init(struct radeon_device *rdev); 173extern int evergreen_mc_init(struct radeon_device *rdev);
46extern void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev); 174extern void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev);
47extern void evergreen_pcie_gen2_enable(struct radeon_device *rdev); 175extern void evergreen_pcie_gen2_enable(struct radeon_device *rdev);
48extern void si_rlc_fini(struct radeon_device *rdev); 176extern void sumo_rlc_fini(struct radeon_device *rdev);
49extern int si_rlc_init(struct radeon_device *rdev); 177extern int sumo_rlc_init(struct radeon_device *rdev);
50 178
51/* Firmware Names */ 179/* Firmware Names */
52MODULE_FIRMWARE("radeon/BARTS_pfp.bin"); 180MODULE_FIRMWARE("radeon/BARTS_pfp.bin");
@@ -1969,7 +2097,10 @@ static int cayman_startup(struct radeon_device *rdev)
1969 2097
1970 /* allocate rlc buffers */ 2098 /* allocate rlc buffers */
1971 if (rdev->flags & RADEON_IS_IGP) { 2099 if (rdev->flags & RADEON_IS_IGP) {
1972 r = si_rlc_init(rdev); 2100 rdev->rlc.reg_list = tn_rlc_save_restore_register_list;
2101 rdev->rlc.reg_list_size = tn_rlc_save_restore_register_list_size;
2102 rdev->rlc.cs_data = cayman_cs_data;
2103 r = sumo_rlc_init(rdev);
1973 if (r) { 2104 if (r) {
1974 DRM_ERROR("Failed to init rlc BOs!\n"); 2105 DRM_ERROR("Failed to init rlc BOs!\n");
1975 return r; 2106 return r;
@@ -2226,7 +2357,7 @@ int cayman_init(struct radeon_device *rdev)
2226 cayman_dma_fini(rdev); 2357 cayman_dma_fini(rdev);
2227 r600_irq_fini(rdev); 2358 r600_irq_fini(rdev);
2228 if (rdev->flags & RADEON_IS_IGP) 2359 if (rdev->flags & RADEON_IS_IGP)
2229 si_rlc_fini(rdev); 2360 sumo_rlc_fini(rdev);
2230 radeon_wb_fini(rdev); 2361 radeon_wb_fini(rdev);
2231 radeon_ib_pool_fini(rdev); 2362 radeon_ib_pool_fini(rdev);
2232 radeon_vm_manager_fini(rdev); 2363 radeon_vm_manager_fini(rdev);
@@ -2257,7 +2388,7 @@ void cayman_fini(struct radeon_device *rdev)
2257 cayman_dma_fini(rdev); 2388 cayman_dma_fini(rdev);
2258 r600_irq_fini(rdev); 2389 r600_irq_fini(rdev);
2259 if (rdev->flags & RADEON_IS_IGP) 2390 if (rdev->flags & RADEON_IS_IGP)
2260 si_rlc_fini(rdev); 2391 sumo_rlc_fini(rdev);
2261 radeon_wb_fini(rdev); 2392 radeon_wb_fini(rdev);
2262 radeon_vm_manager_fini(rdev); 2393 radeon_vm_manager_fini(rdev);
2263 radeon_ib_pool_fini(rdev); 2394 radeon_ib_pool_fini(rdev);