mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-30 08:18:49 +00:00
Kernel/Graphics: Introduce the IntelDisplayConnectorGroup class
In the real world, graphics hardware tend to have multiple display connectors. However, usually the connectors share one register space but still keeping different PLL timings and display lanes. This new class should represent a group of multiple display connectors working together in the same Intel graphics adapter. This opens an opportunity to abstract the interface so we could support future Intel iGPU generations. This is also a preparation before the driver can support newer devices and utilize their capabilities. The mentioned preparation is applied in a these aspects: 1. The code is splitted into more classes to adjust to future expansion. 2 classes are introduced: IntelDisplayPlane and IntelDisplayTranscoder, so the IntelDisplayPlane controls the plane registers and second class controls the pipeline (transcoder, encoder) registers. On gen4 it's not really useful because there are probably one plane and one encoder to care about, but in future generations, there are likely to be multiple transcoders and planes to accommodate multi head support. 2. The set_edid_bytes method in the DisplayConnector class can now be told to not assume the provided EDID bytes are always invalid. Therefore it can refrain from printing error messages if this flag parameter is true. This is useful for supporting real hardware situation when on boot not all ports are connected to a monitor, which can result in floating bus condition (essentially all the bytes we read are 0xFF). 3. An IntelNativeDisplayConnector could now be set to flag other types of connections such as eDP (embedded DisplayPort), Analog output, etc. This is important because on the Intel gen4 graphics we could assume to have one analog output connector, but on future generations this is very likely to not be the case, as there might be no VGA outputs, but rather only an eDP connector which is converted to VGA by a design choice of the motherboard manufacturer. 4. Add ConnectorIndex to IntelNativeDisplayConnector class - Currently this is used to verify we always handle the correct connector when doing modesetting. Later, it will be used to locate special settings needed when handling connector requests. 5. Prepare to support more types of display planes. For example, the Intel Skylake register set for display planes is a bit different, so let's ensure we can properly support it in the near future.
This commit is contained in:
parent
e2dde64628
commit
2def16a3d2
Notes:
sideshowbarker
2024-07-17 00:00:11 +09:00
Author: https://github.com/supercomputer7
Commit: 2def16a3d2
Pull-request: https://github.com/SerenityOS/serenity/pull/17283
Reviewed-by: https://github.com/ADKaster ✅
19 changed files with 1211 additions and 689 deletions
42
Kernel/Graphics/Intel/Transcoder/AnalogDisplayTranscoder.h
Normal file
42
Kernel/Graphics/Intel/Transcoder/AnalogDisplayTranscoder.h
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/Try.h>
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/Graphics/Intel/Transcoder/DisplayTranscoder.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
class IntelDisplayConnectorGroup;
|
||||
class IntelAnalogDisplayTranscoder final : public IntelDisplayTranscoder {
|
||||
public:
|
||||
static ErrorOr<NonnullOwnPtr<IntelAnalogDisplayTranscoder>> create_with_physical_addresses(PhysicalAddress transcoder_registers_start_address,
|
||||
PhysicalAddress dpll_registers_start_address, PhysicalAddress dpll_control_registers_start_address);
|
||||
|
||||
virtual ErrorOr<void> set_dpll_settings(Badge<IntelDisplayConnectorGroup>, IntelGraphics::PLLSettings const& settings, size_t dac_multiplier) override;
|
||||
virtual ErrorOr<void> enable_dpll_without_vga(Badge<IntelDisplayConnectorGroup>) override;
|
||||
virtual ErrorOr<void> disable_dpll(Badge<IntelDisplayConnectorGroup>) override;
|
||||
|
||||
private:
|
||||
struct [[gnu::packed]] DPLLRegisters {
|
||||
u32 divisor_a0;
|
||||
u32 divisor_a1;
|
||||
};
|
||||
|
||||
struct [[gnu::packed]] DPLLControlRegisters {
|
||||
u32 control;
|
||||
u32 padding; // On Gen4, this is the control register of DPLL B, don't touch this
|
||||
u32 multiplier;
|
||||
};
|
||||
|
||||
IntelAnalogDisplayTranscoder(Memory::TypedMapping<TranscoderRegisters volatile>, Memory::TypedMapping<DPLLRegisters volatile>, Memory::TypedMapping<DPLLControlRegisters volatile>);
|
||||
Memory::TypedMapping<DPLLRegisters volatile> m_dpll_registers;
|
||||
Memory::TypedMapping<DPLLControlRegisters volatile> m_dpll_control_registers;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue