Lines Matching refs:vga
98 vbe_ioport_write_index(&s->vga, 0, VBE_DISPI_INDEX_ENABLE); in ati_vga_switch_mode()
99 vbe_ioport_write_data(&s->vga, 0, VBE_DISPI_DISABLED); in ati_vga_switch_mode()
100 s->vga.big_endian_fb = (s->regs.config_cntl & APER_0_ENDIAN || in ati_vga_switch_mode()
104 s->vga.vbe_regs[VBE_DISPI_INDEX_XRES] = h; in ati_vga_switch_mode()
105 s->vga.vbe_regs[VBE_DISPI_INDEX_YRES] = v; in ati_vga_switch_mode()
106 s->vga.vbe_regs[VBE_DISPI_INDEX_BPP] = bpp; in ati_vga_switch_mode()
108 vbe_ioport_write_index(&s->vga, 0, VBE_DISPI_INDEX_ENABLE); in ati_vga_switch_mode()
109 vbe_ioport_write_data(&s->vga, 0, VBE_DISPI_ENABLED | in ati_vga_switch_mode()
116 vbe_ioport_write_index(&s->vga, 0, VBE_DISPI_INDEX_VIRT_WIDTH); in ati_vga_switch_mode()
117 vbe_ioport_write_data(&s->vga, 0, stride); in ati_vga_switch_mode()
121 vbe_ioport_write_index(&s->vga, 0, in ati_vga_switch_mode()
123 vbe_ioport_write_data(&s->vga, 0, offs % stride / bypp); in ati_vga_switch_mode()
125 vbe_ioport_write_index(&s->vga, 0, VBE_DISPI_INDEX_Y_OFFSET); in ati_vga_switch_mode()
126 vbe_ioport_write_data(&s->vga, 0, offs / stride); in ati_vga_switch_mode()
128 s->vga.vbe_regs[VBE_DISPI_INDEX_X_OFFSET], in ati_vga_switch_mode()
129 s->vga.vbe_regs[VBE_DISPI_INDEX_Y_OFFSET], in ati_vga_switch_mode()
130 s->vga.vbe_start_addr); in ati_vga_switch_mode()
136 vbe_ioport_write_index(&s->vga, 0, VBE_DISPI_INDEX_ENABLE); in ati_vga_switch_mode()
137 vbe_ioport_write_data(&s->vga, 0, VBE_DISPI_DISABLED); in ati_vga_switch_mode()
156 data[idx] = vga_read_byte(&s->vga, srcoff + i * 16 + j); in ati_cursor_define()
157 data[512 + idx] = vga_read_byte(&s->vga, srcoff + i * 16 + j + 8); in ati_cursor_define()
165 dpy_cursor_define(s->vga.con, s->cursor); in ati_cursor_define()
169 static void ati_cursor_invalidate(VGACommonState *vga) in ati_cursor_invalidate() argument
171 ATIVGAState *s = container_of(vga, ATIVGAState, vga); in ati_cursor_invalidate()
178 vga->hw_cursor_x != s->regs.cur_hv_pos >> 16 || in ati_cursor_invalidate()
179 vga->hw_cursor_y != (s->regs.cur_hv_pos & 0xffff) || in ati_cursor_invalidate()
183 vga_invalidate_scanlines(vga, vga->hw_cursor_y, vga->hw_cursor_y + 63); in ati_cursor_invalidate()
184 vga->hw_cursor_x = s->regs.cur_hv_pos >> 16; in ati_cursor_invalidate()
185 vga->hw_cursor_y = s->regs.cur_hv_pos & 0xffff; in ati_cursor_invalidate()
190 vga_invalidate_scanlines(vga, in ati_cursor_invalidate()
191 vga->hw_cursor_y, vga->hw_cursor_y + 63); in ati_cursor_invalidate()
196 static void ati_cursor_draw_line(VGACommonState *vga, uint8_t *d, int scr_y) in ati_cursor_draw_line() argument
198 ATIVGAState *s = container_of(vga, ATIVGAState, vga); in ati_cursor_draw_line()
204 scr_y < vga->hw_cursor_y || scr_y >= vga->hw_cursor_y + 64 || in ati_cursor_draw_line()
209 srcoff = s->cursor_offset + (scr_y - vga->hw_cursor_y) * 16; in ati_cursor_draw_line()
210 dp = &dp[vga->hw_cursor_x]; in ati_cursor_draw_line()
214 uint8_t abits = vga_read_byte(vga, srcoff + i); in ati_cursor_draw_line()
215 uint8_t xbits = vga_read_byte(vga, srcoff + i + 8); in ati_cursor_draw_line()
227 if (vga->hw_cursor_x + i * 8 + j >= h) { in ati_cursor_draw_line()
291 if (idx <= s->vga.vram_size - size) { in ati_mm_read()
292 val = ldn_le_p(s->vga.vram_ptr + idx, size); in ati_mm_read()
342 val = vga_ioport_read(&s->vga, VGA_PEL_IR) << 16; in ati_mm_read()
343 val |= vga_ioport_read(&s->vga, VGA_PEL_IW) & 0xff; in ati_mm_read()
346 val = vga_ioport_read(&s->vga, VGA_PEL_D); in ati_mm_read()
349 val = s->regs.palette[vga_ioport_read(&s->vga, VGA_PEL_IR)]; in ati_mm_read()
355 val = s->vga.vram_size; in ati_mm_read()
363 val = s->vga.vram_size / 2; in ati_mm_read()
548 if (idx <= s->vga.vram_size - size) { in ati_mm_write()
549 stn_le_p(s->vga.vram_ptr + idx, size, data); in ati_mm_write()
590 s->vga.force_shadow = !!(s->regs.crtc_gen_cntl & CRTC2_CUR_EN); in ati_mm_write()
595 dpy_mouse_set(s->vga.con, s->regs.cur_hv_pos >> 16, in ati_mm_write()
613 s->vga.ar_index &= ~BIT(5); in ati_mm_write()
616 s->vga.ar_index |= BIT(5); in ati_mm_write()
627 s->vga.dac_8bit = !!(data & DAC_8BIT_EN); in ati_mm_write()
666 vga_ioport_write(&s->vga, VGA_PEL_IR, (data >> 16) & 0xff); in ati_mm_write()
667 vga_ioport_write(&s->vga, VGA_PEL_IW, data & 0xff); in ati_mm_write()
670 vga_ioport_write(&s->vga, VGA_PEL_IW, data & 0xff); in ati_mm_write()
672 vga_ioport_write(&s->vga, VGA_PEL_IR, data & 0xff); in ati_mm_write()
679 vga_ioport_write(&s->vga, VGA_PEL_D, data & 0xff); in ati_mm_write()
681 vga_ioport_write(&s->vga, VGA_PEL_D, data & 0xff); in ati_mm_write()
683 vga_ioport_write(&s->vga, VGA_PEL_D, data & 0xff); in ati_mm_write()
686 s->regs.palette[vga_ioport_read(&s->vga, VGA_PEL_IW)] = data; in ati_mm_write()
687 vga_ioport_write(&s->vga, VGA_PEL_D, (data >> 22) & 0xff); in ati_mm_write()
688 vga_ioport_write(&s->vga, VGA_PEL_D, (data >> 12) & 0xff); in ati_mm_write()
689 vga_ioport_write(&s->vga, VGA_PEL_D, (data >> 2) & 0xff); in ati_mm_write()
744 dpy_mouse_set(s->vga.con, s->regs.cur_hv_pos >> 16, in ati_mm_write()
953 VGACommonState *vga = &s->vga; in ati_vga_realize() local
983 s->vga.vram_size_mb < 16) { in ati_vga_realize()
985 s->vga.vram_size_mb = 16; in ati_vga_realize()
989 if (!vga_common_init(vga, OBJECT(s), errp)) { in ati_vga_realize()
992 vga_init(vga, OBJECT(s), pci_address_space(dev), in ati_vga_realize()
994 vga->con = graphic_console_init(DEVICE(s), 0, s->vga.hw_ops, vga); in ati_vga_realize()
996 vga->cursor_invalidate = ati_cursor_invalidate; in ati_vga_realize()
997 vga->cursor_draw_line = ati_cursor_draw_line; in ati_vga_realize()
1013 pci_register_bar(dev, 0, PCI_BASE_ADDRESS_MEM_PREFETCH, &vga->vram); in ati_vga_realize()
1030 vga_common_reset(&s->vga); in ati_vga_reset()
1039 graphic_console_close(s->vga.con); in ati_vga_exit()
1043 DEFINE_PROP_UINT32("vgamem_mb", ATIVGAState, vga.vram_size_mb, 16),