OSDN Git Service

drm/ingenic: Alloc F0 and F1 DMA descriptors at once
authorPaul Cercueil <paul@crapouillou.net>
Sat, 26 Sep 2020 17:04:57 +0000 (19:04 +0200)
committerPaul Cercueil <paul@crapouillou.net>
Sat, 26 Sep 2020 19:54:26 +0000 (21:54 +0200)
commit174d8e52a60f196cfbdec299688cf14f124c8b67
treea0ac8bcf97e5c6a5eb3fb89feee47c0723ebe7fc
parent1677d31c226683236dd80f49e2eea0e6cee08a51
drm/ingenic: Alloc F0 and F1 DMA descriptors at once

Instead of calling dmam_alloc_coherent() once for each 4-bit DMA
hardware descriptor, we can have them both in a physical memory page, as
long as they are aligned to 16 bytes. This reduces memory consumption,
and will make it easier to add more DMA descriptors in the future.

Note that the old code would not create the F0 descriptor on SoCs that
don't support multiple planes. We don't care, because:
- we don't use more memory by allocating two descriptors instead of a
  single one;
- the only SoC that does not support multiple planes (JZ4740) still has
  two independent DMA channels, for an unknown reason.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200926170501.1109197-4-paul@crapouillou.net
drivers/gpu/drm/ingenic/ingenic-drm-drv.c