summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2015-08-13 00:29:16 -0700
committerSimon Glass <sjg@chromium.org>2015-08-26 07:54:08 -0700
commit153e1dda2ff62b0ecffa186a950bbfb82f1b474d (patch)
tree7173e0be720757634f73e088f0038ffd21239b83 /drivers/video
parent3ff2f001c2289186c88edf55779078395987bb60 (diff)
downloadtalos-obmc-uboot-153e1dda2ff62b0ecffa186a950bbfb82f1b474d.tar.gz
talos-obmc-uboot-153e1dda2ff62b0ecffa186a950bbfb82f1b474d.zip
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>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/coreboot_fb.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/video/coreboot_fb.c b/drivers/video/coreboot_fb.c
index 56c35c18fe..4790ef1fdc 100644
--- a/drivers/video/coreboot_fb.c
+++ b/drivers/video/coreboot_fb.c
@@ -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"
@@ -17,6 +18,26 @@
*/
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;
}
OpenPOWER on IntegriCloud