blob: 8743a8c3197948aa5220f8f039dd838fa0c4dcfd [file] [log] [blame]
Simon Glass99811022014-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);
35
36 return (void *)gdev;
37}