From fc53a631498c405f461d24a7e057fb826c41eb69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 12 Jul 2008 19:33:03 +0000 Subject: [PATCH] * On some systems, switching the resolution in VESA mode during runtime did not work and gave a "General System Error". Jan Kloetzke provided a temporary work around, the area which the BIOS can access is enlarged, although according to specs, this should not be needed. * After switching modes in the VESA driver, turn on write combining for the frame buffer area. This gives a huge speed boost for all graphics drawing. Only people for which mode changes did not work were using the full speed since the VESA mode switching support was added. * Cleanup in the Jamfile, some header directories were included multiple times. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26395 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/drivers/graphics/vesa/Jamfile | 5 +++-- src/add-ons/kernel/drivers/graphics/vesa/vesa.cpp | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/add-ons/kernel/drivers/graphics/vesa/Jamfile b/src/add-ons/kernel/drivers/graphics/vesa/Jamfile index 656159be4f..358aa3e6f6 100644 --- a/src/add-ons/kernel/drivers/graphics/vesa/Jamfile +++ b/src/add-ons/kernel/drivers/graphics/vesa/Jamfile @@ -1,7 +1,8 @@ SubDir HAIKU_TOP src add-ons kernel drivers graphics vesa ; -UsePrivateHeaders kernel graphics [ FDirName graphics common ] ; -UsePrivateHeaders kernel graphics [ FDirName graphics vesa ] ; +UsePrivateHeaders [ FDirName graphics common ] ; +UsePrivateHeaders [ FDirName graphics vesa ] ; +UsePrivateKernelHeaders ; KernelAddon vesa : device.cpp diff --git a/src/add-ons/kernel/drivers/graphics/vesa/vesa.cpp b/src/add-ons/kernel/drivers/graphics/vesa/vesa.cpp index 88b4d05d8d..f5fcf87b0e 100644 --- a/src/add-ons/kernel/drivers/graphics/vesa/vesa.cpp +++ b/src/add-ons/kernel/drivers/graphics/vesa/vesa.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include "driver.h" #include "utility.h" @@ -174,7 +175,7 @@ vesa_set_display_mode(vesa_info &info, unsigned int mode) // Prepare vm86 mode environment struct vm86_state vmState; - status_t status = vm86_prepare(&vmState, 0x2000); + status_t status = vm86_prepare(&vmState, 0x20000); if (status != B_OK) { dprintf(DEVICE_NAME": vesa_set_display_mode(): vm86_prepare failed\n"); return status; @@ -210,6 +211,9 @@ vesa_set_display_mode(vesa_info &info, unsigned int mode) } delete_area(info.shared_info->frame_buffer_area); + // Turn on write combining for the area + vm_set_area_memory_type(newFBArea, modeInfo.physical_base, B_MTR_WC); + // Update shared frame buffer information info.shared_info->frame_buffer_area = newFBArea; info.shared_info->frame_buffer = (uint8 *)frameBuffer;