Simon Glass | 1a3b66d | 2014-11-14 20:56:34 -0700 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 18 | GraphicDevice ctfb; |
| 19 | |
| 20 | void *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 Glass | d40aeb2 | 2015-01-01 16:17:59 -0700 | [diff] [blame] | 35 | debug("Frame buffer at %x\n", gdev->frameAdrs); |
Simon Glass | 1a3b66d | 2014-11-14 20:56:34 -0700 | [diff] [blame] | 36 | |
| 37 | return (void *)gdev; |
| 38 | } |