From 0ec55fb069b1764358bb8a9b185d62c14047cca1 Mon Sep 17 00:00:00 2001 From: X512 Date: Fri, 9 Dec 2022 06:36:13 +0900 Subject: [PATCH] framebuffer: fix NULL framebuffer address for non-x86 Change-Id: Ib24d4c04da102f40907002f59550635616b9a290 Reviewed-on: https://review.haiku-os.org/c/haiku/+/6313 Reviewed-by: waddlesplash Tested-by: Commit checker robot --- .../kernel/drivers/graphics/framebuffer/framebuffer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/add-ons/kernel/drivers/graphics/framebuffer/framebuffer.cpp b/src/add-ons/kernel/drivers/graphics/framebuffer/framebuffer.cpp index 43e736e452..50d75af59d 100644 --- a/src/add-ons/kernel/drivers/graphics/framebuffer/framebuffer.cpp +++ b/src/add-ons/kernel/drivers/graphics/framebuffer/framebuffer.cpp @@ -103,7 +103,8 @@ remap_frame_buffer(framebuffer_info& info, addr_t physicalBase, uint32 width, if (!info.complete_frame_buffer_mapped) { addr_t base = physicalBase; size_t size = bytesPerRow * height; - bool remap = !initializing; + // TODO: this logic looks suspicious and may need refactoring + bool remap = !initializing || frameBuffer == 0; if (info.physical_frame_buffer_size != 0) { // we can map the complete frame buffer