|
| 1 | +freedreno: enable Adreno 810+825+829 |
| 2 | + |
| 3 | +The source code is from whitebelyash: |
| 4 | +https://github.com/whitebelyash/mesa-tu8/commit/cce699c8b5423adf1ad60335356408767c6971aa |
| 5 | +https://github.com/whitebelyash/mesa-tu8/commit/6422f965fa26c384a139aa8e070ac37e5a4b3e96 |
| 6 | +https://github.com/whitebelyash/mesa-tu8/commit/16ada8f7816b9dcfb678136f48036880699027b3 |
| 7 | + |
| 8 | +diff --git a/src/freedreno/common/freedreno_devices.py b/src/freedreno/common/freedreno_devices.py |
| 9 | +index 5cbd5d11504..ebeaab440a4 100644 |
| 10 | +--- a/src/freedreno/common/freedreno_devices.py |
| 11 | ++++ b/src/freedreno/common/freedreno_devices.py |
| 12 | +@@ -1505,6 +1505,62 @@ a8xx_gen2 = GPUProps( |
| 13 | + has_salu_int_narrowing_quirk = True |
| 14 | + ) |
| 15 | + |
| 16 | ++a8xx_825 = GPUProps( |
| 17 | ++ sysmem_vpc_attr_buf_size = 131072, |
| 18 | ++ sysmem_vpc_pos_buf_size = 65536, |
| 19 | ++ sysmem_vpc_bv_pos_buf_size = 32768, |
| 20 | ++ sysmem_ccu_color_cache_fraction = CCUColorCacheFraction.FULL.value, |
| 21 | ++ sysmem_per_ccu_color_cache_size = 128 * 1024, |
| 22 | ++ sysmem_ccu_depth_cache_fraction = CCUColorCacheFraction.THREE_QUARTER.value, |
| 23 | ++ sysmem_per_ccu_depth_cache_size = 96 * 1024, # TODO: check if 128 works too |
| 24 | ++ gmem_vpc_attr_buf_size = 49152, |
| 25 | ++ gmem_vpc_pos_buf_size = 24576, |
| 26 | ++ gmem_vpc_bv_pos_buf_size = 32768, |
| 27 | ++ gmem_ccu_color_cache_fraction = CCUColorCacheFraction.EIGHTH.value, |
| 28 | ++ gmem_per_ccu_color_cache_size = 16 * 1024, |
| 29 | ++ gmem_ccu_depth_cache_fraction = CCUColorCacheFraction.FULL.value, |
| 30 | ++ gmem_per_ccu_depth_cache_size = 127 * 1024, |
| 31 | ++) |
| 32 | ++ |
| 33 | ++a8xx_810 = GPUProps( |
| 34 | ++ sysmem_vpc_attr_buf_size = 131072, |
| 35 | ++ sysmem_vpc_pos_buf_size = 65536, |
| 36 | ++ sysmem_vpc_bv_pos_buf_size = 32768, |
| 37 | ++ # These values are maximum size of depth/color cache for current A8XX Gen2 sysmem configuration |
| 38 | ++ # Bigger values cause an integer underflow in freedreno gmem calculations |
| 39 | ++ sysmem_ccu_color_cache_fraction = CCUColorCacheFraction.FULL.value, |
| 40 | ++ sysmem_per_ccu_color_cache_size = 32 * 1024, |
| 41 | ++ sysmem_ccu_depth_cache_fraction = CCUColorCacheFraction.THREE_QUARTER.value, |
| 42 | ++ sysmem_per_ccu_depth_cache_size = 32 * 1024, |
| 43 | ++ gmem_vpc_attr_buf_size = 49152, |
| 44 | ++ gmem_vpc_pos_buf_size = 24576, |
| 45 | ++ gmem_vpc_bv_pos_buf_size = 32768, |
| 46 | ++ gmem_ccu_color_cache_fraction = CCUColorCacheFraction.EIGHTH.value, |
| 47 | ++ gmem_per_ccu_color_cache_size = 16 * 1024, |
| 48 | ++ gmem_ccu_depth_cache_fraction = CCUColorCacheFraction.FULL.value, |
| 49 | ++ gmem_per_ccu_depth_cache_size = 64 * 1024, |
| 50 | ++ # FD810 does not support ray tracing |
| 51 | ++ has_ray_intersection = False, |
| 52 | ++ has_sw_fuse = False, |
| 53 | ++) |
| 54 | ++ |
| 55 | ++a8xx_829 = GPUProps( |
| 56 | ++ sysmem_vpc_attr_buf_size = 131072, |
| 57 | ++ sysmem_vpc_pos_buf_size = 65536, |
| 58 | ++ sysmem_vpc_bv_pos_buf_size = 32768, |
| 59 | ++ sysmem_ccu_color_cache_fraction = CCUColorCacheFraction.FULL.value, |
| 60 | ++ sysmem_per_ccu_color_cache_size = 128 * 1024, |
| 61 | ++ sysmem_ccu_depth_cache_fraction = CCUColorCacheFraction.THREE_QUARTER.value, |
| 62 | ++ sysmem_per_ccu_depth_cache_size = 96 * 1024, |
| 63 | ++ gmem_vpc_attr_buf_size = 49152, |
| 64 | ++ gmem_vpc_pos_buf_size = 24576, |
| 65 | ++ gmem_vpc_bv_pos_buf_size = 32768, |
| 66 | ++ gmem_ccu_color_cache_fraction = CCUColorCacheFraction.EIGHTH.value, |
| 67 | ++ gmem_per_ccu_color_cache_size = 16 * 1024, |
| 68 | ++ gmem_ccu_depth_cache_fraction = CCUColorCacheFraction.FULL.value, |
| 69 | ++ gmem_per_ccu_depth_cache_size = 127 * 1024, |
| 70 | ++) |
| 71 | ++ |
| 72 | + # For a8xx, the chicken bit and most other non-ctx reg |
| 73 | + # programming moves into the kernel, and what remains |
| 74 | + # should be easier to share between devices |
| 75 | +@@ -1563,6 +1619,72 @@ add_gpus([ |
| 76 | + raw_magic_regs = a8xx_gen2_raw_magic_regs, |
| 77 | + )) |
| 78 | + |
| 79 | ++# gen8_6_0 |
| 80 | ++add_gpus([ |
| 81 | ++ GPUId(chip_id=0x44030000, name="FD825"), |
| 82 | ++ ], A6xxGPUInfo( |
| 83 | ++ CHIP.A8XX, |
| 84 | ++ [a7xx_base, a7xx_gen3, a8xx_base, a8xx_825], |
| 85 | ++ num_ccu = 4, |
| 86 | ++ num_slices = 2, |
| 87 | ++ tile_align_w = 64, |
| 88 | ++ tile_align_h = 32, |
| 89 | ++ tile_max_w = 16384, |
| 90 | ++ tile_max_h = 16384, |
| 91 | ++ num_vsc_pipes = 32, |
| 92 | ++ cs_shared_mem_size = 32 * 1024, |
| 93 | ++ wave_granularity = 2, |
| 94 | ++ fibers_per_sp = 128 * 2 * 16, |
| 95 | ++ magic_regs = dict( |
| 96 | ++ ), |
| 97 | ++ raw_magic_regs = a8xx_gen2_raw_magic_regs, |
| 98 | ++ )) |
| 99 | ++ |
| 100 | ++# gen8_3_0 |
| 101 | ++add_gpus([ |
| 102 | ++ GPUId(chip_id=0x44010000, name="FD810"), |
| 103 | ++ ], A6xxGPUInfo( |
| 104 | ++ CHIP.A8XX, |
| 105 | ++ [a7xx_base, a7xx_gen3, a8xx_base, a8xx_810], |
| 106 | ++ num_ccu = 2, |
| 107 | ++ num_slices = 1, |
| 108 | ++ tile_align_w = 64, |
| 109 | ++ tile_align_h = 32, |
| 110 | ++ tile_max_w = 16384, |
| 111 | ++ tile_max_h = 16384, |
| 112 | ++ num_vsc_pipes = 32, |
| 113 | ++ cs_shared_mem_size = 32 * 1024, |
| 114 | ++ wave_granularity = 2, |
| 115 | ++ fibers_per_sp = 128 * 2 * 16, |
| 116 | ++ magic_regs = dict( |
| 117 | ++ ), |
| 118 | ++ raw_magic_regs = a8xx_gen2_raw_magic_regs, |
| 119 | ++ )) |
| 120 | ++ |
| 121 | ++# TODO: Properly fill all values for this GPU |
| 122 | ++# Very weird GPU, ugh.. |
| 123 | ++add_gpus([ |
| 124 | ++ GPUId(chip_id=0x44030A00, name="FD829"), # kgsl id??? |
| 125 | ++ GPUId(chip_id=0x44030A20, name="FD829"), # found by testing |
| 126 | ++ GPUId(chip_id=0xffff44030A00, name="FD829"), |
| 127 | ++ ], A6xxGPUInfo( |
| 128 | ++ CHIP.A8XX, |
| 129 | ++ [a7xx_base, a7xx_gen3, a8xx_base, a8xx_829,], |
| 130 | ++ num_ccu = 4, |
| 131 | ++ num_slices = 2, |
| 132 | ++ tile_align_w = 64, |
| 133 | ++ tile_align_h = 32, |
| 134 | ++ tile_max_w = 16384, |
| 135 | ++ tile_max_h = 16384, |
| 136 | ++ num_vsc_pipes = 32, |
| 137 | ++ cs_shared_mem_size = 32 * 1024, |
| 138 | ++ wave_granularity = 2, |
| 139 | ++ fibers_per_sp = 128 * 2 * 16, |
| 140 | ++ magic_regs = dict( |
| 141 | ++ ), |
| 142 | ++ raw_magic_regs = a8xx_gen2_raw_magic_regs, |
| 143 | ++ )) |
| 144 | ++ |
| 145 | + add_gpus([ |
| 146 | + GPUId(chip_id=0xffff44050A31, name="Adreno (TM) 840"), |
| 147 | + ], A6xxGPUInfo( |
| 148 | +diff --git a/src/freedreno/drm-shim/freedreno_noop.c b/src/freedreno/drm-shim/freedreno_noop.c |
| 149 | +index 73ac6162a04..8bc1dbde164 100644 |
| 150 | +--- a/src/freedreno/drm-shim/freedreno_noop.c |
| 151 | ++++ b/src/freedreno/drm-shim/freedreno_noop.c |
| 152 | +@@ -291,6 +291,16 @@ static const struct msm_device_info device_infos[] = { |
| 153 | + .chip_id = 0x44050001, |
| 154 | + .gmem_size = 12 * 1024 * 1024, |
| 155 | + }, |
| 156 | ++ { |
| 157 | ++ .gpu_id = 810, |
| 158 | ++ .chip_id = 0x44010000, |
| 159 | ++ .gmem_size = 576 * 1024, |
| 160 | ++ }, |
| 161 | ++ { |
| 162 | ++ .gpu_id = 829, |
| 163 | ++ .chip_id = 0x44030A20, |
| 164 | ++ .gmem_size = 2 * 1024 * 1024, |
| 165 | ++ }, |
| 166 | + }; |
| 167 | + |
| 168 | + static void |
0 commit comments