From cd3c51f29b0d331fc8d0b963d23ad8b7fbfe3de7 Mon Sep 17 00:00:00 2001 From: Liav A Date: Thu, 31 Mar 2022 09:57:25 +0300 Subject: [PATCH] Kernel/Graphics: Export DDC I2C address definition to global header file --- Kernel/Graphics/Definitions.h | 4 +++- Kernel/Graphics/Intel/NativeDisplayConnector.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Kernel/Graphics/Definitions.h b/Kernel/Graphics/Definitions.h index f31e9cbf23c..b9d33c67eb5 100644 --- a/Kernel/Graphics/Definitions.h +++ b/Kernel/Graphics/Definitions.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Liav A. + * Copyright (c) 2021-2022, Liav A. * * SPDX-License-Identifier: BSD-2-Clause */ @@ -31,5 +31,7 @@ struct Modesetting { Timings horizontal; Timings vertical; }; +// Note: Address 0x50 is expected to be the DDC2 (EDID) i2c address. +static constexpr u8 ddc2_i2c_address = 0x50; } diff --git a/Kernel/Graphics/Intel/NativeDisplayConnector.cpp b/Kernel/Graphics/Intel/NativeDisplayConnector.cpp index fec200c85bc..3bfd099e076 100644 --- a/Kernel/Graphics/Intel/NativeDisplayConnector.cpp +++ b/Kernel/Graphics/Intel/NativeDisplayConnector.cpp @@ -351,8 +351,8 @@ void IntelNativeDisplayConnector::gmbus_read_edid() Array crt_edid_bytes {}; { SpinlockLocker control_lock(m_control_lock); - MUST(m_gmbus_connector->write(DDC2_I2C_ADDRESS, 0)); - MUST(m_gmbus_connector->read(DDC2_I2C_ADDRESS, crt_edid_bytes.data(), crt_edid_bytes.size())); + MUST(m_gmbus_connector->write(Graphics::ddc2_i2c_address, 0)); + MUST(m_gmbus_connector->read(Graphics::ddc2_i2c_address, crt_edid_bytes.data(), crt_edid_bytes.size())); } set_edid_bytes(crt_edid_bytes); }