video: Fix missing terminal deinitialisation before changing into final video mode
This commit is contained in:
parent
98fdd625c4
commit
bfc613bcbb
|
@ -7,6 +7,8 @@
|
||||||
#include <lib/gterm.h>
|
#include <lib/gterm.h>
|
||||||
|
|
||||||
void term_vbe(uint32_t *colours, int margin, int margin_gradient, struct image *background) {
|
void term_vbe(uint32_t *colours, int margin, int margin_gradient, struct image *background) {
|
||||||
|
term_backend = NOT_READY;
|
||||||
|
|
||||||
if (!gterm_init(&term_rows, &term_cols, colours, margin, margin_gradient, background)) {
|
if (!gterm_init(&term_rows, &term_cols, colours, margin, margin_gradient, background)) {
|
||||||
#if defined (bios)
|
#if defined (bios)
|
||||||
// Failed to set VBE properly, default to text mode
|
// Failed to set VBE properly, default to text mode
|
||||||
|
|
|
@ -21,6 +21,8 @@ void term_vbe(uint32_t *colours, int margin, int margin_gradient, struct image *
|
||||||
void term_textmode(void);
|
void term_textmode(void);
|
||||||
void term_write(const char *buf, size_t count);
|
void term_write(const char *buf, size_t count);
|
||||||
|
|
||||||
|
void term_deinit(void);
|
||||||
|
|
||||||
extern int term_rows, term_cols;
|
extern int term_rows, term_cols;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
|
@ -27,6 +27,8 @@ int term_rows, term_cols;
|
||||||
|
|
||||||
#if defined (bios)
|
#if defined (bios)
|
||||||
void term_textmode(void) {
|
void term_textmode(void) {
|
||||||
|
term_backend = NOT_READY;
|
||||||
|
|
||||||
init_vga_textmode(&term_rows, &term_cols, true);
|
init_vga_textmode(&term_rows, &term_cols, true);
|
||||||
|
|
||||||
raw_putchar = text_putchar;
|
raw_putchar = text_putchar;
|
||||||
|
@ -45,6 +47,10 @@ void term_textmode(void) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void term_deinit(void) {
|
||||||
|
term_backend = NOT_READY;
|
||||||
|
}
|
||||||
|
|
||||||
static void term_putchar(uint8_t c);
|
static void term_putchar(uint8_t c);
|
||||||
|
|
||||||
void term_write(const char *buf, size_t count) {
|
void term_write(const char *buf, size_t count) {
|
||||||
|
|
|
@ -482,6 +482,8 @@ void linux_load(char *config, char *cmdline) {
|
||||||
// Video
|
// Video
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
|
|
||||||
|
term_deinit();
|
||||||
|
|
||||||
mtrr_restore();
|
mtrr_restore();
|
||||||
|
|
||||||
struct screen_info *screen_info = &boot_params->screen_info;
|
struct screen_info *screen_info = &boot_params->screen_info;
|
||||||
|
|
|
@ -157,6 +157,8 @@ void stivale_load(char *config, char *cmdline) {
|
||||||
stivale_struct.epoch = time();
|
stivale_struct.epoch = time();
|
||||||
print("stivale: Current epoch: %U\n", stivale_struct.epoch);
|
print("stivale: Current epoch: %U\n", stivale_struct.epoch);
|
||||||
|
|
||||||
|
term_deinit();
|
||||||
|
|
||||||
if (stivale_hdr.flags & (1 << 0)) {
|
if (stivale_hdr.flags & (1 << 0)) {
|
||||||
int req_width = stivale_hdr.framebuffer_width;
|
int req_width = stivale_hdr.framebuffer_width;
|
||||||
int req_height = stivale_hdr.framebuffer_height;
|
int req_height = stivale_hdr.framebuffer_height;
|
||||||
|
|
|
@ -261,6 +261,8 @@ void stivale2_load(char *config, char *cmdline, bool pxe, void *efi_system_table
|
||||||
// Create framebuffer struct tag
|
// Create framebuffer struct tag
|
||||||
//////////////////////////////////////////////
|
//////////////////////////////////////////////
|
||||||
{
|
{
|
||||||
|
term_deinit();
|
||||||
|
|
||||||
struct stivale2_header_tag_framebuffer *hdrtag = get_tag(&stivale2_hdr, STIVALE2_HEADER_TAG_FRAMEBUFFER_ID);
|
struct stivale2_header_tag_framebuffer *hdrtag = get_tag(&stivale2_hdr, STIVALE2_HEADER_TAG_FRAMEBUFFER_ID);
|
||||||
|
|
||||||
if (hdrtag != NULL) {
|
if (hdrtag != NULL) {
|
||||||
|
|
Loading…
Reference in New Issue