Commit 153e1dda2ff62b0ecffa186a950bbfb82f1b474d
Committed by
Simon Glass
1 parent
3ff2f001c2
Exists in
v2017.01-smarct4x
and in
30 other branches
video: coreboot: Save VESA mode for future use
When booting as a coreboot payload, the framebuffer details are passed from coreboot via configuration tables. We save these information into vesa_mode_info structure for future use. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Showing 3 changed files with 27 additions and 1 deletions Side-by-side Diff
drivers/pci/pci_rom.c
drivers/video/coreboot_fb.c
... | ... | @@ -9,6 +9,7 @@ |
9 | 9 | #include <common.h> |
10 | 10 | #include <asm/arch/tables.h> |
11 | 11 | #include <asm/arch/sysinfo.h> |
12 | +#include <vbe.h> | |
12 | 13 | #include <video_fb.h> |
13 | 14 | #include "videomodes.h" |
14 | 15 | |
... | ... | @@ -17,6 +18,26 @@ |
17 | 18 | */ |
18 | 19 | GraphicDevice ctfb; |
19 | 20 | |
21 | +static void save_vesa_mode(void) | |
22 | +{ | |
23 | + struct vesa_mode_info *vesa = &mode_info.vesa; | |
24 | + struct cb_framebuffer *fb = lib_sysinfo.framebuffer; | |
25 | + | |
26 | + vesa->x_resolution = fb->x_resolution; | |
27 | + vesa->y_resolution = fb->y_resolution; | |
28 | + vesa->bits_per_pixel = fb->bits_per_pixel; | |
29 | + vesa->bytes_per_scanline = fb->bytes_per_line; | |
30 | + vesa->phys_base_ptr = fb->physical_address; | |
31 | + vesa->red_mask_size = fb->red_mask_size; | |
32 | + vesa->red_mask_pos = fb->red_mask_pos; | |
33 | + vesa->green_mask_size = fb->green_mask_size; | |
34 | + vesa->green_mask_pos = fb->green_mask_pos; | |
35 | + vesa->blue_mask_size = fb->blue_mask_size; | |
36 | + vesa->blue_mask_pos = fb->blue_mask_pos; | |
37 | + vesa->reserved_mask_size = fb->reserved_mask_size; | |
38 | + vesa->reserved_mask_pos = fb->reserved_mask_pos; | |
39 | +} | |
40 | + | |
20 | 41 | static int parse_coreboot_table_fb(GraphicDevice *gdev) |
21 | 42 | { |
22 | 43 | struct cb_framebuffer *fb = lib_sysinfo.framebuffer; |
... | ... | @@ -80,6 +101,9 @@ |
80 | 101 | |
81 | 102 | memset((void *)gdev->pciBase, 0, |
82 | 103 | gdev->winSizeX * gdev->winSizeY * gdev->gdfBytesPP); |
104 | + | |
105 | + /* Initialize vesa_mode_info structure */ | |
106 | + save_vesa_mode(); | |
83 | 107 | |
84 | 108 | return (void *)gdev; |
85 | 109 | } |
include/vbe.h