blob: 55e3bc4cac9d5bf9078c28b5987e09652d6d7400 [file] [log] [blame]
Kevin O'Connor5108c692011-12-31 19:13:45 -05001#ifndef __VGAHW_H
2#define __VGAHW_H
3
4#include "types.h" // u8
5#include "config.h" // CONFIG_*
6
7#include "clext.h" // clext_set_mode
8#include "bochsvga.h" // bochsvga_set_mode
9#include "stdvga.h" // stdvga_set_mode
Nils31eabf92012-01-14 12:11:41 -050010#include "geodevga.h" // geodevga_init
Kevin O'Connor5108c692011-12-31 19:13:45 -050011
Kevin O'Connor10dff3d2012-01-09 19:19:44 -050012static inline struct vgamode_s *vgahw_find_mode(int mode) {
13 return stdvga_find_mode(mode);
14}
15
Kevin O'Connor5108c692011-12-31 19:13:45 -050016static inline int vgahw_set_mode(int mode, int flags) {
17 if (CONFIG_VGA_CIRRUS)
18 return clext_set_mode(mode, flags);
19 if (CONFIG_VGA_BOCHS)
20 return bochsvga_set_mode(mode, flags);
21 return stdvga_set_mode(mode, flags);
22}
23
Kevin O'Connor161d2012011-12-31 19:42:21 -050024static inline int vgahw_init(void) {
25 if (CONFIG_VGA_CIRRUS)
26 return clext_init();
27 if (CONFIG_VGA_BOCHS)
28 return bochsvga_init();
Nils24ddd862012-01-14 12:15:14 -050029 if (CONFIG_VGA_GEODEGX2 || CONFIG_VGA_GEODELX)
Nils31eabf92012-01-14 12:11:41 -050030 return geodevga_init();
Kevin O'Connor161d2012011-12-31 19:42:21 -050031 return stdvga_init();
32}
33
Kevin O'Connor5108c692011-12-31 19:13:45 -050034#endif // vgahw.h