X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=hw%2Fvga_int.h;h=a94162d33257155ad1504fb8cc0606e3104edc01;hb=cd346349b45ef056f138a184f660b8c34c3213cc;hp=0d0f3edee1c7e8ed57c86601168e2e1a737487b8;hpb=a8aa669ba406a0d6530f48e0c87a358ba614aa95;p=qemu diff --git a/hw/vga_int.h b/hw/vga_int.h index 0d0f3ed..a94162d 100644 --- a/hw/vga_int.h +++ b/hw/vga_int.h @@ -1,8 +1,8 @@ /* * QEMU internal VGA defines. - * + * * Copyright (c) 2003-2004 Fabrice Bellard - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -30,8 +30,9 @@ /* bochs VBE support */ #define CONFIG_BOCHS_VBE -#define VBE_DISPI_MAX_XRES 1024 -#define VBE_DISPI_MAX_YRES 768 +#define VBE_DISPI_MAX_XRES 1600 +#define VBE_DISPI_MAX_YRES 1200 +#define VBE_DISPI_MAX_BPP 32 #define VBE_DISPI_INDEX_ID 0x0 #define VBE_DISPI_INDEX_XRES 0x1 @@ -44,16 +45,20 @@ #define VBE_DISPI_INDEX_X_OFFSET 0x8 #define VBE_DISPI_INDEX_Y_OFFSET 0x9 #define VBE_DISPI_INDEX_NB 0xa - + #define VBE_DISPI_ID0 0xB0C0 #define VBE_DISPI_ID1 0xB0C1 #define VBE_DISPI_ID2 0xB0C2 - +#define VBE_DISPI_ID3 0xB0C3 +#define VBE_DISPI_ID4 0xB0C4 + #define VBE_DISPI_DISABLED 0x00 #define VBE_DISPI_ENABLED 0x01 +#define VBE_DISPI_GETCAPS 0x02 +#define VBE_DISPI_8BIT_DAC 0x20 #define VBE_DISPI_LFB_ENABLED 0x40 #define VBE_DISPI_NOCLEARMEM 0x80 - + #define VBE_DISPI_LFB_PHYSICAL_ADDRESS 0xE0000000 #ifdef CONFIG_BOCHS_VBE @@ -72,12 +77,17 @@ #endif /* !CONFIG_BOCHS_VBE */ #define CH_ATTR_SIZE (160 * 100) -#define VGA_MAX_HEIGHT 1024 +#define VGA_MAX_HEIGHT 2048 #define VGA_STATE_COMMON \ uint8_t *vram_ptr; \ unsigned long vram_offset; \ unsigned int vram_size; \ + unsigned long bios_offset; \ + unsigned int bios_size; \ + target_phys_addr_t base_ctrl; \ + int it_shift; \ + PCIDevice *pci_dev; \ uint32_t latch; \ uint8_t sr_index; \ uint8_t sr[256]; \ @@ -97,12 +107,17 @@ 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 (*get_bpp)(struct VGAState *s); \ void (*get_offsets)(struct VGAState *s, \ uint32_t *pline_offset, \ - uint32_t *pstart_addr); \ + 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; \ @@ -113,6 +128,7 @@ uint32_t line_offset; \ uint32_t line_compare; \ uint32_t start_addr; \ + uint32_t plane_updated; \ 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 */ \ @@ -120,6 +136,9 @@ 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; \ /* hardware mouse cursor support */ \ uint32_t invalidated_y_table[VGA_MAX_HEIGHT / 32]; \ void (*cursor_invalidate)(struct VGAState *s); \ @@ -141,22 +160,25 @@ static inline int c6_to_8(int v) return (v << 2) | (b << 1) | b; } -void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base, +void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base, unsigned long vga_ram_offset, int vga_ram_size); +void vga_init(VGAState *s); uint32_t vga_mem_readb(void *opaque, target_phys_addr_t addr); void vga_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val); void vga_invalidate_scanlines(VGAState *s, int y1, int y2); +int ppm_save(const char *filename, uint8_t *data, + int w, int h, int linesize); -void vga_draw_cursor_line_8(uint8_t *d1, const uint8_t *src1, - int poffset, int w, +void vga_draw_cursor_line_8(uint8_t *d1, const uint8_t *src1, + int poffset, int w, unsigned int color0, unsigned int color1, unsigned int color_xor); -void vga_draw_cursor_line_16(uint8_t *d1, const uint8_t *src1, - int poffset, int w, +void vga_draw_cursor_line_16(uint8_t *d1, const uint8_t *src1, + int poffset, int w, unsigned int color0, unsigned int color1, unsigned int color_xor); -void vga_draw_cursor_line_32(uint8_t *d1, const uint8_t *src1, - int poffset, int w, +void vga_draw_cursor_line_32(uint8_t *d1, const uint8_t *src1, + int poffset, int w, unsigned int color0, unsigned int color1, unsigned int color_xor);