mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Kernel/Graphics: Ensure generic EDID always has correct checksum
This commit is contained in:
parent
938d579d16
commit
3d36b194d1
Notes:
sideshowbarker
2024-07-17 10:19:51 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/3d36b194d1 Pull-request: https://github.com/SerenityOS/serenity/pull/14249 Issue: https://github.com/SerenityOS/serenity/issues/14139 Reviewed-by: https://github.com/linusg ✅
1 changed files with 8 additions and 0 deletions
|
@ -155,6 +155,14 @@ ErrorOr<void> DisplayConnector::initialize_edid_for_generic_monitor()
|
|||
0x00, /* number of extensions */
|
||||
0x00 /* checksum goes here */
|
||||
};
|
||||
// Note: Fix checksum to avoid warnings about checksum mismatch.
|
||||
size_t checksum = 0;
|
||||
// Note: Read all 127 bytes to add them to the checksum. Byte 128 is zeroed so
|
||||
// we could technically add it to the sum result, but it could lead to an error if it contained
|
||||
// a non-zero value, so we are not using it.
|
||||
for (size_t index = 0; index < sizeof(virtual_monitor_edid) - 1; index++)
|
||||
checksum += virtual_monitor_edid[index];
|
||||
virtual_monitor_edid[127] = 0x100 - checksum;
|
||||
set_edid_bytes(virtual_monitor_edid);
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue