Skip to content

Commit b3ece66

Browse files
committed
fb: Make PMON work without VGA
Disable output properly. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
1 parent 60103e4 commit b3ece66

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

fb/cfb_console.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,13 +417,19 @@ static void memcpyl (int *d, int *s, int c);
417417

418418
extern int vga_available;
419419

420-
static int disableoutput=0;
420+
static int disableoutput=1;
421421
void video_disableoutput(void)
422422
{
423423
disableoutput=1;
424424
}
425425
void video_enableoutput(void)
426426
{
427+
if (!vga_available)
428+
return;
429+
430+
if (!video_fb_address)
431+
return;
432+
427433
disableoutput=0;
428434
}
429435
void video_drawchars_xor (int xx, int yy, unsigned char *s, int count)
@@ -942,6 +948,9 @@ static void console_newline (void)
942948

943949
void video_putc (const char c)
944950
{
951+
if(disableoutput)
952+
return;
953+
945954
switch (c) {
946955
case 13: /* ignore */
947956
CURSOR_OFF
@@ -1715,6 +1724,8 @@ int fb_init (unsigned long fbbase,unsigned long iobase)
17151724
memset (memfb, 0, CONSOLE_ROWS * CONSOLE_COLS);
17161725
}
17171726
#endif
1727+
video_enableoutput();
1728+
17181729
return 0;
17191730
}
17201731

0 commit comments

Comments
 (0)