X-Git-Url: http://git.maemo.org/git/?p=qemu;a=blobdiff_plain;f=hw%2Fvga_int.h;fp=hw%2Fvga_int.h;h=631b1b0fc35bcd3a718ec447c8542eb0718c39fb;hp=1971aa6b5108904f26bb442fe90c446d887b643a;hb=759b334a9739814df2883aa4c41b1c0f5670e90a;hpb=7e2198fc87e878b8ce5df965477e21713ebf7834 diff --git a/hw/vga_int.h b/hw/vga_int.h index 1971aa6..631b1b0 100644 --- a/hw/vga_int.h +++ b/hw/vga_int.h @@ -94,94 +94,92 @@ union vga_retrace { struct vga_precise_retrace precise; }; -struct VGAState; -typedef uint8_t (* vga_retrace_fn)(struct VGAState *s); -typedef void (* vga_update_retrace_info_fn)(struct VGAState *s); - -#define VGA_STATE_COMMON \ - uint8_t *vram_ptr; \ - ram_addr_t vram_offset; \ - unsigned int vram_size; \ - uint32_t lfb_addr; \ - uint32_t lfb_end; \ - uint32_t map_addr; \ - uint32_t map_end; \ - uint32_t lfb_vram_mapped; /* whether 0xa0000 is mapped as ram */ \ - unsigned long bios_offset; \ - unsigned int bios_size; \ - int it_shift; \ - PCIDevice *pci_dev; \ - uint32_t latch; \ - uint8_t sr_index; \ - uint8_t sr[256]; \ - uint8_t gr_index; \ - uint8_t gr[256]; \ - uint8_t ar_index; \ - uint8_t ar[21]; \ - int ar_flip_flop; \ - uint8_t cr_index; \ - uint8_t cr[256]; /* CRT registers */ \ - uint8_t msr; /* Misc Output Register */ \ - uint8_t fcr; /* Feature Control Register */ \ - uint8_t st00; /* status 0 */ \ - uint8_t st01; /* status 1 */ \ - uint8_t dac_state; \ - uint8_t dac_sub_index; \ - uint8_t dac_read_index; \ - uint8_t dac_write_index; \ - uint8_t dac_cache[3]; /* used when writing */ \ - int dac_8bit; \ - uint8_t palette[768]; \ - int32_t bank_offset; \ - int vga_io_memory; \ - int (*get_bpp)(struct VGAState *s); \ - void (*get_offsets)(struct VGAState *s, \ - uint32_t *pline_offset, \ - uint32_t *pstart_addr, \ - uint32_t *pline_compare); \ - void (*get_resolution)(struct VGAState *s, \ - int *pwidth, \ - int *pheight); \ - VGA_STATE_COMMON_BOCHS_VBE \ - /* display refresh support */ \ - DisplayState *ds; \ - uint32_t font_offsets[2]; \ - int graphic_mode; \ - uint8_t shift_control; \ - uint8_t double_scan; \ - uint32_t line_offset; \ - uint32_t line_compare; \ - uint32_t start_addr; \ - uint32_t plane_updated; \ - uint32_t last_line_offset; \ - uint8_t last_cw, last_ch; \ - uint32_t last_width, last_height; /* in chars or pixels */ \ - uint32_t last_scr_width, last_scr_height; /* in pixels */ \ - uint32_t last_depth; /* in bits */ \ - uint8_t cursor_start, cursor_end; \ - uint32_t cursor_offset; \ - unsigned int (*rgb_to_pixel)(unsigned int r, \ - unsigned int g, unsigned b); \ - vga_hw_update_ptr update; \ - vga_hw_invalidate_ptr invalidate; \ - vga_hw_screen_dump_ptr screen_dump; \ - vga_hw_text_update_ptr text_update; \ - /* hardware mouse cursor support */ \ - uint32_t invalidated_y_table[VGA_MAX_HEIGHT / 32]; \ - void (*cursor_invalidate)(struct VGAState *s); \ - void (*cursor_draw_line)(struct VGAState *s, uint8_t *d, int y); \ - /* tell for each page if it has been updated since the last time */ \ - uint32_t last_palette[256]; \ - uint32_t last_ch_attr[CH_ATTR_SIZE]; /* XXX: make it dynamic */ \ - /* retrace */ \ - vga_retrace_fn retrace; \ - vga_update_retrace_info_fn update_retrace_info; \ +struct VGACommonState; +typedef uint8_t (* vga_retrace_fn)(struct VGACommonState *s); +typedef void (* vga_update_retrace_info_fn)(struct VGACommonState *s); + +typedef struct VGACommonState { + uint8_t *vram_ptr; + ram_addr_t vram_offset; + unsigned int vram_size; + uint32_t lfb_addr; + uint32_t lfb_end; + uint32_t map_addr; + uint32_t map_end; + uint32_t lfb_vram_mapped; /* whether 0xa0000 is mapped as ram */ + unsigned long bios_offset; + unsigned int bios_size; + int it_shift; + PCIDevice *pci_dev; + uint32_t latch; + uint8_t sr_index; + uint8_t sr[256]; + uint8_t gr_index; + uint8_t gr[256]; + uint8_t ar_index; + uint8_t ar[21]; + int ar_flip_flop; + uint8_t cr_index; + uint8_t cr[256]; /* CRT registers */ + uint8_t msr; /* Misc Output Register */ + uint8_t fcr; /* Feature Control Register */ + uint8_t st00; /* status 0 */ + uint8_t st01; /* status 1 */ + uint8_t dac_state; + uint8_t dac_sub_index; + uint8_t dac_read_index; + uint8_t dac_write_index; + uint8_t dac_cache[3]; /* used when writing */ + int dac_8bit; + uint8_t palette[768]; + int32_t bank_offset; + int vga_io_memory; + int (*get_bpp)(struct VGACommonState *s); + void (*get_offsets)(struct VGACommonState *s, + uint32_t *pline_offset, + uint32_t *pstart_addr, + uint32_t *pline_compare); + void (*get_resolution)(struct VGACommonState *s, + int *pwidth, + int *pheight); + VGA_STATE_COMMON_BOCHS_VBE + /* display refresh support */ + DisplayState *ds; + uint32_t font_offsets[2]; + int graphic_mode; + uint8_t shift_control; + uint8_t double_scan; + uint32_t line_offset; + uint32_t line_compare; + uint32_t start_addr; + uint32_t plane_updated; + uint32_t last_line_offset; + uint8_t last_cw, last_ch; + uint32_t last_width, last_height; /* in chars or pixels */ + uint32_t last_scr_width, last_scr_height; /* in pixels */ + uint32_t last_depth; /* in bits */ + uint8_t cursor_start, cursor_end; + uint32_t cursor_offset; + unsigned int (*rgb_to_pixel)(unsigned int r, + unsigned int g, unsigned b); + vga_hw_update_ptr update; + vga_hw_invalidate_ptr invalidate; + vga_hw_screen_dump_ptr screen_dump; + vga_hw_text_update_ptr text_update; + /* hardware mouse cursor support */ + uint32_t invalidated_y_table[VGA_MAX_HEIGHT / 32]; + void (*cursor_invalidate)(struct VGACommonState *s); + void (*cursor_draw_line)(struct VGACommonState *s, uint8_t *d, int y); + /* tell for each page if it has been updated since the last time */ + uint32_t last_palette[256]; + uint32_t last_ch_attr[CH_ATTR_SIZE]; /* XXX: make it dynamic */ + /* retrace */ + vga_retrace_fn retrace; + vga_update_retrace_info_fn update_retrace_info; union vga_retrace retrace_info; +} VGACommonState; - -typedef struct VGAState { - VGA_STATE_COMMON -} VGAState; +typedef VGACommonState VGAState; static inline int c6_to_8(int v) { @@ -217,3 +215,6 @@ void vga_draw_cursor_line_32(uint8_t *d1, const uint8_t *src1, extern const uint8_t sr_mask[8]; extern const uint8_t gr_mask[16]; + +#define VGA_RAM_SIZE (8192 * 1024) +