From be4bf62684f356f83f98402dbf01e4c2451fe644 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 20 Apr 2017 15:18:15 +0000 Subject: [PATCH] Write-combine framebuffer writes through user-space mappings, if possible. Note that KVA mapping of the framebuffer already uses write-combining mode, so the change, besides improving speed of user mode writes, also satisfies requirement of the IA32 architecture of using consistent caching modes for multiple mappings of the same page. Reported and tested by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/dev/fb/vesa.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/dev/fb/vesa.c b/sys/dev/fb/vesa.c index d51e560c7f84..c752efc6903c 100644 --- a/sys/dev/fb/vesa.c +++ b/sys/dev/fb/vesa.c @@ -1643,6 +1643,9 @@ vesa_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, if (offset > adp->va_window_size - PAGE_SIZE) return (-1); *paddr = adp->va_info.vi_buffer + offset; +#ifdef VM_MEMATTR_WRITE_COMBINING + *memattr = VM_MEMATTR_WRITE_COMBINING; +#endif return (0); } return ((*prevvidsw->mmap)(adp, offset, paddr, prot, memattr));