From e2a08ac9ce424f543a2f03c67fb882fdabbdd32a Mon Sep 17 00:00:00 2001 From: Mitchell Horne Date: Mon, 3 Mar 2025 11:46:39 -0400 Subject: riscv: enable EFI framebuffer Pass framebuffer information from loader(8) to the kernel via the MODINFOMD_EFI_FB metadata field. Enable the vt_efifb driver. A small tweak is required to work around the lack of VM_MEMATTR_WRITE_COMBINING on this platform; we use VM_MEMATTR_UNCACHEABLE instead. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48884 --- sys/dev/vt/hw/efifb/efifb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/vt/hw/efifb/efifb.c b/sys/dev/vt/hw/efifb/efifb.c index eda05ec3d203..ad49b6735998 100644 --- a/sys/dev/vt/hw/efifb/efifb.c +++ b/sys/dev/vt/hw/efifb/efifb.c @@ -96,9 +96,11 @@ vt_efifb_init(struct vt_device *vd) { struct fb_info *info; struct efi_fb *efifb; - int memattr; + vm_memattr_t memattr; int roff, goff, boff; - char attr[16]; + +#ifdef VM_MEMATTR_WRITE_COMBINING + char attr[16]; /* * XXX TODO: I think there's more nuance here than we're acknowledging, @@ -122,6 +124,9 @@ vt_efifb_init(struct vt_device *vd) memattr = VM_MEMATTR_UNCACHEABLE; } } +#else + memattr = VM_MEMATTR_UNCACHEABLE; +#endif info = vd->vd_softc; if (info == NULL) -- cgit v1.3