summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2023-01-28 15:25:13 +0200
committerAndrew Kaster <andrewdkaster@gmail.com>2023-02-02 02:10:33 -0700
commitddc5c41253d9a38986c3e2969b30c9f60e06af9f (patch)
treec2bb6770caf457361e1c741af979debcc18eea84
parent5220afcf738a4299b1a2e753ec25060c9766caa6 (diff)
downloadserenity-ddc5c41253d9a38986c3e2969b30c9f60e06af9f.zip
Kernel: Fix a long-standing problem with GMBus in Intel Grahpics code
Thanks to Andrew Kaster, which gave a review back in October, about a big PR I opened (#15502), I managed to figure out why we always had a problem with the first byte being read into the EDID buffer with the GMBus code. It turns out that this simple invalid cast was making the entire problem and using the correct AK::Array::data() method fixed this notorious long standing problem for good.
-rw-r--r--Kernel/Graphics/Intel/NativeDisplayConnector.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/Kernel/Graphics/Intel/NativeDisplayConnector.cpp b/Kernel/Graphics/Intel/NativeDisplayConnector.cpp
index 260839d436..2268fa8d67 100644
--- a/Kernel/Graphics/Intel/NativeDisplayConnector.cpp
+++ b/Kernel/Graphics/Intel/NativeDisplayConnector.cpp
@@ -418,11 +418,7 @@ void IntelNativeDisplayConnector::gmbus_read_edid()
{
SpinlockLocker control_lock(m_control_lock);
gmbus_write(DDC2_I2C_ADDRESS, 0);
- gmbus_read(DDC2_I2C_ADDRESS, (u8*)&crt_edid_bytes, sizeof(crt_edid_bytes));
- // FIXME: It seems like the returned EDID is almost correct,
- // but the first byte is set to 0xD0 instead of 0x00.
- // For now, this "hack" works well enough.
- crt_edid_bytes[0] = 0x0;
+ gmbus_read(DDC2_I2C_ADDRESS, crt_edid_bytes.data(), crt_edid_bytes.size());
}
set_edid_bytes(crt_edid_bytes);
}