mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-11 22:03:15 +00:00
998110241b
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>
37 lines
638 B
C
37 lines
638 B
C
/*
|
|
*
|
|
* 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;
|
|
}
|