mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 18:15:07 +00:00
Kernel/Graphics: Add a proper method to check if Intel GPU is supported
This commit is contained in:
parent
824a40e95b
commit
d18d91dedc
1 changed files with 14 additions and 1 deletions
|
@ -25,13 +25,26 @@ static constexpr IntelNativeGraphicsAdapter::PLLMaxSettings G35Limits {
|
||||||
{ 5, 10 } // p2
|
{ 5, 10 } // p2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static constexpr u16 supported_models[] {
|
||||||
|
{ 0x29c2 }, // Intel G35 Adapter
|
||||||
|
};
|
||||||
|
|
||||||
|
static bool is_supported_model(u16 device_id)
|
||||||
|
{
|
||||||
|
for (auto& id : supported_models) {
|
||||||
|
if (id == device_id)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
#define DDC2_I2C_ADDRESS 0x50
|
#define DDC2_I2C_ADDRESS 0x50
|
||||||
|
|
||||||
RefPtr<IntelNativeGraphicsAdapter> IntelNativeGraphicsAdapter::initialize(PCI::Address address)
|
RefPtr<IntelNativeGraphicsAdapter> IntelNativeGraphicsAdapter::initialize(PCI::Address address)
|
||||||
{
|
{
|
||||||
auto id = PCI::get_id(address);
|
auto id = PCI::get_id(address);
|
||||||
VERIFY(id.vendor_id == 0x8086);
|
VERIFY(id.vendor_id == 0x8086);
|
||||||
if (id.device_id != 0x29c2)
|
if (!is_supported_model(id.device_id))
|
||||||
return {};
|
return {};
|
||||||
return adopt_ref(*new IntelNativeGraphicsAdapter(address));
|
return adopt_ref(*new IntelNativeGraphicsAdapter(address));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue