2 * QEMU ATI SVGA emulation
4 * Copyright (c) 2019 BALATON Zoltan
6 * This work is licensed under the GNU GPL license version 2 or later.
12 #include "qemu/timer.h"
13 #include "hw/pci/pci.h"
14 #include "hw/i2c/bitbang_i2c.h"
16 #include "qom/object.h"
21 #define DPRINTF(fmt, ...) printf("%s: " fmt, __func__, ## __VA_ARGS__)
23 #define DPRINTF(fmt, ...) do {} while (0)
26 #define PCI_VENDOR_ID_ATI 0x1002
28 #define PCI_DEVICE_ID_ATI_RAGE128_PF 0x5046
29 /* Radeon RV100 (VE) */
30 #define PCI_DEVICE_ID_ATI_RADEON_QY 0x5159
32 #define TYPE_ATI_VGA "ati-vga"
33 typedef struct ATIVGAState ATIVGAState
;
34 DECLARE_INSTANCE_CHECKER(ATIVGAState
, ATI_VGA
,
37 typedef struct ATIVGARegs
{
39 uint32_t bios_scratch
[8];
40 uint32_t gen_int_cntl
;
41 uint32_t gen_int_status
;
42 uint32_t crtc_gen_cntl
;
43 uint32_t crtc_ext_cntl
;
45 uint32_t gpio_vga_ddc
;
46 uint32_t gpio_dvi_ddc
;
49 uint32_t crtc_h_total_disp
;
50 uint32_t crtc_h_sync_strt_wid
;
51 uint32_t crtc_v_total_disp
;
52 uint32_t crtc_v_sync_strt_wid
;
54 uint32_t crtc_offset_cntl
;
73 uint32_t dp_gui_master_cntl
;
74 uint32_t dp_brush_bkgd_clr
;
75 uint32_t dp_brush_frgd_clr
;
76 uint32_t dp_src_frgd_clr
;
77 uint32_t dp_src_bkgd_clr
;
81 uint32_t dp_write_mask
;
82 uint32_t default_offset
;
83 uint32_t default_pitch
;
84 uint32_t default_tile
;
85 uint32_t default_sc_bottom_right
;
94 bool cursor_guest_mode
;
96 uint32_t cursor_offset
;
98 QEMUTimer vblank_timer
;
99 bitbang_i2c_interface bbi2c
;
105 const char *ati_reg_name(int num
);
107 void ati_2d_blt(ATIVGAState
*s
);
109 #endif /* ATI_INT_H */