8#define LOC QString("DispDRM: ")
12#if CONFIG_QTPRIVATEHEADERS
20#if CONFIG_QTPRIVATEHEADERS
26 if (
auto *drmdisplay =
dynamic_cast<MythDisplayDRM*
>(mainwindow->GetDisplay()); drmdisplay)
28 if (
auto drm = drmdisplay->GetDevice(); drm && drm->Atomic() && drm->Authenticated())
30 if (
auto plane = drm->GetVideoPlane(); plane && plane->m_id)
43#if CONFIG_QTPRIVATEHEADERS
81#if CONFIG_QTPRIVATEHEADERS
122 auto mainresolution =
m_device->GetResolution();
123 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Filtering out modes that aren't %1x%2")
124 .arg(mainresolution.width()).arg(mainresolution.height()));
128 auto physicalsize =
m_device->GetPhysicalSize();
129 for (
const auto & mode : modes)
131 auto width = mode->m_width;
132 auto height = mode->m_height;
133 auto rate = mode->m_rate;
138 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Ignoring interlaced mode %1x%2 %3i")
139 .arg(width).arg(height).arg(rate, 2,
'f', 2,
'0'));
145 if (
auto size = QSize(width, height); size != mainresolution)
147 LOG(VB_PLAYBACK, LOG_INFO,
LOC + QString(
"Ignoring mode %1x%2 %3")
148 .arg(width).arg(height).arg(rate, 2,
'f', 2,
'0'));
152 QSize resolution(width, height);
154 if (screenmap.find(key) == screenmap.end())
155 screenmap[key] =
MythDisplayMode(resolution, physicalsize, -1.0, rate);
157 screenmap[key].AddRefreshRate(rate);
161 for (
auto & it : screenmap)
173 auto rate =
static_cast<double>(NAN);
180 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Desired resolution and frame rate not found.");
187 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed to find mode");
bool GetBoolSetting(const QString &key, bool defaultval=false)
static MythDRMPtr Create(QScreen *qScreen, const QString &Device=QString(), bool NeedPlanes=true)
Create a MythDRMDevice instance.
void UpdateCurrentMode() override
Retrieve screen details.
MythDisplayDRM(MythMainWindow *MainWindow)
~MythDisplayDRM() override
bool VideoModesAvailable() override
const MythDisplayModes & GetVideoModes() override
bool SwitchToVideoMode(QSize Size, double DesiredRate) override
static bool DirectRenderingAvailable()
bool UsingVideoModes() override
QMap< uint64_t, int > m_modeMap
void ScreenChanged(QScreen *qScreen) override
static int FindBestMatch(const MythDisplayModes &Modes, const MythDisplayMode &Mode, double &TargetRate)
static uint64_t CalcKey(QSize Size, double Rate)
virtual void UpdateCurrentMode()
Retrieve screen details.
virtual void ScreenChanged(QScreen *qScreen)
The actual screen in use has changed. We must use it.
MythDisplayModes m_videoModes
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
std::map< uint64_t, MythDisplayMode > DisplayModeMap
std::vector< MythDisplayMode > MythDisplayModes
#define DRM_MODE_FLAG_INTERLACE
std::shared_ptr< class MythDRMDevice > MythDRMPtr
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
bool HasMythMainWindow(void)
MythMainWindow * GetMythMainWindow(void)