Remove dumb-framebuffer handling logic from the VESA driver.

This reverts commit a0db7ef272.
This reverts commit 40cdf7d607.
This reverts commit 2ff22d6734.
This reverts commit b9eacd390d.
This partially reverts commit 5ae7ac5fd9.

This was all added in the run-up to the removal of the framebuffer driver,
or was added since then to enhance framebuffer-only support in that driver.

Change-Id: I32ab8199f22cf6846545ae19e943c98012b2a1d0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4615
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Augustin Cavalier
2021-10-20 17:12:21 +00:00
committed by waddlesplash
parent f7bd3509e3
commit 66415cd209
6 changed files with 25 additions and 82 deletions
+5 -3
View File
@@ -143,7 +143,8 @@ SYSTEM_NETWORK_PROTOCOLS =
;
SYSTEM_ADD_ONS_ACCELERANTS = [ FFilterByBuildFeatures
x86,x86_64,riscv64 @{
framebuffer.accelerant
x86,x86_64 @{
vesa.accelerant
}@ # x86,x86_64,riscv64
riscv64 @{
@@ -174,9 +175,10 @@ SYSTEM_ADD_ONS_DRIVERS_AUDIO = ;
SYSTEM_ADD_ONS_DRIVERS_AUDIO_OLD = ;
SYSTEM_ADD_ONS_DRIVERS_GRAPHICS = [ FFilterByBuildFeatures
x86,x86_64,riscv64 @{
framebuffer
x86,x86_64 @{
vesa
}@ # x86,x86_64,riscv64
}@ # x86,x86_64
riscv64 @{
radeon_hd
}@ # riscv64
+2 -13
View File
@@ -1,6 +1,5 @@
/*
* Copyright 2005-2008, Axel Dörfler, [email protected]. All rights reserved.
* Copyright 2016-207, Jessica Hamilton, [email protected].
* Distributed under the terms of the MIT License.
*/
@@ -67,9 +66,6 @@ init_common(int device, bool isClone)
if (status < B_OK)
return status;
if (gInfo->shared_info->vesa_mode_count == 0)
gInfo->vesa_modes = NULL;
else
gInfo->vesa_modes = (vesa_mode *)((uint8 *)gInfo->shared_info
+ gInfo->shared_info->vesa_mode_offset);
@@ -191,16 +187,9 @@ status_t
vesa_get_accelerant_device_info(accelerant_device_info *info)
{
info->version = B_ACCELERANT_VERSION;
// TODO: provide some more insight here...
if (gInfo->vesa_modes != NULL) {
strcpy(info->name, "VESA driver");
strcpy(info->name, "VESA Driver");
strcpy(info->chipset, "VESA");
} else {
strcpy(info->name, "Framebuffer");
strcpy(info->chipset, "");
}
// ToDo: provide some more insight here...
strcpy(info->serial_no, "None");
#if 0
+3 -41
View File
@@ -53,16 +53,6 @@ is_mode_supported(display_mode* mode)
{
vesa_mode* modes = gInfo->vesa_modes;
if (modes == NULL) {
// we're a UEFI framebuffer, just confirm it's our current mode
const display_mode &current = gInfo->shared_info->current_mode;
return mode->virtual_width == current.virtual_width
&& mode->virtual_height == current.virtual_height
&& mode->h_display_start == current.h_display_start
&& mode->v_display_start == current.v_display_start
&& mode->space == current.space;
}
for (uint32 i = gInfo->shared_info->vesa_mode_count; i-- > 0;) {
// search mode in VESA mode list
// TODO: list is ordered, we could use binary search
@@ -85,20 +75,12 @@ create_mode_list(void)
{
const color_space kVesaSpaces[] = {B_RGB32_LITTLE, B_RGB24_LITTLE,
B_RGB16_LITTLE, B_RGB15_LITTLE, B_CMAP8};
const color_space kUefiSpaces[] = {
(color_space)gInfo->shared_info->current_mode.space
};
uint32 initialModesCount = 0;
bool vesaAvailable = gInfo->vesa_modes != NULL;
// Add initial VESA modes.
display_mode* initialModes = NULL;
if (vesaAvailable) {
initialModes = (display_mode*)malloc(
display_mode* initialModes = (display_mode*)malloc(
sizeof(display_mode) * gInfo->shared_info->vesa_mode_count);
}
if (initialModes != NULL) {
initialModesCount = gInfo->shared_info->vesa_mode_count;
vesa_mode* vesaModes = gInfo->vesa_modes;
@@ -109,28 +91,12 @@ create_mode_list(void)
fill_display_mode(vesaModes[i].width, vesaModes[i].height,
&initialModes[i]);
}
} else {
// UEFI doesn't give us any VESA modes
initialModes = (display_mode*)malloc(sizeof(display_mode));
if (initialModes != NULL) {
initialModesCount = 1;
display_mode &mode = gInfo->shared_info->current_mode;
compute_display_timing(mode.virtual_width, mode.virtual_height,
60, false, &initialModes[0].timing);
fill_display_mode(mode.virtual_width, mode.virtual_height,
&initialModes[0]);
}
}
const color_space *colorSpaces = vesaAvailable ? kVesaSpaces : kUefiSpaces;
size_t colorSpaceCount = vesaAvailable ?
sizeof(kVesaSpaces) / sizeof(kVesaSpaces[0]) : 1;
gInfo->mode_list_area = create_display_modes("vesa modes",
gInfo->shared_info->has_edid ? &gInfo->shared_info->edid_info : NULL,
initialModes, initialModesCount, colorSpaces, colorSpaceCount,
initialModes, initialModesCount,
kVesaSpaces, sizeof(kVesaSpaces) / sizeof(kVesaSpaces[0]),
is_mode_supported, &gInfo->mode_list, &gInfo->shared_info->mode_count);
free(initialModes);
@@ -197,10 +163,6 @@ vesa_set_display_mode(display_mode* _mode)
return B_BAD_VALUE;
vesa_mode* modes = gInfo->vesa_modes;
if (modes == NULL)
return B_UNSUPPORTED;
// UEFI has no VESA modes
for (uint32 i = gInfo->shared_info->vesa_mode_count; i-- > 0;) {
// search mode in VESA mode list
// TODO: list is ordered, we could use binary search
@@ -166,7 +166,7 @@ framebuffer_init(framebuffer_info& info)
info.shared_area = create_area("framebuffer shared info",
(void**)&info.shared_info, B_ANY_KERNEL_ADDRESS,
ROUND_TO_PAGE_SIZE(sharedSize), B_FULL_LOCK,
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_USER_CLONEABLE_AREA);
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_CLONEABLE_AREA);
if (info.shared_area < 0)
return info.shared_area;
@@ -53,7 +53,12 @@ init_hardware(void)
{
TRACE((DEVICE_NAME ": init_hardware()\n"));
return get_boot_item(FRAME_BUFFER_BOOT_INFO, NULL) != NULL ? B_OK : B_ERROR;
// If we don't have the VESA mode info, then we have a
// dumb framebuffer, in which case we bail, and leave it
// up to the framebuffer driver to handle.
return (get_boot_item(VESA_MODES_BOOT_INFO, NULL) != NULL
&& get_boot_item(FRAME_BUFFER_BOOT_INFO, NULL) != NULL)
? B_OK : B_ERROR;
}
@@ -289,13 +289,7 @@ remap_frame_buffer(vesa_info& info, addr_t physicalBase, uint32 width,
if (!info.complete_frame_buffer_mapped) {
addr_t base = physicalBase;
size_t size = bytesPerRow * height;
#ifdef __riscv
// HACK: Prevent NULL framebuffer pointers from getting to userland
bool remap = true;
#else
bool remap = !initializing;
#endif
if (info.physical_frame_buffer_size != 0) {
// we can map the complete frame buffer
@@ -408,12 +402,10 @@ vesa_init(vesa_info& info)
memcpy(&sharedInfo.edid_info, edidInfo, sizeof(edid1_info));
}
if (modes != NULL) {
vbe_get_dpms_capabilities(info.vbe_dpms_capabilities,
sharedInfo.dpms_capabilities);
if (bufferInfo->depth <= 8)
vbe_set_bits_per_gun(info, 8);
}
dprintf(DEVICE_NAME ": vesa_init() completed successfully!\n");
return B_OK;
@@ -465,7 +457,6 @@ vesa_set_display_mode(vesa_info& info, uint32 mode)
status = remap_frame_buffer(info, modeInfo.physical_base, modeInfo.width,
modeInfo.height, modeInfo.bits_per_pixel, modeInfo.bytes_per_row,
false);
if (status == B_OK) {
// Update shared frame buffer information
info.shared_info->current_mode.virtual_width = modeInfo.width;
@@ -486,9 +477,6 @@ vesa_get_dpms_mode(vesa_info& info, uint32& mode)
mode = B_DPMS_ON;
// we always return a valid mode
if (info.modes == NULL)
return B_ERROR;
// Prepare BIOS environment
bios_state* state;
status_t status = vbe_call_prepare(&state);
@@ -526,9 +514,6 @@ out:
status_t
vesa_set_dpms_mode(vesa_info& info, uint32 mode)
{
if (info.modes == NULL)
return B_ERROR;
// Only let supported modes through
mode &= info.shared_info->dpms_capabilities;