Skip to content

Commit

Permalink
Kernel/aarch64: Change RPi::Framebuffer::PixelOrder to BGR
Browse files Browse the repository at this point in the history
This is what the WindowServer expects. Confusingly the pixel format for
MULTIBOOT_FRAMEBUFFER_TYPE_RGB is actually BGRx8888.
  • Loading branch information
FireFox317 authored and linusg committed Apr 13, 2023
1 parent baa5cb9 commit 4927eb5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Kernel/Arch/aarch64/RPi/Framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Framebuffer::Framebuffer()
// message_queue.set_virtual_offset.y = 0;

message_queue.set_depth.depth_bits = 32;
message_queue.set_pixel_order.pixel_order = FramebufferSetPixelOrderMboxMessage::PixelOrder::RGB;
message_queue.set_pixel_order.pixel_order = FramebufferSetPixelOrderMboxMessage::PixelOrder::BGR;
message_queue.allocate_buffer.alignment = 4096;

if (!Mailbox::the().send_queue(&message_queue, sizeof(message_queue))) {
Expand Down Expand Up @@ -127,7 +127,8 @@ void Framebuffer::initialize()
multiboot_framebuffer_height = framebuffer.height();
multiboot_framebuffer_pitch = framebuffer.pitch();

VERIFY(framebuffer.pixel_order() == PixelOrder::RGB);
// NOTE: The required pixel format for MULTIBOOT_FRAMEBUFFER_TYPE_RGB is actually BGRx8888.
VERIFY(framebuffer.pixel_order() == PixelOrder::BGR);
multiboot_framebuffer_type = MULTIBOOT_FRAMEBUFFER_TYPE_RGB;
}
}
Expand Down

0 comments on commit 4927eb5

Please sign in to comment.