aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/virtio
diff options
context:
space:
mode:
authorPaul Cercueil <paul@crapouillou.net>2020-09-12 21:56:39 +0200
committerPaul Cercueil <paul@crapouillou.net>2020-09-15 01:32:26 +0200
commit37054fc81443cc6a8c3a38395f384412b8373d82 (patch)
tree675a8ee5d85d2b9d0f41a1f36ef14c7e6ca6a590 /drivers/gpu/drm/virtio
parentdrm/i915: Drop the drm_atomic_helper_calc_timestamping_constants() call (diff)
downloadlinux-dev-37054fc81443cc6a8c3a38395f384412b8373d82.tar.xz
linux-dev-37054fc81443cc6a8c3a38395f384412b8373d82.zip
gpu/drm: ingenic: Add option to mmap GEM buffers cached
Ingenic SoCs are most notably used in cheap chinese handheld gaming consoles. There, the games and applications generally render in software directly into GEM buffers. Traditionally, GEM buffers are mapped write-combine. Writes to the buffer are accelerated, and reads are slow. Application doing lots of alpha-blending paint inside shadow buffers, which is then memcpy'd into the final GEM buffer. On recent Ingenic SoCs however, it is much faster to have a fully cached GEM buffer, in which applications paint directly, and whose data is invalidated before scanout, than having a write-combine GEM buffer, even when alpha blending is not used. Add an optional 'cached_gem_buffers' parameter to the ingenic-drm driver to allow GEM buffers to be mapped fully-cached, in order to speed up software rendering. v2: Use standard noncoherent DMA APIs v3: Use damage clips instead of invalidating full frames v4: Avoid dma_pgprot() which is not exported. Using vm_get_page_prot() is enough in this case. v5: - Avoid calling drm_gem_cma_prime_mmap(). It has the side effect that an extra object reference is obtained, which causes our dumb buffers to never be freed. It should have been drm_gem_cma_mmap_obj(). However, our custom mmap function only differs with one flag, so we can cleanly handle both modes in ingenic_drm_gem_mmap(). - Call drm_gem_vm_close() if drm_mmap_attrs() failed, just like in drm_gem_cma_mmap_obj(). Signed-off-by: Paul Cercueil <paul@crapouillou.net> Acked-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200912195639.176001-1-paul@crapouillou.net
Diffstat (limited to 'drivers/gpu/drm/virtio')
0 files changed, 0 insertions, 0 deletions