mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
vga: introduce VGADisplayParams
The next patches will introduce more parameters that cause a full refresh. Instead of adding arguments to get_offsets and lines to update_basic_params, do everything through a struct. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
937de9a981
commit
f9b925fd41
3 changed files with 52 additions and 69 deletions
|
@ -798,9 +798,9 @@ static int cirrus_bitblt_videotovideo_copy(CirrusVGAState * s)
|
|||
if (blit_is_unsafe(s, false))
|
||||
return 0;
|
||||
|
||||
return cirrus_do_copy(s, s->cirrus_blt_dstaddr - s->vga.start_addr,
|
||||
s->cirrus_blt_srcaddr - s->vga.start_addr,
|
||||
s->cirrus_blt_width, s->cirrus_blt_height);
|
||||
return cirrus_do_copy(s, s->cirrus_blt_dstaddr - s->vga.params.start_addr,
|
||||
s->cirrus_blt_srcaddr - s->vga.params.start_addr,
|
||||
s->cirrus_blt_width, s->cirrus_blt_height);
|
||||
}
|
||||
|
||||
/***************************************
|
||||
|
@ -1101,30 +1101,26 @@ static void cirrus_write_bitblt(CirrusVGAState * s, unsigned reg_value)
|
|||
*
|
||||
***************************************/
|
||||
|
||||
static void cirrus_get_offsets(VGACommonState *s1,
|
||||
uint32_t *pline_offset,
|
||||
uint32_t *pstart_addr,
|
||||
uint32_t *pline_compare)
|
||||
static void cirrus_get_params(VGACommonState *s1,
|
||||
VGADisplayParams *params)
|
||||
{
|
||||
CirrusVGAState * s = container_of(s1, CirrusVGAState, vga);
|
||||
uint32_t start_addr, line_offset, line_compare;
|
||||
uint32_t line_offset;
|
||||
|
||||
line_offset = s->vga.cr[0x13]
|
||||
| ((s->vga.cr[0x1b] & 0x10) << 4);
|
||||
line_offset <<= 3;
|
||||
*pline_offset = line_offset;
|
||||
params->line_offset = line_offset;
|
||||
|
||||
start_addr = (s->vga.cr[0x0c] << 8)
|
||||
params->start_addr = (s->vga.cr[0x0c] << 8)
|
||||
| s->vga.cr[0x0d]
|
||||
| ((s->vga.cr[0x1b] & 0x01) << 16)
|
||||
| ((s->vga.cr[0x1b] & 0x0c) << 15)
|
||||
| ((s->vga.cr[0x1d] & 0x80) << 12);
|
||||
*pstart_addr = start_addr;
|
||||
|
||||
line_compare = s->vga.cr[0x18] |
|
||||
params->line_compare = s->vga.cr[0x18] |
|
||||
((s->vga.cr[0x07] & 0x10) << 4) |
|
||||
((s->vga.cr[0x09] & 0x40) << 3);
|
||||
*pline_compare = line_compare;
|
||||
}
|
||||
|
||||
static uint32_t cirrus_get_bpp16_depth(CirrusVGAState * s)
|
||||
|
@ -2925,7 +2921,7 @@ void cirrus_init_common(CirrusVGAState *s, Object *owner,
|
|||
s->linear_mmio_mask = s->real_vram_size - 256;
|
||||
|
||||
s->vga.get_bpp = cirrus_get_bpp;
|
||||
s->vga.get_offsets = cirrus_get_offsets;
|
||||
s->vga.get_params = cirrus_get_params;
|
||||
s->vga.get_resolution = cirrus_get_resolution;
|
||||
s->vga.cursor_invalidate = cirrus_cursor_invalidate;
|
||||
s->vga.cursor_draw_line = cirrus_cursor_draw_line;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue