2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2019-07-02 10:01:37 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2019 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
2019-07-02 10:01:37 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2019-07-02 10:01:37 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QSize>
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper class that can be used for parsing EDID blobs.
|
|
|
|
*
|
|
|
|
* http://read.pudn.com/downloads110/ebook/456020/E-EDID%20Standard.pdf
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2019-07-02 10:01:37 +00:00
|
|
|
class Edid
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Edid();
|
|
|
|
Edid(const void *data, uint32_t size);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether this instance of EDID is valid.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2019-07-02 10:01:37 +00:00
|
|
|
bool isValid() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns physical dimensions of the monitor, in millimeters.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2019-07-02 10:01:37 +00:00
|
|
|
QSize physicalSize() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns EISA ID of the manufacturer of the monitor.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2019-07-02 10:01:37 +00:00
|
|
|
QByteArray eisaId() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the product name of the monitor.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2019-07-02 10:01:37 +00:00
|
|
|
QByteArray monitorName() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the serial number of the monitor.
|
2019-07-29 18:58:33 +00:00
|
|
|
*/
|
2019-07-02 10:01:37 +00:00
|
|
|
QByteArray serialNumber() const;
|
|
|
|
|
Decode full monitor vendor name from EDID using hwdata
Test Plan:
KScreen now shows "Dell Inc." instead of DEL and
"Eizo Nano Corporation" instead of ENC in output names, which
matches closer to what's written on my monitors.
Reviewers: graesslin, davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: apol, feverfew, ngraham, davidedmundson, mart, kwin, sebas
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D10041
2020-02-26 11:37:01 +00:00
|
|
|
/**
|
|
|
|
* Returns the name of the vendor.
|
|
|
|
*/
|
|
|
|
QByteArray vendor() const;
|
|
|
|
|
2020-10-26 17:29:33 +00:00
|
|
|
/**
|
|
|
|
* Returns the raw edid
|
|
|
|
*/
|
|
|
|
QByteArray raw() const;
|
|
|
|
|
2019-07-02 10:01:37 +00:00
|
|
|
private:
|
|
|
|
QSize m_physicalSize;
|
Decode full monitor vendor name from EDID using hwdata
Test Plan:
KScreen now shows "Dell Inc." instead of DEL and
"Eizo Nano Corporation" instead of ENC in output names, which
matches closer to what's written on my monitors.
Reviewers: graesslin, davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: apol, feverfew, ngraham, davidedmundson, mart, kwin, sebas
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D10041
2020-02-26 11:37:01 +00:00
|
|
|
QByteArray m_vendor;
|
2019-07-02 10:01:37 +00:00
|
|
|
QByteArray m_eisaId;
|
|
|
|
QByteArray m_monitorName;
|
|
|
|
QByteArray m_serialNumber;
|
2020-10-26 17:29:33 +00:00
|
|
|
|
|
|
|
QByteArray m_raw;
|
2019-07-02 10:01:37 +00:00
|
|
|
bool m_isValid = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace KWin
|