diff options
author | Simon Glass <sjg@chromium.org> | 2014-11-14 20:56:34 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-11-25 07:11:16 -0700 |
commit | 998110241bfc5c7101e20e38948e0a3b68c3ecc9 (patch) | |
tree | 4fbf510b25f79268cfa9fc8965e7e1eedfcdfd26 /drivers/video/x86_fb.c | |
parent | 6854f87cbcad544dc07a02b96d358f81ca60c593 (diff) | |
download | u-boot-imx-998110241bfc5c7101e20e38948e0a3b68c3ecc9.zip u-boot-imx-998110241bfc5c7101e20e38948e0a3b68c3ecc9.tar.gz u-boot-imx-998110241bfc5c7101e20e38948e0a3b68c3ecc9.tar.bz2 |
x86: video: Add video driver for bare x86 boards
Add a very simple driver which uses vesa to discover the video mode and
then provides a frame buffer for use by U-Boot.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'drivers/video/x86_fb.c')
-rw-r--r-- | drivers/video/x86_fb.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/video/x86_fb.c b/drivers/video/x86_fb.c new file mode 100644 index 0000000..8743a8c --- /dev/null +++ b/drivers/video/x86_fb.c @@ -0,0 +1,37 @@ +/* + * + * Vesa frame buffer driver for x86 + * + * Copyright (C) 2014 Google, Inc + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <video_fb.h> +#include <vbe.h> +#include "videomodes.h" + +/* + * The Graphic Device + */ +GraphicDevice ctfb; + +void *video_hw_init(void) +{ + GraphicDevice *gdev = &ctfb; + int bits_per_pixel; + + printf("Video: "); + if (vbe_get_video_info(gdev)) { + printf("No video mode configured\n"); + return NULL; + } + + bits_per_pixel = gdev->gdfBytesPP * 8; + sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY, + bits_per_pixel); + printf("%s\n", gdev->modeIdent); + + return (void *)gdev; +} |