drm/mgag200: Replace VRAM helpers with SHMEM helpers
authorThomas Zimmermann <tzimmermann@suse.de>
Fri, 15 May 2020 08:32:33 +0000 (10:32 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 19 May 2020 07:41:34 +0000 (09:41 +0200)
commit913ec479bb5cc27f99f24d5fd111b3ef29a4deb9
tree41927f9c52e618541008fc11014cad65f46e6220
parent88fabb75ea9edf4a3eecf459a50b633bda2fe67f
drm/mgag200: Replace VRAM helpers with SHMEM helpers

The VRAM helpers managed the framebuffer memory for mgag200. This came
with several problems, as some MGA device require the scanout address
to be located at VRAM offset 0. It's incompatible with the page-flip
semantics of DRM's atomic modesettting. With atomic modesetting, old and
new framebuffers have to be located in VRAM at the same time. So at least
one of them has to reside at a non-0 offset.

This patch replaces VRAM helpers with SHMEM helpers. GEM SHMEM buffers
reside in system memory, and are shadow-copied into VRAM during page
flips. The shadow copy always starts at VRAM offset 0.

v2:
* revert dev->pdev changes

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: John Donnelly <John.p.donnelly@oracle.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200515083233.32036-16-tzimmermann@suse.de
drivers/gpu/drm/mgag200/Kconfig
drivers/gpu/drm/mgag200/mgag200_drv.c
drivers/gpu/drm/mgag200/mgag200_drv.h
drivers/gpu/drm/mgag200/mgag200_mode.c
drivers/gpu/drm/mgag200/mgag200_ttm.c