From 823cdec7bb72a1b2cafac467c2e1ff9a004dc4fc Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Wed, 6 Dec 2017 02:06:14 +0000 Subject: [PATCH] Allow custom overrides of mmap attribute for VT framebuffer Summary: As in /dev/fb, allow the framebuffer driver to override the default memattr for mmap(2). This is analogous to the change in 306555. Reviewed By: ray Differential Revision: https://reviews.freebsd.org/D13331 --- sys/dev/vt/hw/fb/vt_fb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/vt/hw/fb/vt_fb.c b/sys/dev/vt/hw/fb/vt_fb.c index 6145940b247..f437b8cf9e7 100644 --- a/sys/dev/vt/hw/fb/vt_fb.c +++ b/sys/dev/vt/hw/fb/vt_fb.c @@ -143,8 +143,11 @@ vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, vm_paddr_t *paddr, *paddr = vtophys((uint8_t *)info->fb_vbase + offset); } else { *paddr = info->fb_pbase + offset; + if (info->fb_flags & FB_FLAG_MEMATTR) + *memattr = info->fb_memattr; #ifdef VM_MEMATTR_WRITE_COMBINING - *memattr = VM_MEMATTR_WRITE_COMBINING; + else + *memattr = VM_MEMATTR_WRITE_COMBINING; #endif } return (0);