mirror of
				https://gitlab.com/qemu-project/qemu-palcode.git
				synced 2024-02-13 08:32:59 +08:00 
			
		
		
		
	Properly detect the presence of a vga device.
This commit is contained in:
		| @ -122,6 +122,7 @@ do_console(void) | ||||
|   set_console_alarm(); | ||||
|   swpipl(0); | ||||
|  | ||||
|   if (have_vga) | ||||
|   { | ||||
|     unsigned short *vga, attr; | ||||
|     vga = pci_mem_base + SEG_CTEXT *16; | ||||
|  | ||||
							
								
								
									
										1
									
								
								init.c
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								init.c
									
									
									
									
									
								
							| @ -59,6 +59,7 @@ static unsigned long page_dir[1024] __attribute__((aligned(PAGE_SIZE))); | ||||
| struct hwrpb_combine hwrpb __attribute__((aligned(PAGE_SIZE))); | ||||
|  | ||||
| void *last_alloc; | ||||
| bool have_vga; | ||||
|  | ||||
| static void * | ||||
| alloc (unsigned long size, unsigned long align) | ||||
|  | ||||
							
								
								
									
										3
									
								
								protos.h
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								protos.h
									
									
									
									
									
								
							| @ -200,6 +200,9 @@ extern unsigned long crb_fixup(unsigned long vptptr, unsigned long hwrpb); | ||||
| /* | ||||
|  * The Console | ||||
|  */ | ||||
|  | ||||
| extern bool have_vga; | ||||
|  | ||||
| extern void do_console(void); | ||||
| extern void entInt(void); | ||||
|  | ||||
|  | ||||
							
								
								
									
										19
									
								
								vgaio.c
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								vgaio.c
									
									
									
									
									
								
							| @ -7,6 +7,9 @@ | ||||
|  | ||||
| #include "protos.h" | ||||
| #include "ioport.h" | ||||
| #include "pci.h" | ||||
| #include "pci_regs.h" | ||||
| #include "pci_ids.h" | ||||
| #include "vgatables.h" | ||||
|  | ||||
| #define GET_FARVAR(seg, ofs)		(ofs) | ||||
| @ -554,7 +557,21 @@ vgahw_enable_video_addressing(u8 disable) | ||||
| void | ||||
| vgahw_init(void) | ||||
| { | ||||
|   struct vgamode_s *vmode_g = find_vga_entry(3); | ||||
|   struct vgamode_s *vmode_g; | ||||
|   int bdf, max; | ||||
|  | ||||
|   foreachpci(bdf, max) | ||||
|     { | ||||
|       uint16_t class = pci_config_readw(bdf, PCI_CLASS_DEVICE); | ||||
|       if (class == PCI_CLASS_DISPLAY_VGA) | ||||
|         goto found; | ||||
|     } | ||||
|   return; | ||||
|  | ||||
|  found: | ||||
|   have_vga = 1; | ||||
|  | ||||
|   vmode_g = find_vga_entry(3); | ||||
|  | ||||
|   vgahw_sequ_write(0, 1);	// Assert sync reset | ||||
|    | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Richard Henderson
					Richard Henderson