2 * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
3 * Copyright 2011 Marek Olšák <maraeo@gmail.com>
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * on the rights to use, copy, modify, merge, publish, distribute, sub
9 * license, and/or sell copies of the Software, and to permit persons to whom
10 * the Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22 * USE OR OTHER DEALINGS IN THE SOFTWARE. */
24 #include "r300_chipset.h"
26 #include "util/u_debug.h"
30 /* r300_chipset: A file all to itself for deducing the various properties of
33 /* Parse a PCI ID and fill an r300_capabilities struct with information. */
34 void r300_parse_chipset(struct r300_capabilities
* caps
)
36 switch (caps
->pci_id
) {
37 #define CHIPSET(pci_id, name, chipfamily) \
39 caps->family = CHIP_FAMILY_##chipfamily; \
41 #include "pci_ids/r300_pci_ids.h"
45 fprintf(stderr
, "r300: Warning: Unknown chipset 0x%x\nAborting...",
51 caps
->high_second_pipe
= FALSE
;
52 caps
->num_vert_fpus
= 0;
57 switch (caps
->family
) {
58 case CHIP_FAMILY_R300
:
59 case CHIP_FAMILY_R350
:
60 caps
->high_second_pipe
= TRUE
;
61 caps
->num_vert_fpus
= 4;
62 caps
->hiz_ram
= R300_HIZ_LIMIT
;
63 caps
->zmask_ram
= PIPE_ZMASK_SIZE
;
66 case CHIP_FAMILY_RV350
:
67 case CHIP_FAMILY_RV370
:
68 caps
->high_second_pipe
= TRUE
;
69 caps
->num_vert_fpus
= 2;
70 caps
->zmask_ram
= RV3xx_ZMASK_SIZE
;
73 case CHIP_FAMILY_RV380
:
74 caps
->high_second_pipe
= TRUE
;
75 caps
->num_vert_fpus
= 2;
76 caps
->hiz_ram
= R300_HIZ_LIMIT
;
77 caps
->zmask_ram
= RV3xx_ZMASK_SIZE
;
80 case CHIP_FAMILY_RS400
:
81 case CHIP_FAMILY_RS600
:
82 case CHIP_FAMILY_RS690
:
83 case CHIP_FAMILY_RS740
:
86 case CHIP_FAMILY_RC410
:
87 case CHIP_FAMILY_RS480
:
88 caps
->zmask_ram
= RV3xx_ZMASK_SIZE
;
91 case CHIP_FAMILY_R420
:
92 case CHIP_FAMILY_R423
:
93 case CHIP_FAMILY_R430
:
94 case CHIP_FAMILY_R480
:
95 case CHIP_FAMILY_R481
:
96 case CHIP_FAMILY_RV410
:
97 caps
->num_vert_fpus
= 6;
98 caps
->hiz_ram
= R300_HIZ_LIMIT
;
99 caps
->zmask_ram
= PIPE_ZMASK_SIZE
;
102 case CHIP_FAMILY_R520
:
103 caps
->num_vert_fpus
= 8;
104 caps
->hiz_ram
= R300_HIZ_LIMIT
;
105 caps
->zmask_ram
= PIPE_ZMASK_SIZE
;
108 case CHIP_FAMILY_RV515
:
109 caps
->num_vert_fpus
= 2;
110 caps
->hiz_ram
= R300_HIZ_LIMIT
;
111 caps
->zmask_ram
= PIPE_ZMASK_SIZE
;
114 case CHIP_FAMILY_RV530
:
115 caps
->num_vert_fpus
= 5;
116 caps
->hiz_ram
= RV530_HIZ_LIMIT
;
117 caps
->zmask_ram
= PIPE_ZMASK_SIZE
;
120 case CHIP_FAMILY_R580
:
121 case CHIP_FAMILY_RV560
:
122 case CHIP_FAMILY_RV570
:
123 caps
->num_vert_fpus
= 8;
124 caps
->hiz_ram
= RV530_HIZ_LIMIT
;
125 caps
->zmask_ram
= PIPE_ZMASK_SIZE
;
129 caps
->num_tex_units
= 16;
130 caps
->is_r400
= caps
->family
>= CHIP_FAMILY_R420
&& caps
->family
< CHIP_FAMILY_RV515
;
131 caps
->is_r500
= caps
->family
>= CHIP_FAMILY_RV515
;
132 caps
->is_rv350
= caps
->family
>= CHIP_FAMILY_RV350
;
133 caps
->z_compress
= caps
->is_rv350
? R300_ZCOMP_8X8
: R300_ZCOMP_4X4
;
134 caps
->dxtc_swizzle
= caps
->is_r400
|| caps
->is_r500
;
135 caps
->has_us_format
= caps
->family
== CHIP_FAMILY_R520
;
136 caps
->has_tcl
= caps
->num_vert_fpus
> 0;
139 caps
->has_tcl
= debug_get_bool_option("RADEON_NO_TCL", FALSE
) ? FALSE
: TRUE
;