9 /* Terminator for register set */
11 #define VGA_REGSET_END_VAL 0xFF
12 #define VGA_REGSET_END {VGA_REGSET_END_VAL, 0, 0}
20 /* ------------------------------------------------------------------------- */
22 #define SVGA_FORMAT_END_VAL 0xFFFF
23 #define SVGA_FORMAT_END {SVGA_FORMAT_END_VAL, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, 0, 0, 0, 0, 0, 0}
25 struct svga_fb_format
{
28 struct fb_bitfield red
;
29 struct fb_bitfield green
;
30 struct fb_bitfield blue
;
31 struct fb_bitfield transp
;
41 struct svga_timing_regs
{
42 const struct vga_regset
*h_total_regs
;
43 const struct vga_regset
*h_display_regs
;
44 const struct vga_regset
*h_blank_start_regs
;
45 const struct vga_regset
*h_blank_end_regs
;
46 const struct vga_regset
*h_sync_start_regs
;
47 const struct vga_regset
*h_sync_end_regs
;
49 const struct vga_regset
*v_total_regs
;
50 const struct vga_regset
*v_display_regs
;
51 const struct vga_regset
*v_blank_start_regs
;
52 const struct vga_regset
*v_blank_end_regs
;
53 const struct vga_regset
*v_sync_start_regs
;
54 const struct vga_regset
*v_sync_end_regs
;
63 u16 r_max
; /* r_max < 32 */
70 /* Write a value to the attribute register */
72 static inline void svga_wattr(u8 index
, u8 data
)
79 /* Write a value to a sequence register with a mask */
81 static inline void svga_wseq_mask(u8 index
, u8 data
, u8 mask
)
83 vga_wseq(NULL
, index
, (data
& mask
) | (vga_rseq(NULL
, index
) & ~mask
));
86 /* Write a value to a CRT register with a mask */
88 static inline void svga_wcrt_mask(u8 index
, u8 data
, u8 mask
)
90 vga_wcrt(NULL
, index
, (data
& mask
) | (vga_rcrt(NULL
, index
) & ~mask
));
93 static inline int svga_primary_device(struct pci_dev
*dev
)
96 pci_read_config_word(dev
, PCI_COMMAND
, &flags
);
97 return (flags
& PCI_COMMAND_IO
);
101 void svga_wcrt_multi(const struct vga_regset
*regset
, u32 value
);
102 void svga_wseq_multi(const struct vga_regset
*regset
, u32 value
);
104 void svga_set_default_gfx_regs(void);
105 void svga_set_default_atc_regs(void);
106 void svga_set_default_seq_regs(void);
107 void svga_set_default_crt_regs(void);
108 void svga_set_textmode_vga_regs(void);
110 void svga_settile(struct fb_info
*info
, struct fb_tilemap
*map
);
111 void svga_tilecopy(struct fb_info
*info
, struct fb_tilearea
*area
);
112 void svga_tilefill(struct fb_info
*info
, struct fb_tilerect
*rect
);
113 void svga_tileblit(struct fb_info
*info
, struct fb_tileblit
*blit
);
114 void svga_tilecursor(struct fb_info
*info
, struct fb_tilecursor
*cursor
);
115 int svga_get_tilemax(struct fb_info
*info
);
116 void svga_get_caps(struct fb_info
*info
, struct fb_blit_caps
*caps
,
117 struct fb_var_screeninfo
*var
);
119 int svga_compute_pll(const struct svga_pll
*pll
, u32 f_wanted
, u16
*m
, u16
*n
, u16
*r
, int node
);
120 int svga_check_timings(const struct svga_timing_regs
*tm
, struct fb_var_screeninfo
*var
, int node
);
121 void svga_set_timings(const struct svga_timing_regs
*tm
, struct fb_var_screeninfo
*var
, u32 hmul
, u32 hdiv
, u32 vmul
, u32 vdiv
, u32 hborder
, int node
);
123 int svga_match_format(const struct svga_fb_format
*frm
, struct fb_var_screeninfo
*var
, struct fb_fix_screeninfo
*fix
);
125 #endif /* __KERNEL__ */
126 #endif /* _LINUX_SVGA_H */