Don't clear video mem on UEFI, efi video mode refactor
Writes to videomem is slow without memory remapping Can't do the mapping without leaving UEFI, so skipping the clear. Afaict it should always be cleared by UEFI This saves ~10 seconds of booting on my machine (1920*1080*4 bytes) EFI video mode (should have been it's own commit) * Only do strcmp if there are enough params * break when found
This commit is contained in:
@@ -32,7 +32,7 @@ void uncompress_24bit_RLE(const uint8 compressed[], uint8 *uncompressed);
|
||||
void uncompress_8bit_RLE(const uint8 compressed[], uint8 *uncompressed);
|
||||
|
||||
/* default splash display */
|
||||
status_t video_display_splash(addr_t frameBuffer);
|
||||
status_t video_display_splash(addr_t frameBuffer, bool clear);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ platform_switch_to_logo(void)
|
||||
|
||||
sFrameBuffer = gKernelArgs.frame_buffer.physical_buffer.start;
|
||||
|
||||
//video_display_splash(sFrameBuffer);
|
||||
//video_display_splash(sFrameBuffer, true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1153,7 +1153,7 @@ platform_switch_to_logo(void)
|
||||
gKernelArgs.frame_buffer.physical_buffer.size, kDefaultPageFlags);
|
||||
}
|
||||
#endif
|
||||
video_display_splash(sFrameBuffer);
|
||||
video_display_splash(sFrameBuffer, true);
|
||||
dump_vars();
|
||||
spin(10000000);
|
||||
platform_switch_to_text_mode();
|
||||
|
||||
@@ -877,7 +877,7 @@ fallback:
|
||||
gKernelArgs.frame_buffer.physical_buffer.size, kDefaultPageFlags);
|
||||
}
|
||||
|
||||
video_display_splash(sFrameBuffer);
|
||||
video_display_splash(sFrameBuffer, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -118,8 +118,6 @@ get_mode_from_settings(void)
|
||||
if (handle == NULL)
|
||||
return;
|
||||
|
||||
bool found = false;
|
||||
|
||||
const driver_settings *settings = get_driver_settings(handle);
|
||||
if (settings == NULL)
|
||||
goto out;
|
||||
@@ -129,17 +127,16 @@ get_mode_from_settings(void)
|
||||
for (int32 i = 0; i < settings->parameter_count; i++) {
|
||||
driver_parameter ¶meter = settings->parameters[i];
|
||||
|
||||
if (strcmp(parameter.name, "mode") == 0 && parameter.value_count > 2) {
|
||||
uint32 width = strtoul(parameter.values[0], NULL, 0);
|
||||
uint32 height = strtoul(parameter.values[1], NULL, 0);
|
||||
uint32 depth = strtoul(parameter.values[2], NULL, 0);
|
||||
if (parameter.value_count < 3 || strcmp(parameter.name, "mode") != 0) continue;
|
||||
uint32 width = strtoul(parameter.values[0], NULL, 0);
|
||||
uint32 height = strtoul(parameter.values[1], NULL, 0);
|
||||
uint32 depth = strtoul(parameter.values[2], NULL, 0);
|
||||
|
||||
// search mode that fits
|
||||
video_mode *mode = closest_video_mode(width, height, depth);
|
||||
if (mode != NULL) {
|
||||
found = true;
|
||||
sGraphicsMode = mode->mode;
|
||||
}
|
||||
// search mode that fits
|
||||
video_mode *mode = closest_video_mode(width, height, depth);
|
||||
if (mode != NULL) {
|
||||
sGraphicsMode = mode->mode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,7 +254,7 @@ platform_switch_to_logo(void)
|
||||
sGraphicsOutput->Mode->Info->PixelsPerScanLine
|
||||
* gKernelArgs.frame_buffer.depth / 8;
|
||||
|
||||
video_display_splash(gKernelArgs.frame_buffer.physical_buffer.start);
|
||||
video_display_splash(gKernelArgs.frame_buffer.physical_buffer.start, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -81,14 +81,14 @@ uncompress(const uint8 compressed[], unsigned int compressedSize,
|
||||
|
||||
|
||||
extern "C" status_t
|
||||
video_display_splash(addr_t frameBuffer)
|
||||
video_display_splash(addr_t frameBuffer, bool clear)
|
||||
{
|
||||
if (!gKernelArgs.frame_buffer.enabled)
|
||||
return B_NO_INIT;
|
||||
|
||||
// clear the video memory
|
||||
memset((void*)frameBuffer, 0,
|
||||
gKernelArgs.frame_buffer.physical_buffer.size);
|
||||
if (clear)
|
||||
memset((void*)frameBuffer, 0,
|
||||
gKernelArgs.frame_buffer.physical_buffer.size);
|
||||
|
||||
uint8* uncompressedLogo = NULL;
|
||||
unsigned int uncompressedSize = kSplashLogoWidth * kSplashLogoHeight;
|
||||
|
||||
@@ -93,7 +93,8 @@ platform_switch_to_logo(void)
|
||||
gKernelArgs.frame_buffer.enabled = true;
|
||||
|
||||
// the memory will be identity-mapped already
|
||||
video_display_splash(gKernelArgs.frame_buffer.physical_buffer.start);
|
||||
video_display_splash(gKernelArgs.frame_buffer.physical_buffer.start,
|
||||
true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ platform_switch_to_logo(void)
|
||||
return;
|
||||
}
|
||||
|
||||
err = video_display_splash(gFramebuffer->Base());
|
||||
err = video_display_splash(gFramebuffer->Base(), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user