linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] msm/gpu/a6xx: use the DMA-API for GMU memory allocations
@ 2020-02-20 18:26 Jordan Crouse
  2020-02-20 18:26 ` [PATCH v2 1/4] dt-bindings: display: msm: Convert GMU bindings to YAML Jordan Crouse
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Jordan Crouse @ 2020-02-20 18:26 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: smasetty, John Stultz, Bjorn Andersson, Sean Paul, devicetree,
	Stephen Boyd, Douglas Anderson, linux-kernel, dri-devel,
	Rob Herring, Rob Clark, David Airlie, Andy Gross, Mark Rutland,
	freedreno, Daniel Vetter


When CONFIG_INIT_ON_ALLOC_DEFAULT_ON the GMU memory allocator runs afoul of
cache coherency issues because it is mapped as write-combine without clearing
the cache after it was zeroed.

Rather than duplicate the hacky workaround we use in the GEM allocator for the
same reason it turns out that we don't need to have a bespoke memory allocator
for the GMU anyway. It uses a flat, global address space and there are only
two relatively minor allocations anyway. In short, this is essentially what the
DMA API was created for so replace a bunch of memory management code with two
calls to allocate and free DMA memory and we're fine.

The only wrinkle is that the memory allocations need to be in a very specific
location in the GMU virtual address space so in order to get the iova allocator
to do the right thing we need to specify the dma-ranges property in the device
tree for the GMU node. Since we've not yet converted the GMU bindings over to
YAML two patches quickly turn into four but at the end of it we have at least
one bindings file converted to YAML and 99 less lines of code to worry about.

v2: Fix the example bindings for dma-ranges - the third item is the size
Pass false to of_dma_configure so that it fails probe if the DMA region is not
set up.

Jordan Crouse (4):
  dt-bindings: display: msm: Convert GMU bindings to YAML
  dt-bindings: display: msm: Add required dma-range property
  arm64: dts: sdm845: Set the virtual address range for GMU allocations
  drm/msm/a6xx: Use the DMA API for GMU memory objects

 .../devicetree/bindings/display/msm/gmu.txt        | 116 -----------------
 .../devicetree/bindings/display/msm/gmu.yaml       | 140 +++++++++++++++++++++
 arch/arm64/boot/dts/qcom/sdm845.dtsi               |   2 +
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c              | 112 ++---------------
 drivers/gpu/drm/msm/adreno/a6xx_gmu.h              |   5 +-
 5 files changed, 153 insertions(+), 222 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/display/msm/gmu.txt
 create mode 100644 Documentation/devicetree/bindings/display/msm/gmu.yaml

-- 
2.7.4

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-02-26 16:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20 18:26 [PATCH v2 0/4] msm/gpu/a6xx: use the DMA-API for GMU memory allocations Jordan Crouse
2020-02-20 18:26 ` [PATCH v2 1/4] dt-bindings: display: msm: Convert GMU bindings to YAML Jordan Crouse
2020-02-26 16:33   ` Rob Herring
2020-02-20 18:26 ` [PATCH v2 2/4] dt-bindings: display: msm: Add required dma-range property Jordan Crouse
2020-02-25 18:55   ` Rob Herring
2020-02-20 18:26 ` [PATCH v2 3/4] arm64: dts: sdm845: Set the virtual address range for GMU allocations Jordan Crouse
2020-02-20 18:26 ` [PATCH v2 4/4] drm/msm/a6xx: Use the DMA API for GMU memory objects Jordan Crouse
2020-02-25 23:54   ` John Stultz
2020-02-26  0:59     ` Rob Clark
2020-02-21  0:19 ` [PATCH v2 0/4] msm/gpu/a6xx: use the DMA-API for GMU memory allocations John Stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).