MythTV  master
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
MythDRMDevice Class Reference

#include <mythdrmdevice.h>

Collaboration diagram for MythDRMDevice:
Collaboration graph
[legend]

Public Member Functions

 ~MythDRMDevice ()
 
bool Authenticated () const
 
bool Atomic () const
 
int GetFD () const
 
QString GetSerialNumber () const
 
QScreen * GetScreen () const
 
QSize GetResolution () const
 
QSize GetPhysicalSize () const
 
double GetRefreshRate () const
 Return the refresh rate we think is in use. More...
 
MythEDID GetEDID () const
 
DRMCrtc GetCrtc () const
 
DRMConn GetConnector () const
 
const DRMModesGetModes () const
 
bool CanSwitchModes () const
 
bool SwitchMode (int ModeIndex)
 Set the required video mode. More...
 

Static Public Member Functions

static std::tuple< QString, QStringList > GetDeviceList ()
 
static MythDRMPtr Create (QScreen *qScreen, const QString &Device=QString(), bool NeedPlanes=true)
 Create a MythDRMDevice instance. More...
 

Protected Member Functions

 MythDRMDevice (QScreen *qScreen, const QString &Device=QString())
 Constructor used when we have no DRM handles from Qt. More...
 

Private Member Functions

bool Open ()
 
void Authenticate ()
 Attempt to acquire privileged DRM access. More...
 
void Load ()
 
bool Initialise ()
 
QString FindBestDevice ()
 

Static Private Member Functions

static bool ConfirmDevice (const QString &Device)
 

Private Attributes

bool m_valid { false }
 
QScreen * m_screen { nullptr }
 
QString m_deviceName { }
 
bool m_openedDevice { true }
 
int m_fd { -1 }
 
bool m_atomic { false }
 
bool m_authenticated { false }
 
DRMConns m_connectors
 
DRMEncs m_encoders
 
DRMCrtcs m_crtcs
 
DRMPlanes m_planes
 
DRMConn m_connector { nullptr }
 
DRMCrtc m_crtc { nullptr }
 
QSize m_resolution { }
 
QSize m_physicalSize { }
 
double m_refreshRate { 0.0 }
 
double m_adjustedRefreshRate { 0.0 }
 
QString m_serialNumber { }
 
LogLevel_t m_verbose { LOG_INFO }
 
MythEDID m_edid { }
 

Detailed Description

Definition at line 24 of file mythdrmdevice.h.

Constructor & Destructor Documentation

◆ ~MythDRMDevice()

MythDRMDevice::~MythDRMDevice ( )

Definition at line 563 of file mythdrmdevice.cpp.

◆ MythDRMDevice()

MythDRMDevice::MythDRMDevice ( QScreen *  qScreen,
const QString &  Device = QString() 
)
explicitprotected

Constructor used when we have no DRM handles from Qt.

This will construct an instance with little functionality as it will not be authenticated. Useful for confirming current display settings and little else.

Definition at line 400 of file mythdrmdevice.cpp.

Referenced by Create().

Member Function Documentation

◆ GetDeviceList()

std::tuple< QString, QStringList > MythDRMDevice::GetDeviceList ( )
static

Definition at line 380 of file mythdrmdevice.cpp.

Referenced by FindBestDevice().

◆ Create()

MythDRMPtr MythDRMDevice::Create ( QScreen *  qScreen,
const QString &  Device = QString(),
bool  NeedPlanes = true 
)
static

Create a MythDRMDevice instance.

Returns
A valid instance or nullptr on error.

Definition at line 326 of file mythdrmdevice.cpp.

Referenced by MythVRR::Create(), MythDisplayDRM::MythDisplayDRM(), and MythDisplayDRM::ScreenChanged().

◆ Authenticated()

bool MythDRMDevice::Authenticated ( ) const

Definition at line 582 of file mythdrmdevice.cpp.

◆ Atomic()

bool MythDRMDevice::Atomic ( ) const

