MCPcopy Create free account
hub / github.com/actuallyaridan/linux-devmgmt / parseEdid

Function parseEdid

src/scanner/SysfsScanner.cpp:941–962  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

939}
940
941QString parseEdid(const QByteArray &edid, QString *vendorOut) {
942 if (edid.size() < 128)
943 return {};
944 QString pnp = decodePnpId(quint8(edid[8]), quint8(edid[9]));
945 if (vendorOut)
946 *vendorOut = pnpVendorName(pnp);
947 for (int i = 0; i < 4; ++i) {
948 int off = 54 + i * 18;
949 if (off + 18 > edid.size())
950 break;
951 if (edid[off] == 0 && edid[off + 1] == 0
952 && edid[off + 2] == 0 && edid[off + 3] == char(0xFC)) {
953 QString name = QString::fromLatin1(
954 edid.mid(off + 5, 13)).trimmed();
955 while (name.endsWith(QChar(0x0a)))
956 name.chop(1);
957 if (!name.isEmpty())
958 return name;
959 }
960 }
961 return {};
962}
963
964QVector<Device> scanMonitors() {
965 QVector<Device> out;

Callers 1

scanMonitorsFunction · 0.85

Calls 2

decodePnpIdFunction · 0.85
pnpVendorNameFunction · 0.85

Tested by

no test coverage detected