1 /* SPDX-License-Identifier: BSD-2-Clause */
3 /******************************************************************************
4 * Copyright (c) 2004, 2008 IBM Corporation
5 * Copyright (c) 2009 Pattrick Hueper <phueper@hueper.net>
7 * This program and the accompanying materials
8 * are made available under the terms of the BSD License
9 * which accompanies this distribution, and is available at
10 * http://www.opensource.org/licenses/bsd-license.php
13 * IBM Corporation - initial implementation
14 *****************************************************************************/
20 // these structs are for input from and output to OF
22 u8 display_type
; // 0 = NONE, 1 = analog, 2 = digital
25 u16 screen_linebytes
; // bytes per line in framebuffer, may be more
27 u8 color_depth
; // color depth in bits per pixel
28 u32 framebuffer_address
;
29 u8 edid_block_zero
[128];
30 } __packed screen_info_t
;
38 } __packed screen_info_input_t
;
41 u16 mode_attributes
; // 00
42 u8 win_a_attributes
; // 02
43 u8 win_b_attributes
; // 03
44 u16 win_granularity
; // 04
46 u16 win_a_segment
; // 08
47 u16 win_b_segment
; // 0a
48 u32 win_func_ptr
; // 0c
49 u16 bytes_per_scanline
; // 10
50 u16 x_resolution
; // 12
51 u16 y_resolution
; // 14
54 u8 number_of_planes
; // 18
55 u8 bits_per_pixel
; // 19
56 u8 number_of_banks
; // 20
57 u8 memory_model
; // 21
59 u8 number_of_image_pages
; // 23
67 u8 reserved_mask_size
;
69 u8 direct_color_mode_info
;
71 u32 offscreen_mem_offset
;
72 u16 offscreen_mem_size
;
74 } __packed vesa_mode_info_t
;
79 vesa_mode_info_t vesa
;
80 u8 mode_info_block
[256];
91 //u32 framebuffer_address;
95 u8 port_number
; // i.e. monitor number
96 u8 edid_transfer_time
;
98 u8 edid_block_zero
[128];
101 #define VESA_GET_INFO 0x4f00
102 #define VESA_GET_MODE_INFO 0x4f01
103 #define VESA_SET_MODE 0x4f02
105 void vbe_set_graphics(void);
106 void vbe_textmode_console(void);
109 * Returns the mode_info struct from the vbe context,
110 * if initialized. NULL on invalid mode_infos.
112 const vbe_mode_info_t
*vbe_mode_info(void);