Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2016 Advanced Micro Devices, Inc.
0003  *
0004  * Permission is hereby granted, free of charge, to any person obtaining a
0005  * copy of this software and associated documentation files (the "Software"),
0006  * to deal in the Software without restriction, including without limitation
0007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0008  * and/or sell copies of the Software, and to permit persons to whom the
0009  * Software is furnished to do so, subject to the following conditions:
0010  *
0011  * The above copyright notice and this permission notice shall be included in
0012  * all copies or substantial portions of the Software.
0013  *
0014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0017  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
0018  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
0019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0020  * OTHER DEALINGS IN THE SOFTWARE.
0021  *
0022  */
0023 #ifndef SI_ENUMS_H
0024 #define SI_ENUMS_H
0025 
0026 #define VBLANK_INT_MASK                (1 << 0)
0027 #define DC_HPDx_INT_EN                 (1 << 16)
0028 #define VBLANK_ACK                     (1 << 4)
0029 #define VLINE_ACK                      (1 << 4)
0030 
0031 #define CURSOR_WIDTH 64
0032 #define CURSOR_HEIGHT 64
0033 
0034 #define VGA_VSTATUS_CNTL               0xFFFCFFFF
0035 #define PRIORITY_MARK_MASK             0x7fff
0036 #define PRIORITY_OFF                   (1 << 16)
0037 #define PRIORITY_ALWAYS_ON             (1 << 20)
0038 #define INTERLEAVE_EN                  (1 << 0)
0039 
0040 #define LATENCY_WATERMARK_MASK(x)      ((x) << 16)
0041 #define DC_LB_MEMORY_CONFIG(x)         ((x) << 20)
0042 #define ICON_DEGAMMA_MODE(x)           (((x) & 0x3) << 8)
0043 
0044 #define GRPH_ENDIAN_SWAP(x)            (((x) & 0x3) << 0)
0045 #define GRPH_ENDIAN_NONE               0
0046 #define GRPH_ENDIAN_8IN16              1
0047 #define GRPH_ENDIAN_8IN32              2
0048 #define GRPH_ENDIAN_8IN64              3
0049 #define GRPH_RED_CROSSBAR(x)           (((x) & 0x3) << 4)
0050 #define GRPH_RED_SEL_R                 0
0051 #define GRPH_RED_SEL_G                 1
0052 #define GRPH_RED_SEL_B                 2
0053 #define GRPH_RED_SEL_A                 3
0054 #define GRPH_GREEN_CROSSBAR(x)         (((x) & 0x3) << 6)
0055 #define GRPH_GREEN_SEL_G               0
0056 #define GRPH_GREEN_SEL_B               1
0057 #define GRPH_GREEN_SEL_A               2
0058 #define GRPH_GREEN_SEL_R               3
0059 #define GRPH_BLUE_CROSSBAR(x)          (((x) & 0x3) << 8)
0060 #define GRPH_BLUE_SEL_B                0
0061 #define GRPH_BLUE_SEL_A                1
0062 #define GRPH_BLUE_SEL_R                2
0063 #define GRPH_BLUE_SEL_G                3
0064 #define GRPH_ALPHA_CROSSBAR(x)         (((x) & 0x3) << 10)
0065 #define GRPH_ALPHA_SEL_A               0
0066 #define GRPH_ALPHA_SEL_R               1
0067 #define GRPH_ALPHA_SEL_G               2
0068 #define GRPH_ALPHA_SEL_B               3
0069 
0070 #define GRPH_DEPTH(x)                  (((x) & 0x3) << 0)
0071 #define GRPH_DEPTH_8BPP                0
0072 #define GRPH_DEPTH_16BPP               1
0073 #define GRPH_DEPTH_32BPP               2
0074 
0075 #define GRPH_FORMAT(x)                 (((x) & 0x7) << 8)
0076 #define GRPH_FORMAT_INDEXED            0
0077 #define GRPH_FORMAT_ARGB1555           0
0078 #define GRPH_FORMAT_ARGB565            1
0079 #define GRPH_FORMAT_ARGB4444           2
0080 #define GRPH_FORMAT_AI88               3
0081 #define GRPH_FORMAT_MONO16             4
0082 #define GRPH_FORMAT_BGRA5551           5
0083 #define GRPH_FORMAT_ARGB8888           0
0084 #define GRPH_FORMAT_ARGB2101010        1
0085 #define GRPH_FORMAT_32BPP_DIG          2
0086 #define GRPH_FORMAT_8B_ARGB2101010     3
0087 #define GRPH_FORMAT_BGRA1010102        4
0088 #define GRPH_FORMAT_8B_BGRA1010102     5
0089 #define GRPH_FORMAT_RGB111110          6
0090 #define GRPH_FORMAT_BGR101111          7
0091 
0092 #define GRPH_NUM_BANKS(x)              (((x) & 0x3) << 2)
0093 #define GRPH_ARRAY_MODE(x)             (((x) & 0x7) << 20)
0094 #define GRPH_ARRAY_LINEAR_GENERAL      0
0095 #define GRPH_ARRAY_LINEAR_ALIGNED      1
0096 #define GRPH_ARRAY_1D_TILED_THIN1      2
0097 #define GRPH_ARRAY_2D_TILED_THIN1      4
0098 #define GRPH_TILE_SPLIT(x)             (((x) & 0x7) << 13)
0099 #define GRPH_BANK_WIDTH(x)             (((x) & 0x3) << 6)
0100 #define GRPH_BANK_HEIGHT(x)            (((x) & 0x3) << 11)
0101 #define GRPH_MACRO_TILE_ASPECT(x)      (((x) & 0x3) << 18)
0102 #define GRPH_ARRAY_MODE(x)             (((x) & 0x7) << 20)
0103 #define GRPH_PIPE_CONFIG(x)                   (((x) & 0x1f) << 24)
0104 
0105 #define CURSOR_EN                      (1 << 0)
0106 #define CURSOR_MODE(x)                 (((x) & 0x3) << 8)
0107 #define CURSOR_MONO                    0
0108 #define CURSOR_24_1                    1
0109 #define CURSOR_24_8_PRE_MULT           2
0110 #define CURSOR_24_8_UNPRE_MULT         3
0111 #define CURSOR_2X_MAGNIFY              (1 << 16)
0112 #define CURSOR_FORCE_MC_ON             (1 << 20)
0113 #define CURSOR_URGENT_CONTROL(x)       (((x) & 0x7) << 24)
0114 #define CURSOR_URGENT_ALWAYS           0
0115 #define CURSOR_URGENT_1_8              1
0116 #define CURSOR_URGENT_1_4              2
0117 #define CURSOR_URGENT_3_8              3
0118 #define CURSOR_URGENT_1_2              4
0119 #define CURSOR_UPDATE_PENDING          (1 << 0)
0120 #define CURSOR_UPDATE_TAKEN            (1 << 1)
0121 #define CURSOR_UPDATE_LOCK             (1 << 16)
0122 #define CURSOR_DISABLE_MULTIPLE_UPDATE (1 << 24)
0123 
0124 #define SI_CRTC0_REGISTER_OFFSET                0
0125 #define SI_CRTC1_REGISTER_OFFSET                0x300
0126 #define SI_CRTC2_REGISTER_OFFSET                0x2600
0127 #define SI_CRTC3_REGISTER_OFFSET                0x2900
0128 #define SI_CRTC4_REGISTER_OFFSET                0x2c00
0129 #define SI_CRTC5_REGISTER_OFFSET                0x2f00
0130 
0131 #define DMA0_REGISTER_OFFSET 0x000
0132 #define DMA1_REGISTER_OFFSET 0x200
0133 #define ES_AND_GS_AUTO       3
0134 #define RADEON_PACKET_TYPE3  3
0135 #define CE_PARTITION_BASE    3
0136 #define BUF_SWAP_32BIT       (2 << 16)
0137 
0138 #define GFX_POWER_STATUS                           (1 << 1)
0139 #define GFX_CLOCK_STATUS                           (1 << 2)
0140 #define GFX_LS_STATUS                              (1 << 3)
0141 #define RLC_BUSY_STATUS                            (1 << 0)
0142 
0143 #define RLC_PUD(x)                               ((x) << 0)
0144 #define RLC_PUD_MASK                             (0xff << 0)
0145 #define RLC_PDD(x)                               ((x) << 8)
0146 #define RLC_PDD_MASK                             (0xff << 8)
0147 #define RLC_TTPD(x)                              ((x) << 16)
0148 #define RLC_TTPD_MASK                            (0xff << 16)
0149 #define RLC_MSD(x)                               ((x) << 24)
0150 #define RLC_MSD_MASK                             (0xff << 24)
0151 #define WRITE_DATA_ENGINE_SEL(x) ((x) << 30)
0152 #define WRITE_DATA_DST_SEL(x) ((x) << 8)
0153 #define EVENT_TYPE(x) ((x) << 0)
0154 #define EVENT_INDEX(x) ((x) << 8)
0155 #define WAIT_REG_MEM_MEM_SPACE(x)               ((x) << 4)
0156 #define WAIT_REG_MEM_FUNCTION(x)                ((x) << 0)
0157 #define WAIT_REG_MEM_ENGINE(x)                  ((x) << 8)
0158 
0159 #define GFX6_NUM_GFX_RINGS     1
0160 #define GFX6_NUM_COMPUTE_RINGS 2
0161 #define RLC_SAVE_AND_RESTORE_STARTING_OFFSET 0x90
0162 #define RLC_CLEAR_STATE_DESCRIPTOR_OFFSET    0x3D
0163 
0164 #define TAHITI_GB_ADDR_CONFIG_GOLDEN        0x12011003
0165 #define VERDE_GB_ADDR_CONFIG_GOLDEN         0x02010002
0166 #define HAINAN_GB_ADDR_CONFIG_GOLDEN        0x02011003
0167 
0168 #define PACKET3(op, n)  ((RADEON_PACKET_TYPE3 << 30) |                  \
0169                          (((op) & 0xFF) << 8) |                         \
0170                          ((n) & 0x3FFF) << 16)
0171 #define PACKET3_COMPUTE(op, n) (PACKET3(op, n) | 1 << 1)
0172 #define PACKET3_NOP                 0x10
0173 #define PACKET3_SET_BASE                0x11
0174 #define     PACKET3_BASE_INDEX(x)                  ((x) << 0)
0175 #define PACKET3_CLEAR_STATE             0x12
0176 #define PACKET3_INDEX_BUFFER_SIZE           0x13
0177 #define PACKET3_DISPATCH_DIRECT             0x15
0178 #define PACKET3_DISPATCH_INDIRECT           0x16
0179 #define PACKET3_ALLOC_GDS               0x1B
0180 #define PACKET3_WRITE_GDS_RAM               0x1C
0181 #define PACKET3_ATOMIC_GDS              0x1D
0182 #define PACKET3_ATOMIC                  0x1E
0183 #define PACKET3_OCCLUSION_QUERY             0x1F
0184 #define PACKET3_SET_PREDICATION             0x20
0185 #define PACKET3_REG_RMW                 0x21
0186 #define PACKET3_COND_EXEC               0x22
0187 #define PACKET3_PRED_EXEC               0x23
0188 #define PACKET3_DRAW_INDIRECT               0x24
0189 #define PACKET3_DRAW_INDEX_INDIRECT         0x25
0190 #define PACKET3_INDEX_BASE              0x26
0191 #define PACKET3_DRAW_INDEX_2                0x27
0192 #define PACKET3_CONTEXT_CONTROL             0x28
0193 #define PACKET3_INDEX_TYPE              0x2A
0194 #define PACKET3_DRAW_INDIRECT_MULTI         0x2C
0195 #define PACKET3_DRAW_INDEX_AUTO             0x2D
0196 #define PACKET3_DRAW_INDEX_IMMD             0x2E
0197 #define PACKET3_NUM_INSTANCES               0x2F
0198 #define PACKET3_DRAW_INDEX_MULTI_AUTO           0x30
0199 #define PACKET3_INDIRECT_BUFFER_CONST           0x31
0200 #define PACKET3_INDIRECT_BUFFER             0x3F
0201 #define PACKET3_STRMOUT_BUFFER_UPDATE           0x34
0202 #define PACKET3_DRAW_INDEX_OFFSET_2         0x35
0203 #define PACKET3_DRAW_INDEX_MULTI_ELEMENT        0x36
0204 #define PACKET3_WRITE_DATA              0x37
0205 #define PACKET3_DRAW_INDEX_INDIRECT_MULTI       0x38
0206 #define PACKET3_MEM_SEMAPHORE               0x39
0207 #define PACKET3_MPEG_INDEX              0x3A
0208 #define PACKET3_COPY_DW                 0x3B
0209 #define PACKET3_WAIT_REG_MEM                0x3C
0210 #define PACKET3_MEM_WRITE               0x3D
0211 #define PACKET3_COPY_DATA               0x40
0212 #define PACKET3_CP_DMA                  0x41
0213 #              define PACKET3_CP_DMA_DST_SEL(x)    ((x) << 20)
0214 #              define PACKET3_CP_DMA_ENGINE(x)     ((x) << 27)
0215 #              define PACKET3_CP_DMA_SRC_SEL(x)    ((x) << 29)
0216 #              define PACKET3_CP_DMA_CP_SYNC       (1 << 31)
0217 #              define PACKET3_CP_DMA_DIS_WC        (1 << 21)
0218 #              define PACKET3_CP_DMA_CMD_SRC_SWAP(x) ((x) << 22)
0219 #              define PACKET3_CP_DMA_CMD_DST_SWAP(x) ((x) << 24)
0220 #              define PACKET3_CP_DMA_CMD_SAS       (1 << 26)
0221 #              define PACKET3_CP_DMA_CMD_DAS       (1 << 27)
0222 #              define PACKET3_CP_DMA_CMD_SAIC      (1 << 28)
0223 #              define PACKET3_CP_DMA_CMD_DAIC      (1 << 29)
0224 #              define PACKET3_CP_DMA_CMD_RAW_WAIT  (1 << 30)
0225 #define PACKET3_PFP_SYNC_ME             0x42
0226 #define PACKET3_SURFACE_SYNC                0x43
0227 #              define PACKET3_DEST_BASE_0_ENA      (1 << 0)
0228 #              define PACKET3_DEST_BASE_1_ENA      (1 << 1)
0229 #              define PACKET3_CB0_DEST_BASE_ENA    (1 << 6)
0230 #              define PACKET3_CB1_DEST_BASE_ENA    (1 << 7)
0231 #              define PACKET3_CB2_DEST_BASE_ENA    (1 << 8)
0232 #              define PACKET3_CB3_DEST_BASE_ENA    (1 << 9)
0233 #              define PACKET3_CB4_DEST_BASE_ENA    (1 << 10)
0234 #              define PACKET3_CB5_DEST_BASE_ENA    (1 << 11)
0235 #              define PACKET3_CB6_DEST_BASE_ENA    (1 << 12)
0236 #              define PACKET3_CB7_DEST_BASE_ENA    (1 << 13)
0237 #              define PACKET3_DB_DEST_BASE_ENA     (1 << 14)
0238 #              define PACKET3_DEST_BASE_2_ENA      (1 << 19)
0239 #              define PACKET3_DEST_BASE_3_ENA      (1 << 21)
0240 #              define PACKET3_TCL1_ACTION_ENA      (1 << 22)
0241 #              define PACKET3_TC_ACTION_ENA        (1 << 23)
0242 #              define PACKET3_CB_ACTION_ENA        (1 << 25)
0243 #              define PACKET3_DB_ACTION_ENA        (1 << 26)
0244 #              define PACKET3_SH_KCACHE_ACTION_ENA (1 << 27)
0245 #              define PACKET3_SH_ICACHE_ACTION_ENA (1 << 29)
0246 #define PACKET3_ME_INITIALIZE               0x44
0247 #define     PACKET3_ME_INITIALIZE_DEVICE_ID(x) ((x) << 16)
0248 #define PACKET3_COND_WRITE              0x45
0249 #define PACKET3_EVENT_WRITE             0x46
0250 #define PACKET3_EVENT_WRITE_EOP             0x47
0251 #define PACKET3_EVENT_WRITE_EOS             0x48
0252 #define PACKET3_PREAMBLE_CNTL               0x4A
0253 #              define PACKET3_PREAMBLE_BEGIN_CLEAR_STATE     (2 << 28)
0254 #              define PACKET3_PREAMBLE_END_CLEAR_STATE       (3 << 28)
0255 #define PACKET3_ONE_REG_WRITE               0x57
0256 #define PACKET3_LOAD_CONFIG_REG             0x5F
0257 #define PACKET3_LOAD_CONTEXT_REG            0x60
0258 #define PACKET3_LOAD_SH_REG             0x61
0259 #define PACKET3_SET_CONFIG_REG              0x68
0260 #define     PACKET3_SET_CONFIG_REG_START            0x00002000
0261 #define     PACKET3_SET_CONFIG_REG_END          0x00002c00
0262 #define PACKET3_SET_CONTEXT_REG             0x69
0263 #define     PACKET3_SET_CONTEXT_REG_START           0x000a000
0264 #define     PACKET3_SET_CONTEXT_REG_END         0x000a400
0265 #define PACKET3_SET_CONTEXT_REG_INDIRECT        0x73
0266 #define PACKET3_SET_RESOURCE_INDIRECT           0x74
0267 #define PACKET3_SET_SH_REG              0x76
0268 #define     PACKET3_SET_SH_REG_START            0x00002c00
0269 #define     PACKET3_SET_SH_REG_END              0x00003000
0270 #define PACKET3_SET_SH_REG_OFFSET           0x77
0271 #define PACKET3_ME_WRITE                0x7A
0272 #define PACKET3_SCRATCH_RAM_WRITE           0x7D
0273 #define PACKET3_SCRATCH_RAM_READ            0x7E
0274 #define PACKET3_CE_WRITE                0x7F
0275 #define PACKET3_LOAD_CONST_RAM              0x80
0276 #define PACKET3_WRITE_CONST_RAM             0x81
0277 #define PACKET3_WRITE_CONST_RAM_OFFSET          0x82
0278 #define PACKET3_DUMP_CONST_RAM              0x83
0279 #define PACKET3_INCREMENT_CE_COUNTER            0x84
0280 #define PACKET3_INCREMENT_DE_COUNTER            0x85
0281 #define PACKET3_WAIT_ON_CE_COUNTER          0x86
0282 #define PACKET3_WAIT_ON_DE_COUNTER          0x87
0283 #define PACKET3_WAIT_ON_DE_COUNTER_DIFF         0x88
0284 #define PACKET3_SET_CE_DE_COUNTERS          0x89
0285 #define PACKET3_WAIT_ON_AVAIL_BUFFER            0x8A
0286 #define PACKET3_SWITCH_BUFFER               0x8B
0287 #define PACKET3_SEM_WAIT_ON_SIGNAL    (0x1 << 12)
0288 #define PACKET3_SEM_SEL_SIGNAL      (0x6 << 29)
0289 #define PACKET3_SEM_SEL_WAIT        (0x7 << 29)
0290 
0291 #endif