xref: /openbmc/qemu/hw/display/ati_dbg.c (revision 9f33cf2a89b5f8b437f3c62158c9ac2aa6ba9d48)
1bbfff196SMarkus Armbruster #include "qemu/osdep.h"
2862b4a29SBALATON Zoltan #include "ati_int.h"
3862b4a29SBALATON Zoltan 
4862b4a29SBALATON Zoltan #ifdef DEBUG_ATI
5862b4a29SBALATON Zoltan struct ati_regdesc {
6862b4a29SBALATON Zoltan     const char *name;
7862b4a29SBALATON Zoltan     int num;
8862b4a29SBALATON Zoltan };
9862b4a29SBALATON Zoltan 
10862b4a29SBALATON Zoltan static struct ati_regdesc ati_reg_names[] = {
11862b4a29SBALATON Zoltan     {"MM_INDEX", 0x0000},
12862b4a29SBALATON Zoltan     {"MM_DATA", 0x0004},
13862b4a29SBALATON Zoltan     {"CLOCK_CNTL_INDEX", 0x0008},
14862b4a29SBALATON Zoltan     {"CLOCK_CNTL_DATA", 0x000c},
15862b4a29SBALATON Zoltan     {"BIOS_0_SCRATCH", 0x0010},
16862b4a29SBALATON Zoltan     {"BUS_CNTL", 0x0030},
17862b4a29SBALATON Zoltan     {"BUS_CNTL1", 0x0034},
18862b4a29SBALATON Zoltan     {"GEN_INT_CNTL", 0x0040},
19b7105d28SBALATON Zoltan     {"GEN_INT_STATUS", 0x0044},
20862b4a29SBALATON Zoltan     {"CRTC_GEN_CNTL", 0x0050},
21862b4a29SBALATON Zoltan     {"CRTC_EXT_CNTL", 0x0054},
22862b4a29SBALATON Zoltan     {"DAC_CNTL", 0x0058},
23c82c7336SBALATON Zoltan     {"GPIO_VGA_DDC", 0x0060},
24c82c7336SBALATON Zoltan     {"GPIO_DVI_DDC", 0x0064},
25862b4a29SBALATON Zoltan     {"GPIO_MONID", 0x0068},
26862b4a29SBALATON Zoltan     {"I2C_CNTL_1", 0x0094},
27df1e4cf4SBALATON Zoltan     {"AMCGPIO_MASK_MIR", 0x009c},
28df1e4cf4SBALATON Zoltan     {"AMCGPIO_A_MIR", 0x00a0},
29df1e4cf4SBALATON Zoltan     {"AMCGPIO_Y_MIR", 0x00a4},
30df1e4cf4SBALATON Zoltan     {"AMCGPIO_EN_MIR", 0x00a8},
31862b4a29SBALATON Zoltan     {"PALETTE_INDEX", 0x00b0},
32862b4a29SBALATON Zoltan     {"PALETTE_DATA", 0x00b4},
33*bf9ac62aSBALATON Zoltan     {"PALETTE_30_DATA", 0x00b8},
34862b4a29SBALATON Zoltan     {"CNFG_CNTL", 0x00e0},
35862b4a29SBALATON Zoltan     {"GEN_RESET_CNTL", 0x00f0},
36862b4a29SBALATON Zoltan     {"CNFG_MEMSIZE", 0x00f8},
371d8d4d86SBALATON Zoltan     {"CONFIG_APER_0_BASE", 0x0100},
381d8d4d86SBALATON Zoltan     {"CONFIG_APER_1_BASE", 0x0104},
391d8d4d86SBALATON Zoltan     {"CONFIG_APER_SIZE", 0x0108},
401d8d4d86SBALATON Zoltan     {"CONFIG_REG_1_BASE", 0x010c},
411d8d4d86SBALATON Zoltan     {"CONFIG_REG_APER_SIZE", 0x0110},
42f7ecde05SBALATON Zoltan     {"HOST_PATH_CNTL", 0x0130},
43862b4a29SBALATON Zoltan     {"MEM_CNTL", 0x0140},
44862b4a29SBALATON Zoltan     {"MC_FB_LOCATION", 0x0148},
45862b4a29SBALATON Zoltan     {"MC_AGP_LOCATION", 0x014C},
46862b4a29SBALATON Zoltan     {"MC_STATUS", 0x0150},
472bbcaa7cSBALATON Zoltan     {"MEM_SDRAM_MODE_REG", 0x0158},
48862b4a29SBALATON Zoltan     {"MEM_POWER_MISC", 0x015c},
49862b4a29SBALATON Zoltan     {"AGP_BASE", 0x0170},
50862b4a29SBALATON Zoltan     {"AGP_CNTL", 0x0174},
51862b4a29SBALATON Zoltan     {"AGP_APER_OFFSET", 0x0178},
52862b4a29SBALATON Zoltan     {"PCI_GART_PAGE", 0x017c},
53862b4a29SBALATON Zoltan     {"PC_NGUI_MODE", 0x0180},
54862b4a29SBALATON Zoltan     {"PC_NGUI_CTLSTAT", 0x0184},
55862b4a29SBALATON Zoltan     {"MPP_TB_CONFIG", 0x01C0},
56862b4a29SBALATON Zoltan     {"MPP_GP_CONFIG", 0x01C8},
57862b4a29SBALATON Zoltan     {"VIPH_CONTROL", 0x01D0},
58862b4a29SBALATON Zoltan     {"CRTC_H_TOTAL_DISP", 0x0200},
59862b4a29SBALATON Zoltan     {"CRTC_H_SYNC_STRT_WID", 0x0204},
60862b4a29SBALATON Zoltan     {"CRTC_V_TOTAL_DISP", 0x0208},
61862b4a29SBALATON Zoltan     {"CRTC_V_SYNC_STRT_WID", 0x020c},
62862b4a29SBALATON Zoltan     {"CRTC_VLINE_CRNT_VLINE", 0x0210},
63862b4a29SBALATON Zoltan     {"CRTC_CRNT_FRAME", 0x0214},
64862b4a29SBALATON Zoltan     {"CRTC_GUI_TRIG_VLINE", 0x0218},
65862b4a29SBALATON Zoltan     {"CRTC_OFFSET", 0x0224},
66862b4a29SBALATON Zoltan     {"CRTC_OFFSET_CNTL", 0x0228},
67862b4a29SBALATON Zoltan     {"CRTC_PITCH", 0x022c},
68862b4a29SBALATON Zoltan     {"OVR_CLR", 0x0230},
69862b4a29SBALATON Zoltan     {"OVR_WID_LEFT_RIGHT", 0x0234},
70862b4a29SBALATON Zoltan     {"OVR_WID_TOP_BOTTOM", 0x0238},
71862b4a29SBALATON Zoltan     {"CUR_OFFSET", 0x0260},
72862b4a29SBALATON Zoltan     {"CUR_HORZ_VERT_POSN", 0x0264},
73862b4a29SBALATON Zoltan     {"CUR_HORZ_VERT_OFF", 0x0268},
74862b4a29SBALATON Zoltan     {"CUR_CLR0", 0x026c},
75862b4a29SBALATON Zoltan     {"CUR_CLR1", 0x0270},
76862b4a29SBALATON Zoltan     {"LVDS_GEN_CNTL", 0x02d0},
77862b4a29SBALATON Zoltan     {"DDA_CONFIG", 0x02e0},
78862b4a29SBALATON Zoltan     {"DDA_ON_OFF", 0x02e4},
79862b4a29SBALATON Zoltan     {"VGA_DDA_CONFIG", 0x02e8},
80862b4a29SBALATON Zoltan     {"VGA_DDA_ON_OFF", 0x02ec},
81862b4a29SBALATON Zoltan     {"CRTC2_H_TOTAL_DISP", 0x0300},
82862b4a29SBALATON Zoltan     {"CRTC2_H_SYNC_STRT_WID", 0x0304},
83862b4a29SBALATON Zoltan     {"CRTC2_V_TOTAL_DISP", 0x0308},
84862b4a29SBALATON Zoltan     {"CRTC2_V_SYNC_STRT_WID", 0x030c},
85862b4a29SBALATON Zoltan     {"CRTC2_VLINE_CRNT_VLINE", 0x0310},
86862b4a29SBALATON Zoltan     {"CRTC2_CRNT_FRAME", 0x0314},
87862b4a29SBALATON Zoltan     {"CRTC2_GUI_TRIG_VLINE", 0x0318},
88862b4a29SBALATON Zoltan     {"CRTC2_OFFSET", 0x0324},
89862b4a29SBALATON Zoltan     {"CRTC2_OFFSET_CNTL", 0x0328},
90862b4a29SBALATON Zoltan     {"CRTC2_PITCH", 0x032c},
91862b4a29SBALATON Zoltan     {"DDA2_CONFIG", 0x03e0},
92862b4a29SBALATON Zoltan     {"DDA2_ON_OFF", 0x03e4},
93862b4a29SBALATON Zoltan     {"CRTC2_GEN_CNTL", 0x03f8},
94862b4a29SBALATON Zoltan     {"CRTC2_STATUS", 0x03fc},
95862b4a29SBALATON Zoltan     {"OV0_SCALE_CNTL", 0x0420},
96862b4a29SBALATON Zoltan     {"SUBPIC_CNTL", 0x0540},
97862b4a29SBALATON Zoltan     {"PM4_BUFFER_OFFSET", 0x0700},
98862b4a29SBALATON Zoltan     {"PM4_BUFFER_CNTL", 0x0704},
99862b4a29SBALATON Zoltan     {"PM4_BUFFER_WM_CNTL", 0x0708},
100862b4a29SBALATON Zoltan     {"PM4_BUFFER_DL_RPTR_ADDR", 0x070c},
101862b4a29SBALATON Zoltan     {"PM4_BUFFER_DL_RPTR", 0x0710},
102862b4a29SBALATON Zoltan     {"PM4_BUFFER_DL_WPTR", 0x0714},
103862b4a29SBALATON Zoltan     {"PM4_VC_FPU_SETUP", 0x071c},
104862b4a29SBALATON Zoltan     {"PM4_FPU_CNTL", 0x0720},
105862b4a29SBALATON Zoltan     {"PM4_VC_FORMAT", 0x0724},
106862b4a29SBALATON Zoltan     {"PM4_VC_CNTL", 0x0728},
107862b4a29SBALATON Zoltan     {"PM4_VC_I01", 0x072c},
108862b4a29SBALATON Zoltan     {"PM4_VC_VLOFF", 0x0730},
109862b4a29SBALATON Zoltan     {"PM4_VC_VLSIZE", 0x0734},
110862b4a29SBALATON Zoltan     {"PM4_IW_INDOFF", 0x0738},
111862b4a29SBALATON Zoltan     {"PM4_IW_INDSIZE", 0x073c},
112862b4a29SBALATON Zoltan     {"PM4_FPU_FPX0", 0x0740},
113862b4a29SBALATON Zoltan     {"PM4_FPU_FPY0", 0x0744},
114862b4a29SBALATON Zoltan     {"PM4_FPU_FPX1", 0x0748},
115862b4a29SBALATON Zoltan     {"PM4_FPU_FPY1", 0x074c},
116862b4a29SBALATON Zoltan     {"PM4_FPU_FPX2", 0x0750},
117862b4a29SBALATON Zoltan     {"PM4_FPU_FPY2", 0x0754},
118862b4a29SBALATON Zoltan     {"PM4_FPU_FPY3", 0x0758},
119862b4a29SBALATON Zoltan     {"PM4_FPU_FPY4", 0x075c},
120862b4a29SBALATON Zoltan     {"PM4_FPU_FPY5", 0x0760},
121862b4a29SBALATON Zoltan     {"PM4_FPU_FPY6", 0x0764},
122862b4a29SBALATON Zoltan     {"PM4_FPU_FPR", 0x0768},
123862b4a29SBALATON Zoltan     {"PM4_FPU_FPG", 0x076c},
124862b4a29SBALATON Zoltan     {"PM4_FPU_FPB", 0x0770},
125862b4a29SBALATON Zoltan     {"PM4_FPU_FPA", 0x0774},
126862b4a29SBALATON Zoltan     {"PM4_FPU_INTXY0", 0x0780},
127862b4a29SBALATON Zoltan     {"PM4_FPU_INTXY1", 0x0784},
128862b4a29SBALATON Zoltan     {"PM4_FPU_INTXY2", 0x0788},
129862b4a29SBALATON Zoltan     {"PM4_FPU_INTARGB", 0x078c},
130862b4a29SBALATON Zoltan     {"PM4_FPU_FPTWICEAREA", 0x0790},
131862b4a29SBALATON Zoltan     {"PM4_FPU_DMAJOR01", 0x0794},
132862b4a29SBALATON Zoltan     {"PM4_FPU_DMAJOR12", 0x0798},
133862b4a29SBALATON Zoltan     {"PM4_FPU_DMAJOR02", 0x079c},
134862b4a29SBALATON Zoltan     {"PM4_FPU_STAT", 0x07a0},
135862b4a29SBALATON Zoltan     {"PM4_STAT", 0x07b8},
136862b4a29SBALATON Zoltan     {"PM4_TEST_CNTL", 0x07d0},
137862b4a29SBALATON Zoltan     {"PM4_MICROCODE_ADDR", 0x07d4},
138862b4a29SBALATON Zoltan     {"PM4_MICROCODE_RADDR", 0x07d8},
139862b4a29SBALATON Zoltan     {"PM4_MICROCODE_DATAH", 0x07dc},
140862b4a29SBALATON Zoltan     {"PM4_MICROCODE_DATAL", 0x07e0},
141862b4a29SBALATON Zoltan     {"PM4_CMDFIFO_ADDR", 0x07e4},
142862b4a29SBALATON Zoltan     {"PM4_CMDFIFO_DATAH", 0x07e8},
143862b4a29SBALATON Zoltan     {"PM4_CMDFIFO_DATAL", 0x07ec},
144862b4a29SBALATON Zoltan     {"PM4_BUFFER_ADDR", 0x07f0},
145862b4a29SBALATON Zoltan     {"PM4_BUFFER_DATAH", 0x07f4},
146862b4a29SBALATON Zoltan     {"PM4_BUFFER_DATAL", 0x07f8},
147862b4a29SBALATON Zoltan     {"PM4_MICRO_CNTL", 0x07fc},
148862b4a29SBALATON Zoltan     {"CAP0_TRIG_CNTL", 0x0950},
149862b4a29SBALATON Zoltan     {"CAP1_TRIG_CNTL", 0x09c0},
150862b4a29SBALATON Zoltan     {"RBBM_STATUS", 0x0e40},
151862b4a29SBALATON Zoltan     {"PM4_FIFO_DATA_EVEN", 0x1000},
152862b4a29SBALATON Zoltan     {"PM4_FIFO_DATA_ODD", 0x1004},
153862b4a29SBALATON Zoltan     {"DST_OFFSET", 0x1404},
154862b4a29SBALATON Zoltan     {"DST_PITCH", 0x1408},
155862b4a29SBALATON Zoltan     {"DST_WIDTH", 0x140c},
156862b4a29SBALATON Zoltan     {"DST_HEIGHT", 0x1410},
157862b4a29SBALATON Zoltan     {"SRC_X", 0x1414},
158862b4a29SBALATON Zoltan     {"SRC_Y", 0x1418},
159862b4a29SBALATON Zoltan     {"DST_X", 0x141c},
160862b4a29SBALATON Zoltan     {"DST_Y", 0x1420},
161862b4a29SBALATON Zoltan     {"SRC_PITCH_OFFSET", 0x1428},
162862b4a29SBALATON Zoltan     {"DST_PITCH_OFFSET", 0x142c},
163862b4a29SBALATON Zoltan     {"SRC_Y_X", 0x1434},
164862b4a29SBALATON Zoltan     {"DST_Y_X", 0x1438},
165862b4a29SBALATON Zoltan     {"DST_HEIGHT_WIDTH", 0x143c},
166862b4a29SBALATON Zoltan     {"DP_GUI_MASTER_CNTL", 0x146c},
167862b4a29SBALATON Zoltan     {"BRUSH_SCALE", 0x1470},
168862b4a29SBALATON Zoltan     {"BRUSH_Y_X", 0x1474},
169862b4a29SBALATON Zoltan     {"DP_BRUSH_BKGD_CLR", 0x1478},
170862b4a29SBALATON Zoltan     {"DP_BRUSH_FRGD_CLR", 0x147c},
171862b4a29SBALATON Zoltan     {"DST_WIDTH_X", 0x1588},
172862b4a29SBALATON Zoltan     {"DST_HEIGHT_WIDTH_8", 0x158c},
173862b4a29SBALATON Zoltan     {"SRC_X_Y", 0x1590},
174862b4a29SBALATON Zoltan     {"DST_X_Y", 0x1594},
175862b4a29SBALATON Zoltan     {"DST_WIDTH_HEIGHT", 0x1598},
176862b4a29SBALATON Zoltan     {"DST_WIDTH_X_INCY", 0x159c},
177862b4a29SBALATON Zoltan     {"DST_HEIGHT_Y", 0x15a0},
178862b4a29SBALATON Zoltan     {"DST_X_SUB", 0x15a4},
179862b4a29SBALATON Zoltan     {"DST_Y_SUB", 0x15a8},
180862b4a29SBALATON Zoltan     {"SRC_OFFSET", 0x15ac},
181862b4a29SBALATON Zoltan     {"SRC_PITCH", 0x15b0},
182862b4a29SBALATON Zoltan     {"DST_HEIGHT_WIDTH_BW", 0x15b4},
183862b4a29SBALATON Zoltan     {"CLR_CMP_CNTL", 0x15c0},
184862b4a29SBALATON Zoltan     {"CLR_CMP_CLR_SRC", 0x15c4},
185862b4a29SBALATON Zoltan     {"CLR_CMP_CLR_DST", 0x15c8},
186862b4a29SBALATON Zoltan     {"CLR_CMP_MASK", 0x15cc},
187862b4a29SBALATON Zoltan     {"DP_SRC_FRGD_CLR", 0x15d8},
188862b4a29SBALATON Zoltan     {"DP_SRC_BKGD_CLR", 0x15dc},
189862b4a29SBALATON Zoltan     {"DST_BRES_ERR", 0x1628},
190862b4a29SBALATON Zoltan     {"DST_BRES_INC", 0x162c},
191862b4a29SBALATON Zoltan     {"DST_BRES_DEC", 0x1630},
192862b4a29SBALATON Zoltan     {"DST_BRES_LNTH", 0x1634},
193862b4a29SBALATON Zoltan     {"DST_BRES_LNTH_SUB", 0x1638},
194862b4a29SBALATON Zoltan     {"SC_LEFT", 0x1640},
195862b4a29SBALATON Zoltan     {"SC_RIGHT", 0x1644},
196862b4a29SBALATON Zoltan     {"SC_TOP", 0x1648},
197862b4a29SBALATON Zoltan     {"SC_BOTTOM", 0x164c},
198862b4a29SBALATON Zoltan     {"SRC_SC_RIGHT", 0x1654},
199862b4a29SBALATON Zoltan     {"SRC_SC_BOTTOM", 0x165c},
200862b4a29SBALATON Zoltan     {"GUI_DEBUG0", 0x16a0},
201862b4a29SBALATON Zoltan     {"GUI_DEBUG1", 0x16a4},
202862b4a29SBALATON Zoltan     {"GUI_TIMEOUT", 0x16b0},
203862b4a29SBALATON Zoltan     {"GUI_TIMEOUT0", 0x16b4},
204862b4a29SBALATON Zoltan     {"GUI_TIMEOUT1", 0x16b8},
205862b4a29SBALATON Zoltan     {"GUI_PROBE", 0x16bc},
206862b4a29SBALATON Zoltan     {"DP_CNTL", 0x16c0},
207862b4a29SBALATON Zoltan     {"DP_DATATYPE", 0x16c4},
208862b4a29SBALATON Zoltan     {"DP_MIX", 0x16c8},
209862b4a29SBALATON Zoltan     {"DP_WRITE_MASK", 0x16cc},
210862b4a29SBALATON Zoltan     {"DP_CNTL_XDIR_YDIR_YMAJOR", 0x16d0},
211862b4a29SBALATON Zoltan     {"DEFAULT_OFFSET", 0x16e0},
212862b4a29SBALATON Zoltan     {"DEFAULT_PITCH", 0x16e4},
213862b4a29SBALATON Zoltan     {"DEFAULT_SC_BOTTOM_RIGHT", 0x16e8},
214862b4a29SBALATON Zoltan     {"SC_TOP_LEFT", 0x16ec},
215862b4a29SBALATON Zoltan     {"SC_BOTTOM_RIGHT", 0x16f0},
216862b4a29SBALATON Zoltan     {"SRC_SC_BOTTOM_RIGHT", 0x16f4},
217862b4a29SBALATON Zoltan     {"DST_TILE", 0x1700},
218862b4a29SBALATON Zoltan     {"WAIT_UNTIL", 0x1720},
219862b4a29SBALATON Zoltan     {"CACHE_CNTL", 0x1724},
220862b4a29SBALATON Zoltan     {"GUI_STAT", 0x1740},
221862b4a29SBALATON Zoltan     {"PC_GUI_MODE", 0x1744},
222862b4a29SBALATON Zoltan     {"PC_GUI_CTLSTAT", 0x1748},
223862b4a29SBALATON Zoltan     {"PC_DEBUG_MODE", 0x1760},
224862b4a29SBALATON Zoltan     {"BRES_DST_ERR_DEC", 0x1780},
225862b4a29SBALATON Zoltan     {"TRAIL_BRES_T12_ERR_DEC", 0x1784},
226862b4a29SBALATON Zoltan     {"TRAIL_BRES_T12_INC", 0x1788},
227862b4a29SBALATON Zoltan     {"DP_T12_CNTL", 0x178c},
228862b4a29SBALATON Zoltan     {"DST_BRES_T1_LNTH", 0x1790},
229862b4a29SBALATON Zoltan     {"DST_BRES_T2_LNTH", 0x1794},
230862b4a29SBALATON Zoltan     {"SCALE_SRC_HEIGHT_WIDTH", 0x1994},
231862b4a29SBALATON Zoltan     {"SCALE_OFFSET_0", 0x1998},
232862b4a29SBALATON Zoltan     {"SCALE_PITCH", 0x199c},
233862b4a29SBALATON Zoltan     {"SCALE_X_INC", 0x19a0},
234862b4a29SBALATON Zoltan     {"SCALE_Y_INC", 0x19a4},
235862b4a29SBALATON Zoltan     {"SCALE_HACC", 0x19a8},
236862b4a29SBALATON Zoltan     {"SCALE_VACC", 0x19ac},
237862b4a29SBALATON Zoltan     {"SCALE_DST_X_Y", 0x19b0},
238862b4a29SBALATON Zoltan     {"SCALE_DST_HEIGHT_WIDTH", 0x19b4},
239862b4a29SBALATON Zoltan     {"SCALE_3D_CNTL", 0x1a00},
240862b4a29SBALATON Zoltan     {"SCALE_3D_DATATYPE", 0x1a20},
241862b4a29SBALATON Zoltan     {"SETUP_CNTL", 0x1bc4},
242862b4a29SBALATON Zoltan     {"SOLID_COLOR", 0x1bc8},
243862b4a29SBALATON Zoltan     {"WINDOW_XY_OFFSET", 0x1bcc},
244862b4a29SBALATON Zoltan     {"DRAW_LINE_POINT", 0x1bd0},
245862b4a29SBALATON Zoltan     {"SETUP_CNTL_PM4", 0x1bd4},
246862b4a29SBALATON Zoltan     {"DST_PITCH_OFFSET_C", 0x1c80},
247862b4a29SBALATON Zoltan     {"DP_GUI_MASTER_CNTL_C", 0x1c84},
248862b4a29SBALATON Zoltan     {"SC_TOP_LEFT_C", 0x1c88},
249862b4a29SBALATON Zoltan     {"SC_BOTTOM_RIGHT_C", 0x1c8c},
250862b4a29SBALATON Zoltan     {"CLR_CMP_MASK_3D", 0x1A28},
251862b4a29SBALATON Zoltan     {"MISC_3D_STATE_CNTL_REG", 0x1CA0},
252862b4a29SBALATON Zoltan     {"MC_SRC1_CNTL", 0x19D8},
253862b4a29SBALATON Zoltan     {"TEX_CNTL", 0x1800},
254862b4a29SBALATON Zoltan     {"RAGE128_MPP_TB_CONFIG", 0x01c0},
255862b4a29SBALATON Zoltan     {NULL, -1}
256862b4a29SBALATON Zoltan };
257862b4a29SBALATON Zoltan 
ati_reg_name(int num)258862b4a29SBALATON Zoltan const char *ati_reg_name(int num)
259862b4a29SBALATON Zoltan {
260862b4a29SBALATON Zoltan     int i;
261862b4a29SBALATON Zoltan 
262862b4a29SBALATON Zoltan     num &= ~3;
263862b4a29SBALATON Zoltan     for (i = 0; ati_reg_names[i].name; i++) {
264862b4a29SBALATON Zoltan         if (ati_reg_names[i].num == num) {
265862b4a29SBALATON Zoltan             return ati_reg_names[i].name;
266862b4a29SBALATON Zoltan         }
267862b4a29SBALATON Zoltan     }
268862b4a29SBALATON Zoltan     return "unknown";
269862b4a29SBALATON Zoltan }
270862b4a29SBALATON Zoltan #else
ati_reg_name(int num)271862b4a29SBALATON Zoltan const char *ati_reg_name(int num)
272862b4a29SBALATON Zoltan {
273862b4a29SBALATON Zoltan     return "";
274862b4a29SBALATON Zoltan }
275862b4a29SBALATON Zoltan #endif
276