Definition at line 587 of file mythdrmdevice.cpp.

◆ GetFD()

int MythDRMDevice::GetFD ( ) const

Definition at line 592 of file mythdrmdevice.cpp.

◆ GetSerialNumber()

QString MythDRMDevice::GetSerialNumber ( ) const

Definition at line 597 of file mythdrmdevice.cpp.

Referenced by FindBestDevice().

◆ GetScreen()

QScreen * MythDRMDevice::GetScreen ( ) const

Definition at line 602 of file mythdrmdevice.cpp.

◆ GetResolution()

QSize MythDRMDevice::GetResolution ( ) const

Definition at line 607 of file mythdrmdevice.cpp.

◆ GetPhysicalSize()

QSize MythDRMDevice::GetPhysicalSize ( ) const

Definition at line 612 of file mythdrmdevice.cpp.

◆ GetRefreshRate()

double MythDRMDevice::GetRefreshRate ( ) const

Return the refresh rate we think is in use.

Note
There is currently no mechanism for ensuring that a change in video mode has been accepted and due to the Atomic API, we cannot confirm a change immediately after requesting a change. Furthermore, Qt has no expectation that any other process will change the current video mode when it is using eglfs_kms - and hence has no mechanism to detect such changes (to either refresh rate or resolution). Hence we assume that the new video mode has been accepted and pass back what we believe to be the new value here.

Definition at line 632 of file mythdrmdevice.cpp.

◆ GetEDID()

MythEDID MythDRMDevice::GetEDID ( ) const

Definition at line 617 of file mythdrmdevice.cpp.

◆ GetCrtc()

DRMCrtc MythDRMDevice::GetCrtc ( ) const

Definition at line 879 of file mythdrmdevice.cpp.

◆ GetConnector()

DRMConn MythDRMDevice::GetConnector ( ) const

Definition at line 884 of file mythdrmdevice.cpp.

◆ GetModes()

const DRMModes & MythDRMDevice::GetModes ( ) const

Definition at line 644 of file mythdrmdevice.cpp.

◆ CanSwitchModes()

bool MythDRMDevice::CanSwitchModes ( ) const

Definition at line 639 of file mythdrmdevice.cpp.

◆ SwitchMode()

bool MythDRMDevice::SwitchMode ( int  ModeIndex)

Set the required video mode.

Note
This is currently only supported when we are authenticated and when using the atomic API. The old/non-atomic API may work but is untested and realistically not much else is going to work without atomic.

Definition at line 658 of file mythdrmdevice.cpp.

◆ Open()

bool MythDRMDevice::Open ( )
private

Definition at line 572 of file mythdrmdevice.cpp.

Referenced by MythDRMDevice().

◆ Authenticate()

void MythDRMDevice::Authenticate ( )
private

Attempt to acquire privileged DRM access.

This function is probably pointless. If we have retrieved a file descriptor from the Qt platform plugin then we are authenticated and if we have not, authentication will always fail (as either X, Wayland or Qt have master privileges)

Definition at line 699 of file mythdrmdevice.cpp.

Referenced by MythDRMDevice().

◆ Load()

void MythDRMDevice::Load ( )
private

Definition at line 724 of file mythdrmdevice.cpp.

Referenced by Initialise().

◆ Initialise()

bool MythDRMDevice::Initialise ( )
private

Definition at line 731 of file mythdrmdevice.cpp.

Referenced by MythDRMDevice().

◆ FindBestDevice()

QString MythDRMDevice::FindBestDevice ( )
private

Definition at line 827 of file mythdrmdevice.cpp.

Referenced by Open().

◆ ConfirmDevice()

bool MythDRMDevice::ConfirmDevice ( const QString &  Device)
staticprivate

Definition at line 863 of file mythdrmdevice.cpp.

Referenced by FindBestDevice().

Member Data Documentation

◆ m_valid

bool MythDRMDevice::m_valid { false }
private

