]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit9c1288297ae2e791198610039ecac9222aea74ee
treea0ac8bcf97e5c6a5eb3fb89feee47c0723ebe7fc
parent9e69dd8ad5275247c5edd01d6194354c62f7f91c
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