[metal] Fix video mode filtering & frame buffer ref-counting (#889)

Co-authored-by: tkchia <tkchia-cosmo@gmx.com>
This commit is contained in:
tkchia 2023-09-06 18:41:07 +08:00 committed by GitHub
parent 0d748ad58e
commit b21842ed7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 10 deletions

View file

@ -53,9 +53,8 @@ void _vga_reinit(struct Tty *tty, unsigned short starty, unsigned short startx,
chr_ht = VGA_ASSUME_CHAR_HEIGHT_PX;
chr_wid = VGA_ASSUME_CHAR_WIDTH_PX;
/* Make sure the video buffer is mapped into virtual memory. */
__invert_memory_area(mm, __get_pml4t(), vid_buf_phy, vid_buf_sz,
PAGE_RW | PAGE_XD);
__ref_pages(mm, __get_pml4t(), vid_buf_phy, vid_buf_sz);
__invert_and_perm_ref_memory_area(mm, __get_pml4t(), vid_buf_phy, vid_buf_sz,
PAGE_RW | PAGE_XD);
/*
* Initialize our tty structure from the current screen geometry, screen
* contents, cursor position, & character dimensions.