update include/dev/display, add platform/display

This commit is contained in:
James Sullins committed 2011-10-30 10:33:54 -05:00
1 parent c58d99234b
commit 784c283e2e
2 files changed
+57 -1

No files matched your search

+2 -1
View File
@@ -26,7 +26,7 @@
#include <sys/types.h>
#include <lib/gfx.h>
int display_init(void *framebuffer);
void display_init(void);
int display_enable(bool enable);
void display_pre_freq_change(void);
void display_post_freq_change(void);
@@ -37,6 +37,7 @@ struct display_info {
uint width;
uint height;
uint stride;
uint rotation;
// Update function
void (*flush)(uint starty, uint endy);
+55
View File
@@ -0,0 +1,55 @@
/*
* Copyright (c) 2010 Travis Geiselbrecht
*
* Copyright (c) 2011 James Sullins
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <err.h>
#include <debug.h>
#include <platform.h>
#include <dev/display.h>
#include <lib/gfx.h>
#include <reg.h>
static int display_w, display_h;
static void *display_fb;
void platform_init_display(void)
{
display_fb = (void *)0x7f600000;
display_w = 1024;
display_h = 768;
}
void display_get_info(struct display_info *info)
{
info->framebuffer = display_fb;
info->format = GFX_FORMAT_RGB_x888;
info->width = display_w;
info->height = display_h;
info->stride = display_w;
info->flush = NULL;
info->rotation = 0;
}