1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * Copyright 2008 Corbin Simpson <MostAwesomeDude@gmail.com>
3bf215546Sopenharmony_ci *
4bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
5bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
6bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation
7bf215546Sopenharmony_ci * on the rights to use, copy, modify, merge, publish, distribute, sub
8bf215546Sopenharmony_ci * license, and/or sell copies of the Software, and to permit persons to whom
9bf215546Sopenharmony_ci * the Software is furnished to do so, subject to the following conditions:
10bf215546Sopenharmony_ci *
11bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the next
12bf215546Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the
13bf215546Sopenharmony_ci * Software.
14bf215546Sopenharmony_ci *
15bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18bf215546Sopenharmony_ci * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19bf215546Sopenharmony_ci * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20bf215546Sopenharmony_ci * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21bf215546Sopenharmony_ci * USE OR OTHER DEALINGS IN THE SOFTWARE. */
22bf215546Sopenharmony_ci
23bf215546Sopenharmony_ci#ifndef R300_CHIPSET_H
24bf215546Sopenharmony_ci#define R300_CHIPSET_H
25bf215546Sopenharmony_ci
26bf215546Sopenharmony_ci#include "pipe/p_compiler.h"
27bf215546Sopenharmony_ci
28bf215546Sopenharmony_ci/* these are sizes in dwords */
29bf215546Sopenharmony_ci#define R300_HIZ_LIMIT 10240
30bf215546Sopenharmony_ci#define RV530_HIZ_LIMIT 15360
31bf215546Sopenharmony_ci
32bf215546Sopenharmony_ci/* rv3xx have only one pipe */
33bf215546Sopenharmony_ci#define PIPE_ZMASK_SIZE 4096
34bf215546Sopenharmony_ci#define RV3xx_ZMASK_SIZE 5120
35bf215546Sopenharmony_ci
36bf215546Sopenharmony_ci/* The size of a compressed tile. Each compressed tile takes 2 bits
37bf215546Sopenharmony_ci * in the ZMASK RAM, so there is always 16 tiles per one dword. */
38bf215546Sopenharmony_cienum r300_zmask_compression {
39bf215546Sopenharmony_ci   R300_ZCOMP_4X4 = 4,
40bf215546Sopenharmony_ci   R300_ZCOMP_8X8 = 8
41bf215546Sopenharmony_ci};
42bf215546Sopenharmony_ci
43bf215546Sopenharmony_ci/* Structure containing all the possible information about a specific Radeon
44bf215546Sopenharmony_ci * in the R3xx, R4xx, and R5xx families. */
45bf215546Sopenharmony_cistruct r300_capabilities {
46bf215546Sopenharmony_ci    /* Chipset family */
47bf215546Sopenharmony_ci    int family;
48bf215546Sopenharmony_ci    /* The number of vertex floating-point units */
49bf215546Sopenharmony_ci    unsigned num_vert_fpus;
50bf215546Sopenharmony_ci    /* The number of texture units. */
51bf215546Sopenharmony_ci    unsigned num_tex_units;
52bf215546Sopenharmony_ci    /* Whether or not TCL is physically present */
53bf215546Sopenharmony_ci    boolean has_tcl;
54bf215546Sopenharmony_ci    /* Some chipsets do not have HiZ RAM - other have varying amounts. */
55bf215546Sopenharmony_ci    int hiz_ram;
56bf215546Sopenharmony_ci    /* Some chipsets have zmask ram per pipe some don't. */
57bf215546Sopenharmony_ci    int zmask_ram;
58bf215546Sopenharmony_ci    /* CMASK is for MSAA colorbuffer compression and fast clear. */
59bf215546Sopenharmony_ci    boolean has_cmask;
60bf215546Sopenharmony_ci    /* Compression mode for ZMASK. */
61bf215546Sopenharmony_ci    enum r300_zmask_compression z_compress;
62bf215546Sopenharmony_ci    /* Whether or not this is RV350 or newer, including all r400 and r500
63bf215546Sopenharmony_ci     * chipsets. The differences compared to the oldest r300 chips are:
64bf215546Sopenharmony_ci     * - Blend LTE/GTE thresholds
65bf215546Sopenharmony_ci     * - Better MACRO_SWITCH in texture tiling
66bf215546Sopenharmony_ci     * - Half float vertex
67bf215546Sopenharmony_ci     * - More HyperZ optimizations */
68bf215546Sopenharmony_ci    boolean is_rv350;
69bf215546Sopenharmony_ci    /* Whether or not this is R400. The differences compared their rv350
70bf215546Sopenharmony_ci     * cousins are:
71bf215546Sopenharmony_ci     * - Extended fragment shader registers
72bf215546Sopenharmony_ci     * - 3DC texture compression (RGTC2) */
73bf215546Sopenharmony_ci    boolean is_r400;
74bf215546Sopenharmony_ci    /* Whether or not this is an RV515 or newer; R500s have many differences
75bf215546Sopenharmony_ci     * that require extra consideration, compared to their rv350 cousins:
76bf215546Sopenharmony_ci     * - Extra bit of width and height on texture sizes
77bf215546Sopenharmony_ci     * - Blend color is split across two registers
78bf215546Sopenharmony_ci     * - Universal Shader (US) block used for fragment shaders
79bf215546Sopenharmony_ci     * - FP16 blending and multisampling
80bf215546Sopenharmony_ci     * - Full RGTC texture compression
81bf215546Sopenharmony_ci     * - 24-bit depth textures
82bf215546Sopenharmony_ci     * - Stencil back-face reference value
83bf215546Sopenharmony_ci     * - Ability to render up to 2^24 - 1 vertices with signed index offset */
84bf215546Sopenharmony_ci    boolean is_r500;
85bf215546Sopenharmony_ci    /* Whether or not the second pixel pipe is accessed with the high bit */
86bf215546Sopenharmony_ci    boolean high_second_pipe;
87bf215546Sopenharmony_ci    /* DXTC texture swizzling. */
88bf215546Sopenharmony_ci    boolean dxtc_swizzle;
89bf215546Sopenharmony_ci    /* Whether R500_US_FORMAT0_0 exists (R520-only and depends on DRM). */
90bf215546Sopenharmony_ci    boolean has_us_format;
91bf215546Sopenharmony_ci};
92bf215546Sopenharmony_ci
93bf215546Sopenharmony_civoid r300_parse_chipset(uint32_t pci_id, struct r300_capabilities* caps);
94bf215546Sopenharmony_ci
95bf215546Sopenharmony_ci#endif /* R300_CHIPSET_H */
96