blob: 6641033a5df9bbbb3ea43c74953abd87e3aa5370 [file] [log] [blame]
Simon Glass1a3b66d2014-11-14 20:56:34 -07001/*
2 *
3 * Vesa frame buffer driver for x86
4 *
5 * Copyright (C) 2014 Google, Inc
6 *
7 * SPDX-License-Identifier: GPL-2.0+
8 */
9
10#include <common.h>
11#include <video_fb.h>
12#include <vbe.h>
13#include "videomodes.h"
14
15/*
16 * The Graphic Device
17 */
18GraphicDevice ctfb;
19
20void *video_hw_init(void)
21{
22 GraphicDevice *gdev = &ctfb;
23 int bits_per_pixel;
24
25 printf("Video: ");
26 if (vbe_get_video_info(gdev)) {
27 printf("No video mode configured\n");
28 return NULL;
29 }
30
31 bits_per_pixel = gdev->gdfBytesPP * 8;
32 sprintf(gdev->modeIdent, "%dx%dx%d", gdev->winSizeX, gdev->winSizeY,
33 bits_per_pixel);
34 printf("%s\n", gdev->modeIdent);
Simon Glassd40aeb22015-01-01 16:17:59 -070035 debug("Frame buffer at %x\n", gdev->frameAdrs);
Simon Glass1a3b66d2014-11-14 20:56:34 -070036
37 return (void *)gdev;
38}