MythTV  master
mythdrmdevice.h
Go to the documentation of this file.
1 #ifndef MYTHDRMDEVICE_H
2 #define MYTHDRMDEVICE_H
3 
4 // Qt
5 #include <QString>
6 
7 // MythTV
8 #include "mythlogging.h"
9 #include "referencecounter.h"
10 #include "mythdisplay.h"
11 
12 // libdrm
13 extern "C" {
14 #include <xf86drm.h>
15 #include <xf86drmMode.h>
16 }
17 
19 {
20  public:
21  explicit MythDRMDevice(QScreen *qScreen, const QString& Device = QString());
22  ~MythDRMDevice() override;
23 
24  bool IsValid (void) const;
25  QString GetSerialNumber(void) const;
26  QScreen* GetScreen (void) const;
27  QSize GetResolution (void) const;
28  QSize GetPhysicalSize(void) const;
29  double GetRefreshRate (void) const;
30  bool Authenticated (void) const;
31  MythEDID GetEDID (void);
32 
33  private:
34  Q_DISABLE_COPY(MythDRMDevice)
35  bool Open (void);
36  void Close (void);
37  void Authenticate (void);
38  bool Initialise (void);
39 
40  QString FindBestDevice (void);
41  static bool ConfirmDevice(const QString& Device);
42 
43  drmModePropertyBlobPtr GetBlobProperty(drmModeConnectorPtr Connector, const QString& Property);
44 
45  private:
46  bool m_valid { false };
47  QScreen* m_screen { nullptr };
48  QString m_deviceName { };
49  int m_fd { -1 };
50  bool m_authenticated { false };
51  drmModeRes* m_resources { nullptr };
52  drmModeConnector* m_connector { nullptr };
53  QSize m_resolution { };
54  QSize m_physicalSize { };
55  double m_refreshRate { 0.0 };
56  QString m_serialNumber { };
57  drmModeCrtc* m_crtc { nullptr };
58  int m_crtcIdx { -1 };
59  LogLevel_t m_verbose { LOG_INFO };
61 };
62 
63 #endif // MYTHDRMDEVICE_H
MythEDID GetEDID(void)
bool Open(void)
bool IsValid(void) const
General purpose reference counter.
drmModeRes * m_resources
Definition: mythdrmdevice.h:51
QSize m_physicalSize
Definition: mythdrmdevice.h:54
void Authenticate(void)
QSize GetPhysicalSize(void) const
LogLevel_t m_verbose
Definition: mythdrmdevice.h:59
QString m_serialNumber
Definition: mythdrmdevice.h:56
QScreen * GetScreen(void) const
A device containing images (ie. USB stick, CD, storage group etc)
MythDRMDevice(QScreen *qScreen, const QString &Device=QString())
drmModeConnector * m_connector
Definition: mythdrmdevice.h:52
MythEDID m_edid
Definition: mythdrmdevice.h:60
drmModeCrtc * m_crtc
Definition: mythdrmdevice.h:57
QString GetSerialNumber(void) const
QString m_deviceName
Definition: mythdrmdevice.h:48
bool Authenticated(void) const
QString FindBestDevice(void)
static bool ConfirmDevice(const QString &Device)
double m_refreshRate
Definition: mythdrmdevice.h:55
double GetRefreshRate(void) const
QSize m_resolution
Definition: mythdrmdevice.h:53
~MythDRMDevice() override
bool m_authenticated
Definition: mythdrmdevice.h:50
void Close(void)
QSize GetResolution(void) const
QScreen * m_screen
Definition: mythdrmdevice.h:47
bool Initialise(void)
drmModePropertyBlobPtr GetBlobProperty(drmModeConnectorPtr Connector, const QString &Property)