Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/vt/hw/efifb/efifb.c
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | vt_efifb_probe(struct vt_device *vd) | ||||
return (CN_INTERNAL); | return (CN_INTERNAL); | ||||
} | } | ||||
static int | static int | ||||
vt_efifb_init(struct vt_device *vd) | vt_efifb_init(struct vt_device *vd) | ||||
{ | { | ||||
struct fb_info *info; | struct fb_info *info; | ||||
struct efi_fb *efifb; | struct efi_fb *efifb; | ||||
int memattr; | vm_memattr_t memattr; | ||||
int roff, goff, boff; | int roff, goff, boff; | ||||
#ifdef VM_MEMATTR_WRITE_COMBINING | |||||
char attr[16]; | char attr[16]; | ||||
/* | /* | ||||
* XXX TODO: I think there's more nuance here than we're acknowledging, | * XXX TODO: I think there's more nuance here than we're acknowledging, | ||||
* and we should look into it. It may be that the framebuffer lives in | * and we should look into it. It may be that the framebuffer lives in | ||||
* a segment of memory that doesn't support one or both of these. We | * a segment of memory that doesn't support one or both of these. We | ||||
* should likely be consulting the memory map for any applicable | * should likely be consulting the memory map for any applicable | ||||
* cacheability attributes before making a final decision. | * cacheability attributes before making a final decision. | ||||
*/ | */ | ||||
memattr = VM_MEMATTR_WRITE_COMBINING; | memattr = VM_MEMATTR_WRITE_COMBINING; | ||||
if (TUNABLE_STR_FETCH("hw.efifb.cache_attr", attr, sizeof(attr))) { | if (TUNABLE_STR_FETCH("hw.efifb.cache_attr", attr, sizeof(attr))) { | ||||
/* | /* | ||||
* We'll allow WC but it's currently the default, UC is the only | * We'll allow WC but it's currently the default, UC is the only | ||||
* other tested one at this time. | * other tested one at this time. | ||||
*/ | */ | ||||
if (strcasecmp(attr, "wc") != 0 && | if (strcasecmp(attr, "wc") != 0 && | ||||
strcasecmp(attr, "uc") != 0) { | strcasecmp(attr, "uc") != 0) { | ||||
printf("efifb: unsupported cache attr specified: %s\n", | printf("efifb: unsupported cache attr specified: %s\n", | ||||
attr); | attr); | ||||
printf("efifb: expected \"wc\" or \"uc\"\n"); | printf("efifb: expected \"wc\" or \"uc\"\n"); | ||||
} else if (strcasecmp(attr, "uc") == 0) { | } else if (strcasecmp(attr, "uc") == 0) { | ||||
memattr = VM_MEMATTR_UNCACHEABLE; | memattr = VM_MEMATTR_UNCACHEABLE; | ||||
} | } | ||||
} | } | ||||
#else | |||||
memattr = VM_MEMATTR_UNCACHEABLE; | |||||
#endif | |||||
info = vd->vd_softc; | info = vd->vd_softc; | ||||
if (info == NULL) | if (info == NULL) | ||||
info = vd->vd_softc = (void *)&local_info; | info = vd->vd_softc = (void *)&local_info; | ||||
efifb = (struct efi_fb *)preload_search_info(preload_kmdp, | efifb = (struct efi_fb *)preload_search_info(preload_kmdp, | ||||
MODINFO_METADATA | MODINFOMD_EFI_FB); | MODINFO_METADATA | MODINFOMD_EFI_FB); | ||||
if (efifb == NULL) | if (efifb == NULL) | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |