]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
video: coreboot: Save VESA mode for future use
authorBin Meng <bmeng.cn@gmail.com>
Thu, 13 Aug 2015 07:29:16 +0000 (00:29 -0700)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 09:29:45 +0000 (11:29 +0200)
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>
drivers/pci/pci_rom.c
drivers/video/coreboot_fb.c
include/vbe.h

index 26db3ca0a1344c7b928168ff301be507cfff695b..b9a3990ecc870c9623ed0948c82645b0e4749561 100644 (file)
@@ -187,7 +187,7 @@ int pci_rom_load(struct pci_rom_header *rom_header,
        return 0;
 }
 
-static struct vbe_mode_info mode_info;
+struct vbe_mode_info mode_info;
 
 int vbe_get_video_info(struct graphic_device *gdev)
 {
index 56c35c18fe670ed760dee2464507ed8351343e92..4790ef1fdc0604efe181c27289d4d47131144cce 100644 (file)
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <asm/arch/tables.h>
 #include <asm/arch/sysinfo.h>
+#include <vbe.h>
 #include <video_fb.h>
 #include "videomodes.h"
 
  */
 GraphicDevice ctfb;
 
+static void save_vesa_mode(void)
+{
+       struct vesa_mode_info *vesa = &mode_info.vesa;
+       struct cb_framebuffer *fb = lib_sysinfo.framebuffer;
+
+       vesa->x_resolution = fb->x_resolution;
+       vesa->y_resolution = fb->y_resolution;
+       vesa->bits_per_pixel = fb->bits_per_pixel;
+       vesa->bytes_per_scanline = fb->bytes_per_line;
+       vesa->phys_base_ptr = fb->physical_address;
+       vesa->red_mask_size = fb->red_mask_size;
+       vesa->red_mask_pos = fb->red_mask_pos;
+       vesa->green_mask_size = fb->green_mask_size;
+       vesa->green_mask_pos = fb->green_mask_pos;
+       vesa->blue_mask_size = fb->blue_mask_size;
+       vesa->blue_mask_pos = fb->blue_mask_pos;
+       vesa->reserved_mask_size = fb->reserved_mask_size;
+       vesa->reserved_mask_pos = fb->reserved_mask_pos;
+}
+
 static int parse_coreboot_table_fb(GraphicDevice *gdev)
 {
        struct cb_framebuffer *fb = lib_sysinfo.framebuffer;
@@ -81,5 +102,8 @@ void *video_hw_init(void)
        memset((void *)gdev->pciBase, 0,
                gdev->winSizeX * gdev->winSizeY * gdev->gdfBytesPP);
 
+       /* Initialize vesa_mode_info structure */
+       save_vesa_mode();
+
        return (void *)gdev;
 }
index 1a86db886adc7a0aed887017ba174cf70dbf3df7..164ccae28000a02ead7125388945f6aede9b57a0 100644 (file)
@@ -102,6 +102,8 @@ struct vbe_ddc_info {
 #define VESA_SET_MODE          0x4f02
 #define VESA_GET_CUR_MODE      0x4f03
 
+extern struct vbe_mode_info mode_info;
+
 struct graphic_device;
 int vbe_get_video_info(struct graphic_device *gdev);