stivale: Map the framebuffer in the memory map only in stivale protos

This commit is contained in:
mintsuki 2021-04-11 01:38:06 +02:00
parent 4dc24474a0
commit 49621f5c4f
3 changed files with 8 additions and 4 deletions

View File

@ -16,10 +16,6 @@ bool fb_init(struct fb_info *ret,
r = init_gop(ret, target_width, target_height, target_bpp);
#endif
memmap_alloc_range(ret->framebuffer_addr,
(uint64_t)ret->framebuffer_pitch * ret->framebuffer_height,
MEMMAP_FRAMEBUFFER, false, false, false, true);
return r;
}

View File

@ -171,6 +171,10 @@ void stivale_load(char *config, char *cmdline) {
if (!fb_init(&fbinfo, req_width, req_height, req_bpp))
panic("stivale: Unable to set video mode");
memmap_alloc_range(fbinfo.framebuffer_addr,
(uint64_t)fbinfo.framebuffer_pitch * fbinfo.framebuffer_height,
MEMMAP_FRAMEBUFFER, false, false, false, true);
stivale_struct.framebuffer_addr = (uint64_t)fbinfo.framebuffer_addr;
stivale_struct.framebuffer_width = fbinfo.framebuffer_width;
stivale_struct.framebuffer_height = fbinfo.framebuffer_height;

View File

@ -329,6 +329,10 @@ skip_modeset:;
struct stivale2_struct_tag_framebuffer *tag = ext_mem_alloc(sizeof(struct stivale2_struct_tag_framebuffer));
tag->tag.identifier = STIVALE2_STRUCT_TAG_FRAMEBUFFER_ID;
memmap_alloc_range(fb->framebuffer_addr,
(uint64_t)fb->framebuffer_pitch * fb->framebuffer_height,
MEMMAP_FRAMEBUFFER, false, false, false, true);
tag->memory_model = STIVALE2_FBUF_MMODEL_RGB;
tag->framebuffer_addr = fb->framebuffer_addr;
tag->framebuffer_width = fb->framebuffer_width;