Commit 02b0795
drm: Force write-combined mappings for DMA
PCIe GPU device drivers may use normal cached mappings for DMA memory.
This requires the PCIe interface to be coherent with the CPU caches,
which is not supported by many Arm platforms (e.g. RK35xx), leading to
data corruption on inbound transactions.
Add an option to force write-combined mappings instead (Normal
non-cacheable on Arm).
Note that this is just a band-aid to keep the patch small. The TTM
allocator should frankly not be concerned with hardware limitations and
always pass the requested caching type (a driver could still use cached
memory and perform its own cache maintenance).
A proper solution would be for GPU drivers to check whether the device
supports coherency and request the appropriate caching type. The
drm_arch_can_wc_memory() helper also needs to be reworked or possibly
even dropped.
Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>1 parent eaadce9 commit 02b0795
3 files changed
+23
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
186 | 202 | | |
187 | 203 | | |
188 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
0 commit comments