1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47:36 +00:00

Meta+LibEDID: Download and generate the PNP ID database

This downloads the UEFI's published PNP ID database and generates a
lookup table for use in LibEDID. The lookup table isn't optimized at
all, but this can be easily done at a later point if needed.
This commit is contained in:
Tom 2022-01-17 16:53:17 -07:00 committed by Linus Groh
parent ab1075e296
commit 869c20b05d
8 changed files with 359 additions and 0 deletions

View file

@ -13,6 +13,10 @@
# include <Kernel/API/FB.h>
# include <fcntl.h>
# include <unistd.h>
# ifdef ENABLE_PNP_IDS_DATA
# include <LibEDID/LibEDID/PnpIDs.h>
# endif
#endif
namespace EDID {
@ -552,6 +556,18 @@ String Parser::legacy_manufacturer_id() const
return id;
}
#ifndef KERNEL
String Parser::manufacturer_name() const
{
auto manufacturer_id = legacy_manufacturer_id();
# ifdef ENABLE_PNP_IDS_DATA
if (auto pnp_id_data = PnpIDs::find_by_manufacturer_id(manufacturer_id); pnp_id_data.has_value())
return pnp_id_data.value().manufacturer_name;
# endif
return manufacturer_id;
}
#endif
u16 Parser::product_code() const
{
return read_le(&raw_edid().vendor.product_code);