1 /******************************************************************************
2 * Copyright (c) 2004, 2008 IBM Corporation
3 * Copyright (c) 2009 Pattrick Hueper <phueper@hueper.net>
6 * SPDX-License-Identifier: BSD-2-Clause
9 * IBM Corporation - initial implementation
10 *****************************************************************************/
14 /* these structs are for input from and output to OF */
15 struct __packed vbe_screen_info
{
16 u8 display_type
; /* 0=NONE, 1= analog, 2=digital */
19 /* bytes per line in framebuffer, may be more than screen_width */
21 u8 color_depth
; /* color depth in bits per pixel */
22 u32 framebuffer_address
;
23 u8 edid_block_zero
[128];
26 struct __packed vbe_screen_info_input
{
34 /* these structs only store the required a subset of the VBE-defined fields */
35 struct __packed vbe_info
{
48 struct __packed vesa_mode_info
{
49 u16 mode_attributes
; /* 00 */
50 u8 win_a_attributes
; /* 02 */
51 u8 win_b_attributes
; /* 03 */
52 u16 win_granularity
; /* 04 */
53 u16 win_size
; /* 06 */
54 u16 win_a_segment
; /* 08 */
55 u16 win_b_segment
; /* 0a */
56 u32 win_func_ptr
; /* 0c */
57 u16 bytes_per_scanline
; /* 10 */
58 u16 x_resolution
; /* 12 */
59 u16 y_resolution
; /* 14 */
60 u8 x_charsize
; /* 16 */
61 u8 y_charsize
; /* 17 */
62 u8 number_of_planes
; /* 18 */
63 u8 bits_per_pixel
; /* 19 */
64 u8 number_of_banks
; /* 20 */
65 u8 memory_model
; /* 21 */
66 u8 bank_size
; /* 22 */
67 u8 number_of_image_pages
; /* 23 */
75 u8 reserved_mask_size
;
77 u8 direct_color_mode_info
;
79 u32 offscreen_mem_offset
;
80 u16 offscreen_mem_size
;
84 struct vbe_mode_info
{
88 struct vesa_mode_info vesa
;
89 u8 mode_info_block
[256];
94 u8 port_number
; /* i.e. monitor number */
95 u8 edid_transfer_time
;
97 u8 edid_block_zero
[128];
100 #define VESA_GET_INFO 0x4f00
101 #define VESA_GET_MODE_INFO 0x4f01
102 #define VESA_SET_MODE 0x4f02
103 #define VESA_GET_CUR_MODE 0x4f03
105 struct graphic_device
;
106 int vbe_get_video_info(struct graphic_device
*gdev
);