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
This commit is contained in:
Justin Hibbits 2017-12-06 02:06:14 +00:00
parent 97d24081da
commit 823cdec7bb

View File

@ -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);