Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/radeon/kms: add support for CP setup on SI

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Alex Deucher and committed by
Dave Airlie
48c0c902 8b074dd6

+607 -1
+1 -1
drivers/gpu/drm/radeon/Makefile
··· 71 71 r600_blit_kms.o radeon_pm.o atombios_dp.o r600_audio.o r600_hdmi.o \ 72 72 evergreen.o evergreen_cs.o evergreen_blit_shaders.o evergreen_blit_kms.o \ 73 73 radeon_trace_points.o ni.o cayman_blit_shaders.o atombios_encoders.o \ 74 - radeon_semaphore.o radeon_sa.o atombios_i2c.o si.o 74 + radeon_semaphore.o radeon_sa.o atombios_i2c.o si.o si_blit_shaders.o 75 75 76 76 radeon-$(CONFIG_COMPAT) += radeon_ioc32.o 77 77 radeon-$(CONFIG_VGA_SWITCHEROO) += radeon_atpx_handler.o
+267
drivers/gpu/drm/radeon/si.c
··· 31 31 #include "radeon_drm.h" 32 32 #include "sid.h" 33 33 #include "atom.h" 34 + #include "si_blit_shaders.h" 34 35 35 36 #define SI_PFP_UCODE_SIZE 2144 36 37 #define SI_PM4_UCODE_SIZE 2144 ··· 1860 1859 WREG32(PA_CL_ENHANCE, CLIP_VTX_REORDER_ENA | NUM_CLIP_SEQ(3)); 1861 1860 1862 1861 udelay(50); 1862 + } 1863 + 1864 + /* 1865 + * CP. 1866 + */ 1867 + static void si_cp_enable(struct radeon_device *rdev, bool enable) 1868 + { 1869 + if (enable) 1870 + WREG32(CP_ME_CNTL, 0); 1871 + else { 1872 + radeon_ttm_set_active_vram_size(rdev, rdev->mc.visible_vram_size); 1873 + WREG32(CP_ME_CNTL, (CP_ME_HALT | CP_PFP_HALT | CP_CE_HALT)); 1874 + WREG32(SCRATCH_UMSK, 0); 1875 + } 1876 + udelay(50); 1877 + } 1878 + 1879 + static int si_cp_load_microcode(struct radeon_device *rdev) 1880 + { 1881 + const __be32 *fw_data; 1882 + int i; 1883 + 1884 + if (!rdev->me_fw || !rdev->pfp_fw) 1885 + return -EINVAL; 1886 + 1887 + si_cp_enable(rdev, false); 1888 + 1889 + /* PFP */ 1890 + fw_data = (const __be32 *)rdev->pfp_fw->data; 1891 + WREG32(CP_PFP_UCODE_ADDR, 0); 1892 + for (i = 0; i < SI_PFP_UCODE_SIZE; i++) 1893 + WREG32(CP_PFP_UCODE_DATA, be32_to_cpup(fw_data++)); 1894 + WREG32(CP_PFP_UCODE_ADDR, 0); 1895 + 1896 + /* CE */ 1897 + fw_data = (const __be32 *)rdev->ce_fw->data; 1898 + WREG32(CP_CE_UCODE_ADDR, 0); 1899 + for (i = 0; i < SI_CE_UCODE_SIZE; i++) 1900 + WREG32(CP_CE_UCODE_DATA, be32_to_cpup(fw_data++)); 1901 + WREG32(CP_CE_UCODE_ADDR, 0); 1902 + 1903 + /* ME */ 1904 + fw_data = (const __be32 *)rdev->me_fw->data; 1905 + WREG32(CP_ME_RAM_WADDR, 0); 1906 + for (i = 0; i < SI_PM4_UCODE_SIZE; i++) 1907 + WREG32(CP_ME_RAM_DATA, be32_to_cpup(fw_data++)); 1908 + WREG32(CP_ME_RAM_WADDR, 0); 1909 + 1910 + WREG32(CP_PFP_UCODE_ADDR, 0); 1911 + WREG32(CP_CE_UCODE_ADDR, 0); 1912 + WREG32(CP_ME_RAM_WADDR, 0); 1913 + WREG32(CP_ME_RAM_RADDR, 0); 1914 + return 0; 1915 + } 1916 + 1917 + static int si_cp_start(struct radeon_device *rdev) 1918 + { 1919 + struct radeon_ring *ring = &rdev->ring[RADEON_RING_TYPE_GFX_INDEX]; 1920 + int r, i; 1921 + 1922 + r = radeon_ring_lock(rdev, ring, 7 + 4); 1923 + if (r) { 1924 + DRM_ERROR("radeon: cp failed to lock ring (%d).\n", r); 1925 + return r; 1926 + } 1927 + /* init the CP */ 1928 + radeon_ring_write(ring, PACKET3(PACKET3_ME_INITIALIZE, 5)); 1929 + radeon_ring_write(ring, 0x1); 1930 + radeon_ring_write(ring, 0x0); 1931 + radeon_ring_write(ring, rdev->config.si.max_hw_contexts - 1); 1932 + radeon_ring_write(ring, PACKET3_ME_INITIALIZE_DEVICE_ID(1)); 1933 + radeon_ring_write(ring, 0); 1934 + radeon_ring_write(ring, 0); 1935 + 1936 + /* init the CE partitions */ 1937 + radeon_ring_write(ring, PACKET3(PACKET3_SET_BASE, 2)); 1938 + radeon_ring_write(ring, PACKET3_BASE_INDEX(CE_PARTITION_BASE)); 1939 + radeon_ring_write(ring, 0xc000); 1940 + radeon_ring_write(ring, 0xe000); 1941 + radeon_ring_unlock_commit(rdev, ring); 1942 + 1943 + si_cp_enable(rdev, true); 1944 + 1945 + r = radeon_ring_lock(rdev, ring, si_default_size + 10); 1946 + if (r) { 1947 + DRM_ERROR("radeon: cp failed to lock ring (%d).\n", r); 1948 + return r; 1949 + } 1950 + 1951 + /* setup clear context state */ 1952 + radeon_ring_write(ring, PACKET3(PACKET3_PREAMBLE_CNTL, 0)); 1953 + radeon_ring_write(ring, PACKET3_PREAMBLE_BEGIN_CLEAR_STATE); 1954 + 1955 + for (i = 0; i < si_default_size; i++) 1956 + radeon_ring_write(ring, si_default_state[i]); 1957 + 1958 + radeon_ring_write(ring, PACKET3(PACKET3_PREAMBLE_CNTL, 0)); 1959 + radeon_ring_write(ring, PACKET3_PREAMBLE_END_CLEAR_STATE); 1960 + 1961 + /* set clear context state */ 1962 + radeon_ring_write(ring, PACKET3(PACKET3_CLEAR_STATE, 0)); 1963 + radeon_ring_write(ring, 0); 1964 + 1965 + radeon_ring_write(ring, PACKET3(PACKET3_SET_CONTEXT_REG, 2)); 1966 + radeon_ring_write(ring, 0x00000316); 1967 + radeon_ring_write(ring, 0x0000000e); /* VGT_VERTEX_REUSE_BLOCK_CNTL */ 1968 + radeon_ring_write(ring, 0x00000010); /* VGT_OUT_DEALLOC_CNTL */ 1969 + 1970 + radeon_ring_unlock_commit(rdev, ring); 1971 + 1972 + for (i = RADEON_RING_TYPE_GFX_INDEX; i <= CAYMAN_RING_TYPE_CP2_INDEX; ++i) { 1973 + ring = &rdev->ring[i]; 1974 + r = radeon_ring_lock(rdev, ring, 2); 1975 + 1976 + /* clear the compute context state */ 1977 + radeon_ring_write(ring, PACKET3_COMPUTE(PACKET3_CLEAR_STATE, 0)); 1978 + radeon_ring_write(ring, 0); 1979 + 1980 + radeon_ring_unlock_commit(rdev, ring); 1981 + } 1982 + 1983 + return 0; 1984 + } 1985 + 1986 + static void si_cp_fini(struct radeon_device *rdev) 1987 + { 1988 + si_cp_enable(rdev, false); 1989 + radeon_ring_fini(rdev, &rdev->ring[RADEON_RING_TYPE_GFX_INDEX]); 1990 + radeon_ring_fini(rdev, &rdev->ring[CAYMAN_RING_TYPE_CP1_INDEX]); 1991 + radeon_ring_fini(rdev, &rdev->ring[CAYMAN_RING_TYPE_CP2_INDEX]); 1992 + } 1993 + 1994 + static int si_cp_resume(struct radeon_device *rdev) 1995 + { 1996 + struct radeon_ring *ring; 1997 + u32 tmp; 1998 + u32 rb_bufsz; 1999 + int r; 2000 + 2001 + /* Reset cp; if cp is reset, then PA, SH, VGT also need to be reset */ 2002 + WREG32(GRBM_SOFT_RESET, (SOFT_RESET_CP | 2003 + SOFT_RESET_PA | 2004 + SOFT_RESET_VGT | 2005 + SOFT_RESET_SPI | 2006 + SOFT_RESET_SX)); 2007 + RREG32(GRBM_SOFT_RESET); 2008 + mdelay(15); 2009 + WREG32(GRBM_SOFT_RESET, 0); 2010 + RREG32(GRBM_SOFT_RESET); 2011 + 2012 + WREG32(CP_SEM_WAIT_TIMER, 0x0); 2013 + WREG32(CP_SEM_INCOMPLETE_TIMER_CNTL, 0x0); 2014 + 2015 + /* Set the write pointer delay */ 2016 + WREG32(CP_RB_WPTR_DELAY, 0); 2017 + 2018 + WREG32(CP_DEBUG, 0); 2019 + WREG32(SCRATCH_ADDR, ((rdev->wb.gpu_addr + RADEON_WB_SCRATCH_OFFSET) >> 8) & 0xFFFFFFFF); 2020 + 2021 + /* ring 0 - compute and gfx */ 2022 + /* Set ring buffer size */ 2023 + ring = &rdev->ring[RADEON_RING_TYPE_GFX_INDEX]; 2024 + rb_bufsz = drm_order(ring->ring_size / 8); 2025 + tmp = (drm_order(RADEON_GPU_PAGE_SIZE/8) << 8) | rb_bufsz; 2026 + #ifdef __BIG_ENDIAN 2027 + tmp |= BUF_SWAP_32BIT; 2028 + #endif 2029 + WREG32(CP_RB0_CNTL, tmp); 2030 + 2031 + /* Initialize the ring buffer's read and write pointers */ 2032 + WREG32(CP_RB0_CNTL, tmp | RB_RPTR_WR_ENA); 2033 + ring->wptr = 0; 2034 + WREG32(CP_RB0_WPTR, ring->wptr); 2035 + 2036 + /* set the wb address wether it's enabled or not */ 2037 + WREG32(CP_RB0_RPTR_ADDR, (rdev->wb.gpu_addr + RADEON_WB_CP_RPTR_OFFSET) & 0xFFFFFFFC); 2038 + WREG32(CP_RB0_RPTR_ADDR_HI, upper_32_bits(rdev->wb.gpu_addr + RADEON_WB_CP_RPTR_OFFSET) & 0xFF); 2039 + 2040 + if (rdev->wb.enabled) 2041 + WREG32(SCRATCH_UMSK, 0xff); 2042 + else { 2043 + tmp |= RB_NO_UPDATE; 2044 + WREG32(SCRATCH_UMSK, 0); 2045 + } 2046 + 2047 + mdelay(1); 2048 + WREG32(CP_RB0_CNTL, tmp); 2049 + 2050 + WREG32(CP_RB0_BASE, ring->gpu_addr >> 8); 2051 + 2052 + ring->rptr = RREG32(CP_RB0_RPTR); 2053 + 2054 + /* ring1 - compute only */ 2055 + /* Set ring buffer size */ 2056 + ring = &rdev->ring[CAYMAN_RING_TYPE_CP1_INDEX]; 2057 + rb_bufsz = drm_order(ring->ring_size / 8); 2058 + tmp = (drm_order(RADEON_GPU_PAGE_SIZE/8) << 8) | rb_bufsz; 2059 + #ifdef __BIG_ENDIAN 2060 + tmp |= BUF_SWAP_32BIT; 2061 + #endif 2062 + WREG32(CP_RB1_CNTL, tmp); 2063 + 2064 + /* Initialize the ring buffer's read and write pointers */ 2065 + WREG32(CP_RB1_CNTL, tmp | RB_RPTR_WR_ENA); 2066 + ring->wptr = 0; 2067 + WREG32(CP_RB1_WPTR, ring->wptr); 2068 + 2069 + /* set the wb address wether it's enabled or not */ 2070 + WREG32(CP_RB1_RPTR_ADDR, (rdev->wb.gpu_addr + RADEON_WB_CP1_RPTR_OFFSET) & 0xFFFFFFFC); 2071 + WREG32(CP_RB1_RPTR_ADDR_HI, upper_32_bits(rdev->wb.gpu_addr + RADEON_WB_CP1_RPTR_OFFSET) & 0xFF); 2072 + 2073 + mdelay(1); 2074 + WREG32(CP_RB1_CNTL, tmp); 2075 + 2076 + WREG32(CP_RB1_BASE, ring->gpu_addr >> 8); 2077 + 2078 + ring->rptr = RREG32(CP_RB1_RPTR); 2079 + 2080 + /* ring2 - compute only */ 2081 + /* Set ring buffer size */ 2082 + ring = &rdev->ring[CAYMAN_RING_TYPE_CP2_INDEX]; 2083 + rb_bufsz = drm_order(ring->ring_size / 8); 2084 + tmp = (drm_order(RADEON_GPU_PAGE_SIZE/8) << 8) | rb_bufsz; 2085 + #ifdef __BIG_ENDIAN 2086 + tmp |= BUF_SWAP_32BIT; 2087 + #endif 2088 + WREG32(CP_RB2_CNTL, tmp); 2089 + 2090 + /* Initialize the ring buffer's read and write pointers */ 2091 + WREG32(CP_RB2_CNTL, tmp | RB_RPTR_WR_ENA); 2092 + ring->wptr = 0; 2093 + WREG32(CP_RB2_WPTR, ring->wptr); 2094 + 2095 + /* set the wb address wether it's enabled or not */ 2096 + WREG32(CP_RB2_RPTR_ADDR, (rdev->wb.gpu_addr + RADEON_WB_CP2_RPTR_OFFSET) & 0xFFFFFFFC); 2097 + WREG32(CP_RB2_RPTR_ADDR_HI, upper_32_bits(rdev->wb.gpu_addr + RADEON_WB_CP2_RPTR_OFFSET) & 0xFF); 2098 + 2099 + mdelay(1); 2100 + WREG32(CP_RB2_CNTL, tmp); 2101 + 2102 + WREG32(CP_RB2_BASE, ring->gpu_addr >> 8); 2103 + 2104 + ring->rptr = RREG32(CP_RB2_RPTR); 2105 + 2106 + /* start the rings */ 2107 + si_cp_start(rdev); 2108 + rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready = true; 2109 + rdev->ring[CAYMAN_RING_TYPE_CP1_INDEX].ready = true; 2110 + rdev->ring[CAYMAN_RING_TYPE_CP2_INDEX].ready = true; 2111 + r = radeon_ring_test(rdev, RADEON_RING_TYPE_GFX_INDEX, &rdev->ring[RADEON_RING_TYPE_GFX_INDEX]); 2112 + if (r) { 2113 + rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ready = false; 2114 + rdev->ring[CAYMAN_RING_TYPE_CP1_INDEX].ready = false; 2115 + rdev->ring[CAYMAN_RING_TYPE_CP2_INDEX].ready = false; 2116 + return r; 2117 + } 2118 + r = radeon_ring_test(rdev, CAYMAN_RING_TYPE_CP1_INDEX, &rdev->ring[CAYMAN_RING_TYPE_CP1_INDEX]); 2119 + if (r) { 2120 + rdev->ring[CAYMAN_RING_TYPE_CP1_INDEX].ready = false; 2121 + } 2122 + r = radeon_ring_test(rdev, CAYMAN_RING_TYPE_CP2_INDEX, &rdev->ring[CAYMAN_RING_TYPE_CP2_INDEX]); 2123 + if (r) { 2124 + rdev->ring[CAYMAN_RING_TYPE_CP2_INDEX].ready = false; 2125 + } 2126 + 2127 + return 0; 1863 2128 } 1864 2129 1865 2130 bool si_gpu_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring)
+252
drivers/gpu/drm/radeon/si_blit_shaders.c
··· 1 + /* 2 + * Copyright 2011 Advanced Micro Devices, Inc. 3 + * 4 + * Permission is hereby granted, free of charge, to any person obtaining a 5 + * copy of this software and associated documentation files (the "Software"), 6 + * to deal in the Software without restriction, including without limitation 7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 + * and/or sell copies of the Software, and to permit persons to whom the 9 + * Software is furnished to do so, subject to the following conditions: 10 + * 11 + * The above copyright notice and this permission notice (including the next 12 + * paragraph) shall be included in all copies or substantial portions of the 13 + * Software. 14 + * 15 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 + * THE COPYRIGHT HOLDER(S) AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 19 + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 + * DEALINGS IN THE SOFTWARE. 22 + * 23 + * Authors: 24 + * Alex Deucher <alexander.deucher@amd.com> 25 + */ 26 + 27 + #include <linux/types.h> 28 + #include <linux/kernel.h> 29 + 30 + const u32 si_default_state[] = 31 + { 32 + 0xc0066900, 33 + 0x00000000, 34 + 0x00000060, /* DB_RENDER_CONTROL */ 35 + 0x00000000, /* DB_COUNT_CONTROL */ 36 + 0x00000000, /* DB_DEPTH_VIEW */ 37 + 0x0000002a, /* DB_RENDER_OVERRIDE */ 38 + 0x00000000, /* DB_RENDER_OVERRIDE2 */ 39 + 0x00000000, /* DB_HTILE_DATA_BASE */ 40 + 41 + 0xc0046900, 42 + 0x00000008, 43 + 0x00000000, /* DB_DEPTH_BOUNDS_MIN */ 44 + 0x00000000, /* DB_DEPTH_BOUNDS_MAX */ 45 + 0x00000000, /* DB_STENCIL_CLEAR */ 46 + 0x00000000, /* DB_DEPTH_CLEAR */ 47 + 48 + 0xc0036900, 49 + 0x0000000f, 50 + 0x00000000, /* DB_DEPTH_INFO */ 51 + 0x00000000, /* DB_Z_INFO */ 52 + 0x00000000, /* DB_STENCIL_INFO */ 53 + 54 + 0xc0016900, 55 + 0x00000080, 56 + 0x00000000, /* PA_SC_WINDOW_OFFSET */ 57 + 58 + 0xc00d6900, 59 + 0x00000083, 60 + 0x0000ffff, /* PA_SC_CLIPRECT_RULE */ 61 + 0x00000000, /* PA_SC_CLIPRECT_0_TL */ 62 + 0x20002000, /* PA_SC_CLIPRECT_0_BR */ 63 + 0x00000000, 64 + 0x20002000, 65 + 0x00000000, 66 + 0x20002000, 67 + 0x00000000, 68 + 0x20002000, 69 + 0xaaaaaaaa, /* PA_SC_EDGERULE */ 70 + 0x00000000, /* PA_SU_HARDWARE_SCREEN_OFFSET */ 71 + 0x0000000f, /* CB_TARGET_MASK */ 72 + 0x0000000f, /* CB_SHADER_MASK */ 73 + 74 + 0xc0226900, 75 + 0x00000094, 76 + 0x80000000, /* PA_SC_VPORT_SCISSOR_0_TL */ 77 + 0x20002000, /* PA_SC_VPORT_SCISSOR_0_BR */ 78 + 0x80000000, 79 + 0x20002000, 80 + 0x80000000, 81 + 0x20002000, 82 + 0x80000000, 83 + 0x20002000, 84 + 0x80000000, 85 + 0x20002000, 86 + 0x80000000, 87 + 0x20002000, 88 + 0x80000000, 89 + 0x20002000, 90 + 0x80000000, 91 + 0x20002000, 92 + 0x80000000, 93 + 0x20002000, 94 + 0x80000000, 95 + 0x20002000, 96 + 0x80000000, 97 + 0x20002000, 98 + 0x80000000, 99 + 0x20002000, 100 + 0x80000000, 101 + 0x20002000, 102 + 0x80000000, 103 + 0x20002000, 104 + 0x80000000, 105 + 0x20002000, 106 + 0x80000000, 107 + 0x20002000, 108 + 0x00000000, /* PA_SC_VPORT_ZMIN_0 */ 109 + 0x3f800000, /* PA_SC_VPORT_ZMAX_0 */ 110 + 111 + 0xc0026900, 112 + 0x000000d9, 113 + 0x00000000, /* CP_RINGID */ 114 + 0x00000000, /* CP_VMID */ 115 + 116 + 0xc0046900, 117 + 0x00000100, 118 + 0xffffffff, /* VGT_MAX_VTX_INDX */ 119 + 0x00000000, /* VGT_MIN_VTX_INDX */ 120 + 0x00000000, /* VGT_INDX_OFFSET */ 121 + 0x00000000, /* VGT_MULTI_PRIM_IB_RESET_INDX */ 122 + 123 + 0xc0046900, 124 + 0x00000105, 125 + 0x00000000, /* CB_BLEND_RED */ 126 + 0x00000000, /* CB_BLEND_GREEN */ 127 + 0x00000000, /* CB_BLEND_BLUE */ 128 + 0x00000000, /* CB_BLEND_ALPHA */ 129 + 130 + 0xc0016900, 131 + 0x000001e0, 132 + 0x00000000, /* CB_BLEND0_CONTROL */ 133 + 134 + 0xc00e6900, 135 + 0x00000200, 136 + 0x00000000, /* DB_DEPTH_CONTROL */ 137 + 0x00000000, /* DB_EQAA */ 138 + 0x00cc0010, /* CB_COLOR_CONTROL */ 139 + 0x00000210, /* DB_SHADER_CONTROL */ 140 + 0x00010000, /* PA_CL_CLIP_CNTL */ 141 + 0x00000004, /* PA_SU_SC_MODE_CNTL */ 142 + 0x00000100, /* PA_CL_VTE_CNTL */ 143 + 0x00000000, /* PA_CL_VS_OUT_CNTL */ 144 + 0x00000000, /* PA_CL_NANINF_CNTL */ 145 + 0x00000000, /* PA_SU_LINE_STIPPLE_CNTL */ 146 + 0x00000000, /* PA_SU_LINE_STIPPLE_SCALE */ 147 + 0x00000000, /* PA_SU_PRIM_FILTER_CNTL */ 148 + 0x00000000, /* */ 149 + 0x00000000, /* */ 150 + 151 + 0xc0116900, 152 + 0x00000280, 153 + 0x00000000, /* PA_SU_POINT_SIZE */ 154 + 0x00000000, /* PA_SU_POINT_MINMAX */ 155 + 0x00000008, /* PA_SU_LINE_CNTL */ 156 + 0x00000000, /* PA_SC_LINE_STIPPLE */ 157 + 0x00000000, /* VGT_OUTPUT_PATH_CNTL */ 158 + 0x00000000, /* VGT_HOS_CNTL */ 159 + 0x00000000, 160 + 0x00000000, 161 + 0x00000000, 162 + 0x00000000, 163 + 0x00000000, 164 + 0x00000000, 165 + 0x00000000, 166 + 0x00000000, 167 + 0x00000000, 168 + 0x00000000, 169 + 0x00000000, /* VGT_GS_MODE */ 170 + 171 + 0xc0026900, 172 + 0x00000292, 173 + 0x00000000, /* PA_SC_MODE_CNTL_0 */ 174 + 0x00000000, /* PA_SC_MODE_CNTL_1 */ 175 + 176 + 0xc0016900, 177 + 0x000002a1, 178 + 0x00000000, /* VGT_PRIMITIVEID_EN */ 179 + 180 + 0xc0016900, 181 + 0x000002a5, 182 + 0x00000000, /* VGT_MULTI_PRIM_IB_RESET_EN */ 183 + 184 + 0xc0026900, 185 + 0x000002a8, 186 + 0x00000000, /* VGT_INSTANCE_STEP_RATE_0 */ 187 + 0x00000000, 188 + 189 + 0xc0026900, 190 + 0x000002ad, 191 + 0x00000000, /* VGT_REUSE_OFF */ 192 + 0x00000000, 193 + 194 + 0xc0016900, 195 + 0x000002d5, 196 + 0x00000000, /* VGT_SHADER_STAGES_EN */ 197 + 198 + 0xc0016900, 199 + 0x000002dc, 200 + 0x0000aa00, /* DB_ALPHA_TO_MASK */ 201 + 202 + 0xc0066900, 203 + 0x000002de, 204 + 0x00000000, /* PA_SU_POLY_OFFSET_DB_FMT_CNTL */ 205 + 0x00000000, 206 + 0x00000000, 207 + 0x00000000, 208 + 0x00000000, 209 + 0x00000000, 210 + 211 + 0xc0026900, 212 + 0x000002e5, 213 + 0x00000000, /* VGT_STRMOUT_CONFIG */ 214 + 0x00000000, 215 + 216 + 0xc01b6900, 217 + 0x000002f5, 218 + 0x76543210, /* PA_SC_CENTROID_PRIORITY_0 */ 219 + 0xfedcba98, /* PA_SC_CENTROID_PRIORITY_1 */ 220 + 0x00000000, /* PA_SC_LINE_CNTL */ 221 + 0x00000000, /* PA_SC_AA_CONFIG */ 222 + 0x00000005, /* PA_SU_VTX_CNTL */ 223 + 0x3f800000, /* PA_CL_GB_VERT_CLIP_ADJ */ 224 + 0x3f800000, /* PA_CL_GB_VERT_DISC_ADJ */ 225 + 0x3f800000, /* PA_CL_GB_HORZ_CLIP_ADJ */ 226 + 0x3f800000, /* PA_CL_GB_HORZ_DISC_ADJ */ 227 + 0x00000000, /* PA_SC_AA_SAMPLE_LOCS_PIXEL_X0Y0_0 */ 228 + 0x00000000, 229 + 0x00000000, 230 + 0x00000000, 231 + 0x00000000, 232 + 0x00000000, 233 + 0x00000000, 234 + 0x00000000, 235 + 0x00000000, 236 + 0x00000000, 237 + 0x00000000, 238 + 0x00000000, 239 + 0x00000000, 240 + 0x00000000, 241 + 0x00000000, 242 + 0x00000000, 243 + 0xffffffff, /* PA_SC_AA_MASK_X0Y0_X1Y0 */ 244 + 0xffffffff, 245 + 246 + 0xc0026900, 247 + 0x00000316, 248 + 0x0000000e, /* VGT_VERTEX_REUSE_BLOCK_CNTL */ 249 + 0x00000010, /* */ 250 + }; 251 + 252 + const u32 si_default_size = ARRAY_SIZE(si_default_state);
+32
drivers/gpu/drm/radeon/si_blit_shaders.h
··· 1 + /* 2 + * Copyright 2011 Advanced Micro Devices, Inc. 3 + * 4 + * Permission is hereby granted, free of charge, to any person obtaining a 5 + * copy of this software and associated documentation files (the "Software"), 6 + * to deal in the Software without restriction, including without limitation 7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 + * and/or sell copies of the Software, and to permit persons to whom the 9 + * Software is furnished to do so, subject to the following conditions: 10 + * 11 + * The above copyright notice and this permission notice (including the next 12 + * paragraph) shall be included in all copies or substantial portions of the 13 + * Software. 14 + * 15 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 + * THE COPYRIGHT HOLDER(S) AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 19 + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 + * DEALINGS IN THE SOFTWARE. 22 + * 23 + */ 24 + 25 + #ifndef SI_BLIT_SHADERS_H 26 + #define SI_BLIT_SHADERS_H 27 + 28 + extern const u32 si_default_state[]; 29 + 30 + extern const u32 si_default_size; 31 + 32 + #endif
+55
drivers/gpu/drm/radeon/sid.h
··· 273 273 274 274 #define GRBM_GFX_INDEX 0x802C 275 275 276 + #define SCRATCH_REG0 0x8500 277 + #define SCRATCH_REG1 0x8504 278 + #define SCRATCH_REG2 0x8508 279 + #define SCRATCH_REG3 0x850C 280 + #define SCRATCH_REG4 0x8510 281 + #define SCRATCH_REG5 0x8514 282 + #define SCRATCH_REG6 0x8518 283 + #define SCRATCH_REG7 0x851C 284 + 285 + #define SCRATCH_UMSK 0x8540 286 + #define SCRATCH_ADDR 0x8544 287 + 288 + #define CP_SEM_WAIT_TIMER 0x85BC 289 + 290 + #define CP_SEM_INCOMPLETE_TIMER_CNTL 0x85C8 291 + 276 292 #define CP_ME_CNTL 0x86D8 277 293 #define CP_CE_HALT (1 << 24) 278 294 #define CP_PFP_HALT (1 << 26) 279 295 #define CP_ME_HALT (1 << 28) 280 296 297 + #define CP_RB2_RPTR 0x86f8 298 + #define CP_RB1_RPTR 0x86fc 281 299 #define CP_RB0_RPTR 0x8700 300 + #define CP_RB_WPTR_DELAY 0x8704 282 301 283 302 #define CP_QUEUE_THRESHOLDS 0x8760 284 303 #define ROQ_IB1_START(x) ((x) << 0) ··· 477 458 #define TCP_CHAN_STEER_LO 0xac0c 478 459 #define TCP_CHAN_STEER_HI 0xac10 479 460 461 + #define CP_RB0_BASE 0xC100 462 + #define CP_RB0_CNTL 0xC104 463 + #define RB_BUFSZ(x) ((x) << 0) 464 + #define RB_BLKSZ(x) ((x) << 8) 465 + #define BUF_SWAP_32BIT (2 << 16) 466 + #define RB_NO_UPDATE (1 << 27) 467 + #define RB_RPTR_WR_ENA (1 << 31) 468 + 469 + #define CP_RB0_RPTR_ADDR 0xC10C 470 + #define CP_RB0_RPTR_ADDR_HI 0xC110 471 + #define CP_RB0_WPTR 0xC114 472 + 473 + #define CP_PFP_UCODE_ADDR 0xC150 474 + #define CP_PFP_UCODE_DATA 0xC154 475 + #define CP_ME_RAM_RADDR 0xC158 476 + #define CP_ME_RAM_WADDR 0xC15C 477 + #define CP_ME_RAM_DATA 0xC160 478 + 479 + #define CP_CE_UCODE_ADDR 0xC168 480 + #define CP_CE_UCODE_DATA 0xC16C 481 + 482 + #define CP_RB1_BASE 0xC180 483 + #define CP_RB1_CNTL 0xC184 484 + #define CP_RB1_RPTR_ADDR 0xC188 485 + #define CP_RB1_RPTR_ADDR_HI 0xC18C 486 + #define CP_RB1_WPTR 0xC190 487 + #define CP_RB2_BASE 0xC194 488 + #define CP_RB2_CNTL 0xC198 489 + #define CP_RB2_RPTR_ADDR 0xC19C 490 + #define CP_RB2_RPTR_ADDR_HI 0xC1A0 491 + #define CP_RB2_WPTR 0xC1A4 492 + 493 + #define CP_DEBUG 0xC1FC 494 + 480 495 /* 481 496 * PM4 482 497 */ ··· 535 482 #define PACKET3(op, n) ((PACKET_TYPE3 << 30) | \ 536 483 (((op) & 0xFF) << 8) | \ 537 484 ((n) & 0x3FFF) << 16) 485 + 486 + #define PACKET3_COMPUTE(op, n) (PACKET3(op, n) | 1 << 1) 538 487 539 488 /* Packet 3 types */ 540 489 #define PACKET3_NOP 0x10