mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
Kernel/PCI: Propagate usage of DeviceIdentifier everywhere
This allows us to remove a bunch of PCI API functions, and instead to leverage the cached data from DeviceIdentifier object in many places.
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 05:37:06 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/057f5a12c2c Pull-request: https://github.com/SerenityOS/serenity/pull/10187 Reviewed-by: https://github.com/awesomekling
@@ -41,13 +41,12 @@ static bool is_supported_model(u16 device_id)
|
||||
|
||||
#define DDC2_I2C_ADDRESS 0x50
|
||||
|
||||
RefPtr<IntelNativeGraphicsAdapter> IntelNativeGraphicsAdapter::initialize(PCI::Address address)
|
||||
RefPtr<IntelNativeGraphicsAdapter> IntelNativeGraphicsAdapter::initialize(PCI::DeviceIdentifier const& pci_device_identifier)
|
||||
{
|
||||
auto id = PCI::get_hardware_id(address);
|
||||
VERIFY(id.vendor_id == 0x8086);
|
||||
if (!is_supported_model(id.device_id))
|
||||
VERIFY(pci_device_identifier.hardware_id().vendor_id == 0x8086);
|
||||
if (!is_supported_model(pci_device_identifier.hardware_id().device_id))
|
||||
return {};
|
||||
return adopt_ref(*new IntelNativeGraphicsAdapter(address));
|
||||
return adopt_ref(*new IntelNativeGraphicsAdapter(pci_device_identifier.address()));
|
||||
}
|
||||
|
||||
static size_t compute_dac_multiplier(size_t pixel_clock_in_khz)
|
||||
|
||||
Reference in New Issue
Block a user