xen, vga: add API for registering the framebuffer
Xen currently uses the name of a memory region to determine whether it is the framebuffer. Replace with an explicit API. Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
		
							parent
							
								
									04097f7c59
								
							
						
					
					
						commit
						c65adf9bcd
					
				
							
								
								
									
										2
									
								
								hw/vga.c
								
								
								
								
							
							
						
						
									
										2
									
								
								hw/vga.c
								
								
								
								
							| 
						 | 
				
			
			@ -28,6 +28,7 @@
 | 
			
		|||
#include "vga_int.h"
 | 
			
		||||
#include "pixel_ops.h"
 | 
			
		||||
#include "qemu-timer.h"
 | 
			
		||||
#include "xen.h"
 | 
			
		||||
 | 
			
		||||
//#define DEBUG_VGA
 | 
			
		||||
//#define DEBUG_VGA_MEM
 | 
			
		||||
| 
						 | 
				
			
			@ -2222,6 +2223,7 @@ void vga_common_init(VGACommonState *s, int vga_ram_size)
 | 
			
		|||
    s->is_vbe_vmstate = 0;
 | 
			
		||||
#endif
 | 
			
		||||
    memory_region_init_ram(&s->vram, NULL, "vga.vram", vga_ram_size);
 | 
			
		||||
    xen_register_framebuffer(&s->vram);
 | 
			
		||||
    s->vram_ptr = memory_region_get_ram_ptr(&s->vram);
 | 
			
		||||
    s->vram_size = vga_ram_size;
 | 
			
		||||
    s->get_bpp = vga_get_bpp;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										3
									
								
								hw/xen.h
								
								
								
								
							
							
						
						
									
										3
									
								
								hw/xen.h
								
								
								
								
							| 
						 | 
				
			
			@ -49,6 +49,9 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
 | 
			
		|||
                   struct MemoryRegion *mr);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
struct MemoryRegion;
 | 
			
		||||
void xen_register_framebuffer(struct MemoryRegion *mr);
 | 
			
		||||
 | 
			
		||||
#if defined(CONFIG_XEN) && CONFIG_XEN_CTRL_INTERFACE_VERSION < 400
 | 
			
		||||
#  define HVM_MAX_VCPUS 32
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -33,6 +33,7 @@
 | 
			
		|||
#endif
 | 
			
		||||
 | 
			
		||||
static MemoryRegion ram_memory, ram_640k, ram_lo, ram_hi;
 | 
			
		||||
static MemoryRegion *framebuffer;
 | 
			
		||||
 | 
			
		||||
/* Compatibility with older version */
 | 
			
		||||
#if __XEN_LATEST_INTERFACE_VERSION__ < 0x0003020a
 | 
			
		||||
| 
						 | 
				
			
			@ -982,3 +983,8 @@ void destroy_hvm_domain(void)
 | 
			
		|||
        xc_interface_close(xc_handle);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void xen_register_framebuffer(MemoryRegion *mr)
 | 
			
		||||
{
 | 
			
		||||
    framebuffer = mr;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,3 +44,7 @@ int xen_init(void)
 | 
			
		|||
{
 | 
			
		||||
    return -ENOSYS;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void xen_register_framebuffer(MemoryRegion *mr)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue