]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
x86: video: Add video driver for bare x86 boards
authorSimon Glass <sjg@chromium.org>
Sat, 15 Nov 2014 03:56:34 +0000 (20:56 -0700)
committerSimon Glass <sjg@chromium.org>
Tue, 25 Nov 2014 14:11:16 +0000 (07:11 -0700)
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>
drivers/video/Makefile
drivers/video/x86_fb.c [new file with mode: 0644]

index 14a6781edca17c9bd830c6b714a081b133030d80..000f389b9397e242b33b3489807e74388a9348b6 100644 (file)
@@ -41,6 +41,7 @@ obj-$(CONFIG_VIDEO_SM501) += sm501.o
 obj-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o videomodes.o
 obj-$(CONFIG_VIDEO_TEGRA) += tegra.o
 obj-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o
+obj-$(CONFIG_VIDEO_X86) += x86_fb.o
 obj-$(CONFIG_FORMIKE) += formike.o
 obj-$(CONFIG_AM335X_LCD) += am335x-fb.o
 obj-$(CONFIG_VIDEO_PARADE) += parade.o
diff --git a/drivers/video/x86_fb.c b/drivers/video/x86_fb.c
new file mode 100644 (file)
index 0000000..8743a8c
--- /dev/null
@@ -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;
+}