drm/ingenic: Add option to alloc cached GEM buffers
authorPaul Cercueil <paul@crapouillou.net>
Sun, 23 May 2021 17:04:15 +0000 (18:04 +0100)
committerPaul Cercueil <paul@crapouillou.net>
Tue, 25 May 2021 10:42:53 +0000 (11:42 +0100)
commit4a791cb6d34f42ef9aa7a65f2ba5aa19644c53a7
treefe27ea3843cf0efd1c33fb37620331dc684c8478
parentb09069046d6b7df1deea02cc14dc893e5e96630a
drm/ingenic: Add option to alloc cached GEM buffers

Alloc GEM buffers backed by noncoherent memory on SoCs where it is
actually faster than write-combine.

This dramatically speeds up software rendering on these SoCs, even for
tasks where write-combine memory should in theory be faster (e.g. simple
blits).

v3: The option is now selected per-SoC instead of being a module
    parameter.

v5: - Fix drm_atomic_get_new_plane_state() used to retrieve the old
      state
    - Use custom drm_gem_fb_create()
    - Only check damage clips and sync DMA buffers if non-coherent
      buffers are used

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210523170415.90410-4-paul@crapouillou.net
drivers/gpu/drm/ingenic/ingenic-drm-drv.c
drivers/gpu/drm/ingenic/ingenic-drm.h
drivers/gpu/drm/ingenic/ingenic-ipu.c