Definition at line 89 of file mythdrmdevice.h.

Referenced by Authenticated(), CanSwitchModes(), and MythDRMDevice().

◆ m_screen

QScreen* MythDRMDevice::m_screen { nullptr }
private

Definition at line 90 of file mythdrmdevice.h.

Referenced by FindBestDevice(), GetScreen(), and Initialise().

◆ m_deviceName

QString MythDRMDevice::m_deviceName { }
private

Definition at line 91 of file mythdrmdevice.h.

Referenced by MythDRMDevice(), and Open().

◆ m_openedDevice

bool MythDRMDevice::m_openedDevice { true }
private

Definition at line 92 of file mythdrmdevice.h.

Referenced by ~MythDRMDevice().

◆ m_fd

int MythDRMDevice::m_fd { -1 }
private

Definition at line 93 of file mythdrmdevice.h.

Referenced by Authenticate(), GetFD(), Initialise(), Load(), Open(), SwitchMode(), and ~MythDRMDevice().

◆ m_atomic

bool MythDRMDevice::m_atomic { false }
private

Definition at line 94 of file mythdrmdevice.h.

Referenced by Atomic(), Authenticate(), CanSwitchModes(), and SwitchMode().

◆ m_authenticated

bool MythDRMDevice::m_authenticated { false }
private

Definition at line 95 of file mythdrmdevice.h.

Referenced by Authenticate(), Authenticated(), CanSwitchModes(), GetModes(), and SwitchMode().

◆ m_connectors

DRMConns MythDRMDevice::m_connectors
private

Definition at line 96 of file mythdrmdevice.h.

Referenced by Initialise(), and Load().

◆ m_encoders

DRMEncs MythDRMDevice::m_encoders
private

Definition at line 97 of file mythdrmdevice.h.

Referenced by Initialise(), and Load().

◆ m_crtcs

DRMCrtcs MythDRMDevice::m_crtcs
private

Definition at line 98 of file mythdrmdevice.h.

Referenced by Initialise(), and Load().

◆ m_planes

DRMPlanes MythDRMDevice::m_planes
private

Definition at line 99 of file mythdrmdevice.h.

◆ m_connector

DRMConn MythDRMDevice::m_connector { nullptr }
private

Definition at line 100 of file mythdrmdevice.h.

Referenced by GetConnector(), GetModes(), Initialise(), and SwitchMode().

◆ m_crtc

DRMCrtc MythDRMDevice::m_crtc { nullptr }
private

Definition at line 101 of file mythdrmdevice.h.

Referenced by GetCrtc(), Initialise(), and SwitchMode().

◆ m_resolution

QSize MythDRMDevice::m_resolution { }
private

Definition at line 102 of file mythdrmdevice.h.

Referenced by GetResolution(), and Initialise().

◆ m_physicalSize

QSize MythDRMDevice::m_physicalSize { }
private

Definition at line 103 of file mythdrmdevice.h.

Referenced by GetPhysicalSize(), and Initialise().

◆ m_refreshRate

double MythDRMDevice::m_refreshRate { 0.0 }
private

Definition at line 104 of file mythdrmdevice.h.

Referenced by GetRefreshRate(), and Initialise().

◆ m_adjustedRefreshRate

double MythDRMDevice::m_adjustedRefreshRate { 0.0 }
private

Definition at line 105 of file mythdrmdevice.h.

Referenced by GetRefreshRate(), and SwitchMode().

◆ m_serialNumber

QString MythDRMDevice::m_serialNumber { }
private

Definition at line 106 of file mythdrmdevice.h.

Referenced by GetSerialNumber(), and Initialise().

◆ m_verbose

LogLevel_t MythDRMDevice::m_verbose { LOG_INFO }
private

◆ m_edid

MythEDID MythDRMDevice::m_edid { }
private

Definition at line 108 of file mythdrmdevice.h.

Referenced by GetEDID(), and Initialise().


The documentation for this class was generated from the following files: