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
This commit is contained in:
@@ -26,8 +26,7 @@
|
|||||||
# define TRACE(x) ;
|
# define TRACE(x) ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
status_t fb_console_dev_init(kernel_args *args);
|
||||||
int fb_console_dev_init(kernel_args *ka);
|
|
||||||
|
|
||||||
#define WRAP(x, limit) ((x) % (limit))
|
#define WRAP(x, limit) ((x) % (limit))
|
||||||
// This version makes the sh4 compiler throw up
|
// This version makes the sh4 compiler throw up
|
||||||
@@ -436,30 +435,31 @@ static device_hooks sFrameBufferConsoleHooks = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
int
|
status_t
|
||||||
fb_console_dev_init(kernel_args *ka)
|
fb_console_dev_init(kernel_args *args)
|
||||||
{
|
{
|
||||||
|
status_t status;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!ka->fb.enabled)
|
if (!args->frame_buffer.enabled)
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
TRACE(("fb_console_dev_init: framebuffer found at 0x%lx, x %d, y %d, bit depth %d\n",
|
TRACE(("fb_console_dev_init: framebuffer found at 0x%lx, x %ld, y %ld, bit depth %ld\n",
|
||||||
ka->fb.mapping.start, ka->fb.x_size, ka->fb.y_size, ka->fb.bit_depth));
|
args->frame_buffer.physical_buffer.start, args->frame_buffer.width,
|
||||||
|
args->frame_buffer.height, args->frame_buffer.depth));
|
||||||
|
|
||||||
memset(&console, 0, sizeof(console));
|
memset(&console, 0, sizeof(console));
|
||||||
|
|
||||||
if (ka->fb.already_mapped) {
|
status = map_physical_memory("vesa_fb", (void *)args->frame_buffer.physical_buffer.start,
|
||||||
console.fb = ka->fb.mapping.start;
|
args->frame_buffer.physical_buffer.size, B_ANY_KERNEL_ADDRESS,
|
||||||
} else {
|
B_READ_AREA | B_WRITE_AREA, (void **)&console.fb);
|
||||||
map_physical_memory("vesa_fb", (void *)ka->fb.mapping.start, ka->fb.mapping.size,
|
if (status < B_OK)
|
||||||
B_ANY_KERNEL_ADDRESS, /*B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA*/ 0, (void **)&console.fb);
|
return status;
|
||||||
}
|
|
||||||
|
|
||||||
console.fb_x = ka->fb.x_size;
|
console.fb_x = args->frame_buffer.width;
|
||||||
console.fb_y = ka->fb.y_size;
|
console.fb_y = args->frame_buffer.height;
|
||||||
console.fb_pixel_bytes = ka->fb.bit_depth / 8;
|
console.fb_pixel_bytes = args->frame_buffer.depth / 8;
|
||||||
console.fb_size = ka->fb.mapping.size;
|
console.fb_size = args->frame_buffer.physical_buffer.size;
|
||||||
|
|
||||||
switch (console.fb_pixel_bytes) {
|
switch (console.fb_pixel_bytes) {
|
||||||
case 1:
|
case 1:
|
||||||
|
|||||||
Reference in New Issue
Block a user