On 10/12/16 05:27 AM, Benjamin Herrenschmidt wrote:
On Fri, 2016-12-09 at 14:35 +0100, Daniel Vetter wrote:
As for multi userspace client, well, swapping an mmap between HW and memory backing store is a somewhat solved problem already.
Hm, I didn't know that, but then all existing drm drivers have fairly simplistic fbdev mmap implementations.
Hrm, I though the TTM did it ... I remember talking with Thomas Hellstrom about that back in the day... you use unmap_mapping_range to unmap the existing mappings basically so you can take new faults and route them to a different page, but I can't see a call in there so maybe he ended up not doing it.
I think he did, it was working fine for userspace mappings when I tried making radeon use a non-pinned BO for fbdev years ago (the problem was fbcon potentially trying to access the framebuffer at the most inconvenient times). There's still ttm_fbdev_mmap, but I'm not sure everything to make this fully work for userspace fbdev mappings is still there.