mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-03 12:36:46 +07:00
8f93e043d0
In zap_shader_load_mdt(), we pass a pointer to a phys_addr_t into dmam_alloc_coherent, which the compiler warns about: drivers/gpu/drm/msm/adreno/a5xx_gpu.c: In function 'zap_shader_load_mdt': drivers/gpu/drm/msm/adreno/a5xx_gpu.c:54:50: error: passing argument 3 of 'dmam_alloc_coherent' from incompatible pointer type [-Werror=incompatible-pointer-types] The returned DMA address is later passed on to a function that takes a phys_addr_t, so it's clearly wrong to use the DMA mapping interface here: the memory may be uncached, or the address may be completely wrong if there is an IOMMU connected to the device. What the code actually wants to do is to get the physical address from the reserved-mem node. It goes through the dma-mapping interfaces for obscure reasons, and this apparently only works by chance, relying on specific bugs in the error handling of the arm64 dma-mapping implementation. The same problem existed in the "venus" media driver, which was now fixed by Stanimir Varbanov after long discussions. In order to make some progress here, I have now ported his approach over to the adreno driver. The patch is currently untested, and should get a good review, but it is now much simpler than the original, and it should be obvious what goes wrong if I made a mistake in the port. See also: |
||
---|---|---|
.. | ||
a2xx.xml.h | ||
a3xx_gpu.c | ||
a3xx_gpu.h | ||
a3xx.xml.h | ||
a4xx_gpu.c | ||
a4xx_gpu.h | ||
a4xx.xml.h | ||
a5xx_gpu.c | ||
a5xx_gpu.h | ||
a5xx_power.c | ||
a5xx.xml.h | ||
adreno_common.xml.h | ||
adreno_device.c | ||
adreno_gpu.c | ||
adreno_gpu.h | ||
adreno_pm4.xml.h |