From 11f838fbf77e24552a5a59ca768497b1b5c981a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 19 Oct 2004 17:17:04 +0000 Subject: [PATCH] Updated due to changes to the kernel_args frame buffer structure. Most importantly, it now always uses map_physical_memory(), and no longer relies on eventually mapped data by the boot loader (that the VM didn't know about). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9418 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/drivers/fb_console/fb_console.c | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/kernel/drivers/fb_console/fb_console.c b/src/kernel/drivers/fb_console/fb_console.c index 4688ea46a5..51cf8e07e3 100755 --- a/src/kernel/drivers/fb_console/fb_console.c +++ b/src/kernel/drivers/fb_console/fb_console.c @@ -26,8 +26,7 @@ # define TRACE(x) ; #endif - -int fb_console_dev_init(kernel_args *ka); +status_t fb_console_dev_init(kernel_args *args); #define WRAP(x, limit) ((x) % (limit)) // This version makes the sh4 compiler throw up @@ -436,30 +435,31 @@ static device_hooks sFrameBufferConsoleHooks = { }; -int -fb_console_dev_init(kernel_args *ka) +status_t +fb_console_dev_init(kernel_args *args) { + status_t status; int i; - if (!ka->fb.enabled) + if (!args->frame_buffer.enabled) return B_OK; - TRACE(("fb_console_dev_init: framebuffer found at 0x%lx, x %d, y %d, bit depth %d\n", - ka->fb.mapping.start, ka->fb.x_size, ka->fb.y_size, ka->fb.bit_depth)); + TRACE(("fb_console_dev_init: framebuffer found at 0x%lx, x %ld, y %ld, bit depth %ld\n", + args->frame_buffer.physical_buffer.start, args->frame_buffer.width, + args->frame_buffer.height, args->frame_buffer.depth)); memset(&console, 0, sizeof(console)); - if (ka->fb.already_mapped) { - console.fb = ka->fb.mapping.start; - } else { - map_physical_memory("vesa_fb", (void *)ka->fb.mapping.start, ka->fb.mapping.size, - B_ANY_KERNEL_ADDRESS, /*B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA*/ 0, (void **)&console.fb); - } + status = map_physical_memory("vesa_fb", (void *)args->frame_buffer.physical_buffer.start, + args->frame_buffer.physical_buffer.size, B_ANY_KERNEL_ADDRESS, + B_READ_AREA | B_WRITE_AREA, (void **)&console.fb); + if (status < B_OK) + return status; - console.fb_x = ka->fb.x_size; - console.fb_y = ka->fb.y_size; - console.fb_pixel_bytes = ka->fb.bit_depth / 8; - console.fb_size = ka->fb.mapping.size; + console.fb_x = args->frame_buffer.width; + console.fb_y = args->frame_buffer.height; + console.fb_pixel_bytes = args->frame_buffer.depth / 8; + console.fb_size = args->frame_buffer.physical_buffer.size; switch (console.fb_pixel_bytes) { case 1: