1 /******************************************************************************
2 * Copyright (c) 2004, 2008 IBM Corporation
3 * Copyright (c) 2009 Pattrick Hueper <phueper@hueper.net>
5 * This program and the accompanying materials
6 * are made available under the terms of the BSD License
7 * which accompanies this distribution, and is available at
8 * http://www.opensource.org/licenses/bsd-license.php
11 * IBM Corporation - initial implementation
12 *****************************************************************************/
14 // these structs are for input from and output to OF
16 u8 display_type; // 0=NONE, 1= analog, 2=digital
19 u16 screen_linebytes; // bytes per line in framebuffer, may be more than screen_width
20 u8 color_depth; // color depth in bpp
21 u32 framebuffer_address;
22 u8 edid_block_zero[128];
23 } __attribute__ ((__packed__)) screen_info_t;
31 } __attribute__ ((__packed__)) screen_info_input_t;
33 // these structs only store a subset of the VBE defined fields
40 u16 video_mode_list[256]; // lets hope we never have more than 256 video modes...
45 u16 mode_attributes; // 00
46 u8 win_a_attributes; // 02
47 u8 win_b_attributes; // 03
48 u16 win_granularity; // 04
50 u16 win_a_segment; // 08
51 u16 win_b_segment; // 0a
52 u32 win_func_ptr; // 0c
53 u16 bytes_per_scanline; // 10
54 u16 x_resolution; // 12
55 u16 y_resolution; // 14
58 u8 number_of_planes; // 18
59 u8 bits_per_pixel; // 19
60 u8 number_of_banks; // 20
61 u8 memory_model; // 21
63 u8 number_of_image_pages; // 23
71 u8 reserved_mask_size;
73 u8 direct_color_mode_info;
75 u32 offscreen_mem_offset;
76 u16 offscreen_mem_size;
78 } __attribute__ ((__packed__)) vesa_mode_info_t;
83 vesa_mode_info_t vesa;
84 u8 mode_info_block[256];
95 //u32 framebuffer_address;
99 u8 port_number; // i.e. monitor number
100 u8 edid_transfer_time;
102 u8 edid_block_zero[128];
105 struct lb_framebuffer;
107 void vbe_set_graphics(void);
108 void vbe_textmode_console(void);
109 void fill_lb_framebuffer(struct lb_framebuffer *framebuffer);
111 #define VESA_GET_INFO 0x4f00
112 #define VESA_GET_MODE_INFO 0x4f01
113 #define VESA_SET_MODE 0x4f02