From c88974d026f2ff5393aa6f6e7160004dff4454fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 29 May 2005 20:23:00 +0000 Subject: [PATCH] The app_server now updates the kernel's blue screen frame buffer on mode changes (only the accelerant HW interface does this for now). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12897 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/syscalls.h | 3 +++ .../app/drawing/AccelerantHWInterface.cpp | 20 +++++++++++++++++++ .../kernel/debug/frame_buffer_console.cpp | 17 +++++++++++++--- src/system/kernel/syscalls.c | 1 + 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/headers/private/kernel/syscalls.h b/headers/private/kernel/syscalls.h index 8444aa1997..d48fb04661 100644 --- a/headers/private/kernel/syscalls.h +++ b/headers/private/kernel/syscalls.h @@ -268,7 +268,10 @@ int sys_socket(int family, int type, int proto); /* System informations */ extern status_t _kern_get_system_info(system_info *info, size_t size); +/* Debug output */ extern void _kern_debug_output(const char *message); +extern status_t _kern_frame_buffer_update(addr_t baseAddress, int32 width, + int32 height, int32 depth, int32 bytesPerRow); /* messaging service */ extern area_id _kern_register_messaging_service(sem_id lockingSem, diff --git a/src/servers/app/drawing/AccelerantHWInterface.cpp b/src/servers/app/drawing/AccelerantHWInterface.cpp index 6e2c5fa018..491560f29d 100644 --- a/src/servers/app/drawing/AccelerantHWInterface.cpp +++ b/src/servers/app/drawing/AccelerantHWInterface.cpp @@ -42,6 +42,15 @@ # define ATRACE(x) ; #endif + +// This call updates the frame buffer used by the on-screen KDL +#ifdef __HAIKU__ +extern "C" status_t _kern_frame_buffer_update(void *baseAddress, + int32 width, int32 height, + int32 depth, int32 bytesPerRow); +#endif + + // constructor AccelerantHWInterface::AccelerantHWInterface() : HWInterface(), @@ -358,6 +367,17 @@ AccelerantHWInterface::SetMode(const display_mode &mode) if (UpdateFrameBufferConfig() != B_OK) return B_ERROR; + // Update the frame buffer used by the on-screen KDL +#ifdef __HAIKU__ + uint32 depth = (fFrameBufferConfig.bytes_per_row / fDisplayMode.virtual_width) << 3; + if (fDisplayMode.space == B_RGB15) + depth = 15; + + _kern_frame_buffer_update(fFrameBufferConfig.frame_buffer, + fDisplayMode.virtual_width, fDisplayMode.virtual_height, + depth, fFrameBufferConfig.bytes_per_row); +#endif + // update backbuffer if neccessary if (!fBackBuffer || fBackBuffer->Width() != fDisplayMode.virtual_width || fBackBuffer->Height() != fDisplayMode.virtual_height) { diff --git a/src/system/kernel/debug/frame_buffer_console.cpp b/src/system/kernel/debug/frame_buffer_console.cpp index a696e2ada8..26fdac5130 100644 --- a/src/system/kernel/debug/frame_buffer_console.cpp +++ b/src/system/kernel/debug/frame_buffer_console.cpp @@ -193,6 +193,9 @@ console_get_size(int32 *_width, int32 *_height) static void console_move_cursor(int32 x, int32 y) { + if (!frame_buffer_console_available()) + return; + draw_cursor(sConsole.cursor_x, sConsole.cursor_y); draw_cursor(x, y); @@ -204,7 +207,8 @@ console_move_cursor(int32 x, int32 y) static void console_put_glyph(int32 x, int32 y, uint8 glyph, uint8 attr) { - if (x >= sConsole.columns || y >= sConsole.rows) + if (x >= sConsole.columns || y >= sConsole.rows + || !frame_buffer_console_available()) return; render_glyph(x, y, glyph, attr); @@ -214,7 +218,8 @@ console_put_glyph(int32 x, int32 y, uint8 glyph, uint8 attr) static void console_fill_glyph(int32 x, int32 y, int32 width, int32 height, uint8 glyph, uint8 attr) { - if (x >= sConsole.columns || y >= sConsole.rows) + if (x >= sConsole.columns || y >= sConsole.rows + || !frame_buffer_console_available()) return; int32 left = x + width; @@ -236,6 +241,9 @@ console_fill_glyph(int32 x, int32 y, int32 width, int32 height, uint8 glyph, uin static void console_blit(int32 srcx, int32 srcy, int32 width, int32 height, int32 destx, int32 desty) { + if (!frame_buffer_console_available()) + return; + height *= CHAR_HEIGHT; srcy *= CHAR_HEIGHT; desty *= CHAR_HEIGHT; @@ -261,6 +269,9 @@ console_blit(int32 srcx, int32 srcy, int32 width, int32 height, int32 destx, int static void console_clear(uint8 attr) { + if (!frame_buffer_console_available()) + return; + switch (sConsole.bytes_per_pixel) { case 1: if (sConsole.depth >= 8) { @@ -420,7 +431,7 @@ _user_frame_buffer_update(addr_t baseAddress, int32 width, int32 height, { if (geteuid() != 0) return B_NOT_ALLOWED; - if (IS_USER_ADDRESS(baseAddress)) + if (IS_USER_ADDRESS(baseAddress) && baseAddress != NULL) return B_BAD_ADDRESS; return frame_buffer_update(baseAddress, width, height, depth, bytesPerRow); diff --git a/src/system/kernel/syscalls.c b/src/system/kernel/syscalls.c index 770e736d64..f7394cda78 100644 --- a/src/system/kernel/syscalls.c +++ b/src/system/kernel/syscalls.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include