linux/drivers/gpu/drm/msm
Arnd Bergmann 8f93e043d0 drm/msm: gpu: don't abuse dma_alloc for non-DMA allocations
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: a6e2d36bf6 ("media: venus: don't abuse dma_alloc for non-DMA allocations")
Cc: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Fixes: 7c65817e6d ("drm/msm: gpu: Enable zap shader for A5XX")
Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-and-Tested-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2017-08-01 19:39:00 -04:00
..
adreno drm/msm: gpu: don't abuse dma_alloc for non-DMA allocations 2017-08-01 19:39:00 -04:00
dsi drm/msm/dsi: Calculate link clock rates with updated dsi->lanes 2017-08-01 16:26:01 -04:00
edp drm/msm: update generated headers 2017-06-16 11:16:07 -04:00
hdmi drm/msm/hdmi: Fix HDMI pink strip issue seen on 8x96 2017-06-16 11:16:09 -04:00
mdp drm/msm/mdp5: Drop clock names with "_clk" suffix 2017-08-01 18:50:00 -04:00
Kconfig drm/msm: gpu: call qcom_mdt interfaces only for ARCH_QCOM 2017-08-01 19:25:51 -04:00
Makefile drm/msm: fix include notation and remove -Iinclude/drm flag 2017-05-17 14:35:54 +02:00
msm_atomic.c drm/msm/mdp5: Add cursor planes 2017-02-06 11:28:44 -05:00
msm_debugfs.c drm/msm/gpu: use pm-runtime 2017-04-08 06:59:31 -04:00
msm_debugfs.h drm/msm: Remove msm_debugfs_cleanup() 2017-03-08 11:24:45 +01:00
msm_drv.c drm/msm: Separate locking of buffer resources from struct_mutex 2017-06-17 08:03:07 -04:00
msm_drv.h drm/msm: Separate locking of buffer resources from struct_mutex 2017-06-17 08:03:07 -04:00
msm_fb.c drm/msm: pass address-space to _get_iova() and friends 2017-06-16 11:16:04 -04:00
msm_fbdev.c drm/msm: Separate locking of buffer resources from struct_mutex 2017-06-17 08:03:07 -04:00
msm_fence.c drm/msm: Reuse dma_fence_release. 2017-05-27 13:48:26 -04:00
msm_fence.h dma-buf: Rename struct fence to dma_fence 2016-10-25 14:40:39 +02:00
msm_gem_prime.c drm/msm: Expose our reservation object when exporting a dmabuf. 2017-05-27 13:48:26 -04:00
msm_gem_shrinker.c drm/msm: Separate locking of buffer resources from struct_mutex 2017-06-17 08:03:07 -04:00
msm_gem_submit.c drm/msm: args->fence should be args->flags 2017-08-01 19:11:28 -04:00
msm_gem_vma.c drm/msm: NULL pointer dereference in drivers/gpu/drm/msm/msm_gem_vma.c 2017-08-01 18:41:16 -04:00
msm_gem.c drm/msm: fix WARN_ON in add_vma() with no iommu 2017-08-01 18:39:35 -04:00
msm_gem.h drm/msm: Separate locking of buffer resources from struct_mutex 2017-06-17 08:03:07 -04:00
msm_gpu.c drm/msm: Separate locking of buffer resources from struct_mutex 2017-06-17 08:03:07 -04:00
msm_gpu.h drm/msm: remove address-space id 2017-06-16 11:16:06 -04:00
msm_iommu.c drm/msm: pm runtime support for iommu 2017-04-08 06:59:31 -04:00
msm_kms.h drm/msm: remove address-space id 2017-06-16 11:16:06 -04:00
msm_mmu.h drm/msm: let gpu wire up it's own fault handler 2017-02-06 11:28:42 -05:00
msm_perf.c drm/msm: Remove msm_debugfs_cleanup() 2017-03-08 11:24:45 +01:00
msm_rd.c drm/msm: Separate locking of buffer resources from struct_mutex 2017-06-17 08:03:07 -04:00
msm_ringbuffer.c drm/msm: Separate locking of buffer resources from struct_mutex 2017-06-17 08:03:07 -04:00
msm_ringbuffer.h
NOTES