MythTV  master
mythdisplaymutter.cpp
Go to the documentation of this file.
1 // MythTV
5 
6 #ifdef USING_DRM
7 extern "C" {
8 #include <xf86drmMode.h>
9 }
10 #else
11 #ifndef DRM_MODE_FLAG_INTERLACE
12 #define DRM_MODE_FLAG_INTERLACE (1<<4)
13 #endif
14 #endif
15 
16 #define LOC QString("MutterDisp: ")
17 
18 // ApplyConfiguration CRTC output
20 {
21  uint32_t id {};
22  int32_t new_mode {};
23  int32_t x {};
24  int32_t y {};
25  uint32_t transform {};
26  QList<uint32_t> outputs;
28 };
29 
30 // ApplyConfiguration Outputs out
32 {
33  uint32_t id {};
35 };
36 
37 using MythMutterCRTCOutList = QList<MythMutterCRTCOut>;
40 using MythMutterOutputOutList = QList<MythMutterOutputOut>;
43 
44 static QDBusArgument &operator<<(QDBusArgument& Argument, const MythMutterOutputOut& Output)
45 {
46  Argument.beginStructure();
47  Argument << Output.id << Output.properties;
48  Argument.endStructure();
49  return Argument;
50 }
51 
52 static QDBusArgument &operator<<(QDBusArgument& Argument, const MythMutterOutputOutList& Outputs)
53 {
54  Argument.beginArray(qMetaTypeId<MythMutterOutputOut>());
55  for (const auto & output : Outputs)
56  Argument << output;
57  Argument.endArray();
58  return Argument;
59 }
60 
61 static const QDBusArgument &operator>>(const QDBusArgument& Argument, MythMutterOutputOut& Output)
62 {
63  Argument.beginStructure();
64  Argument >> Output.id >> Output.properties;
65  Argument.endStructure();
66  return Argument;
67 }
68 
69 static QDBusArgument &operator<<(QDBusArgument& Argument, const MythMutterCRTCOut& CRTC)
70 {
71  Argument.beginStructure();
72  Argument << CRTC.id << CRTC.new_mode << CRTC.x << CRTC.y << CRTC.transform << CRTC.outputs << CRTC.properties;
73  Argument.endStructure();
74  return Argument;
75 }
76 
77 static const QDBusArgument &operator>>(const QDBusArgument& Argument, MythMutterCRTCOut& CRTC)
78 {
79  Argument.beginStructure();
80  Argument >> CRTC.id >> CRTC.new_mode >> CRTC.x >> CRTC.y >> CRTC.transform >> CRTC.outputs >> CRTC.properties;
81  Argument.endStructure();
82  return Argument;
83 }
84 
85 static QDBusArgument &operator<<(QDBusArgument& Argument, const MythMutterCRTCOutList& CRTCS)
86 {
87  Argument.beginArray(qMetaTypeId<MythMutterCRTCOut>());
88  for (const auto & crtc : CRTCS)
89  Argument << crtc;
90  Argument.endArray();
91  return Argument;
92 }
93 
94 static const QDBusArgument &operator>>(const QDBusArgument& Argument, MythMutterCRTC& CRTC)
95 {
96  Argument.beginStructure();
97  Argument >> CRTC.id >> CRTC.sys_id >> CRTC.x >> CRTC.y;
98  Argument >> CRTC.width >> CRTC.height >> CRTC.currentmode;
99  Argument >> CRTC.currenttransform >> CRTC.transforms >> CRTC.properties;
100  Argument.endStructure();
101  return Argument;
102 }
103 
104 static const QDBusArgument &operator>>(const QDBusArgument& Argument, MythMutterCRTCList& CRTCS)
105 {
106  Argument.beginArray();
107  CRTCS.clear();
108 
109  while (!Argument.atEnd())
110  {
111  MythMutterCRTC crtc;
112  Argument >> crtc;
113  CRTCS.append(crtc);
114  }
115 
116  Argument.endArray();
117  return Argument;
118 }
119 
120 static const QDBusArgument &operator>>(const QDBusArgument& Argument, MythMutterOutput& Output)
121 {
122  Argument.beginStructure();
123  Argument >> Output.id >> Output.sys_id >> Output.current_crtc >> Output.possible_crtcs;
124  Argument >> Output.name >> Output.modes >> Output.clones;
125  Argument >> Output.properties;
126  Argument.endStructure();
127  Output.serialnumber = QString();
128  Output.edid = QByteArray();
129  Output.widthmm = 0;
130  Output.heightmm = 0;
131  for (auto & property : Output.properties)
132  {
133  if (property.first == "serial")
134  Output.serialnumber = property.second.variant().toString();
135  if (property.first == "edid")
136  Output.edid = property.second.variant().toByteArray();
137  if (property.first == "width-mm")
138  Output.widthmm = property.second.variant().toInt();
139  if (property.first == "height-mm")
140  Output.heightmm = property.second.variant().toInt();
141  }
142  return Argument;
143 }
144 
145 static const QDBusArgument &operator>>(const QDBusArgument& Argument, MythMutterOutputList& Outputs)
146 {
147  Argument.beginArray();
148  Outputs.clear();
149 
150  while (!Argument.atEnd())
151  {
153  Argument >> output;
154  Outputs.append(output);
155  }
156 
157  Argument.endArray();
158  return Argument;
159 }
160 
161 static const QDBusArgument &operator>>(const QDBusArgument& Argument, MythMutterMode& Mode)
162 {
163  Argument.beginStructure();
164  Argument >> Mode.id >> Mode.sys_id >> Mode.width >> Mode.height;
165  Argument >> Mode.frequency >> Mode.flags;
166  Argument.endStructure();
167  return Argument;
168 }
169 
170 static const QDBusArgument &operator>>(const QDBusArgument& Argument, MythMutterModeList& Modes)
171 {
172  Argument.beginArray();
173  Modes.clear();
174 
175  while (!Argument.atEnd())
176  {
177  MythMutterMode mode {};
178  Argument >> mode;
179  Modes.append(mode);
180  }
181 
182  Argument.endArray();
183  return Argument;
184 }
185 
192 {
193  static bool s_checked(false);
194  static bool s_available(false);
195 
196  if (!s_checked)
197  {
198  s_checked = true;
199  qDBusRegisterMetaType<MythMutterCRTCOut>();
200  qDBusRegisterMetaType<MythMutterOutputOut>();
201  auto mutter = QDBusInterface(DISP_CONFIG_SERVICE, DISP_CONFIG_PATH,
202  DISP_CONFIG_SERVICE, QDBusConnection::sessionBus());
203 
204  if (mutter.isValid())
205  {
206  // Some implementations do not implement ApplyConfiguration and there
207  // is no point in using this class without it
208  // N.B. Use a bogus serial here to ensure that if it is implemented,
209  // it will fail with org.freedesktop.DBus.AccessDenied
210  QDBusMessage res = mutter.call("GetResources");
211  QList<QVariant> args = res.arguments();
212  if ((res.signature() == DISP_CONFIG_SIG) || (args.size() == 6))
213  {
214  uint serial = args[0].toUInt() + 100;
215  MythMutterCRTCOutList crtcs;
216  MythMutterOutputOutList outputs;
217  QDBusArgument crtcsarg;
218  QDBusArgument outarg;
219  QDBusReply<void> reply = mutter.call(QLatin1String("ApplyConfiguration"),
220  serial, false,
221  QVariant::fromValue(crtcsarg << crtcs),
222  QVariant::fromValue(outarg << outputs));
223  if (reply.error().type() == QDBusError::UnknownMethod)
224  {
225  LOG(VB_GENERAL, LOG_WARNING, LOC +
226  "org.gnome.Mutter.DisplayConfig.ApplyConfiguration not implemented");
227  }
228  else if (reply.error().type() == QDBusError::AccessDenied)
229  {
230  s_available = true;
231  }
232 
233  }
234 
235  if (!s_available)
236  LOG(VB_GENERAL, LOG_INFO, LOC + DISP_CONFIG_SERVICE + " not useable");
237  }
238  else
239  {
240  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Failed to find '%1'").arg(DISP_CONFIG_SERVICE));
241  }
242  }
243 
244  if (s_available)
245  {
246  auto *result = new MythDisplayMutter();
247  if (result->IsValid())
248  return result;
249  delete result;
250  }
251 
252  return nullptr;
253 }
254 
271 {
273  Initialise();
274 }
275 
277 {
278  delete m_interface;
279 }
280 
282 {
283  return m_interface != nullptr;
284 }
285 
287 {
288  LOG(VB_GENERAL, LOG_INFO, LOC + "Monitors changed");
289  UpdateResources();
290 }
291 
293 {
294  if (gCoreContext)
295  return gCoreContext->GetBoolSetting("UseVideoModes", false);
296  return false;
297 }
298 
300 {
301  if (!m_interface || m_outputIdx < 0 || !m_videoModes.empty())
302  return m_videoModes;
303 
304  m_videoModes.clear();
305  m_modeMap.clear();
307  QSize physical(output.widthmm, output.heightmm);
308  DisplayModeMap screenmap;
309 
310  for (auto & mode : output.modes)
311  {
312  MythMutterMode& mmode = m_modes[static_cast<int32_t>(mode)];
313 
314  // the flags field will contain values dependant on enums for the
315  // underlying mechanism in use (i.e. XRandR or libdrm). We should not
316  // however be using this class if X11 is running and fortunately the
317  // values for the different enums match.
319  {
320  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Ignoring interlaced mode %1x%2 %3i")
321  .arg(mmode.width).arg(mmode.width).arg(mmode.frequency, 2, 'f', 2, '0'));
322  continue;
323  }
324 
325  double rate = mmode.frequency;
326  QSize resolution(static_cast<int32_t>(mmode.width),
327  static_cast<int32_t>(mmode.height));
328 
329  uint64_t key = MythDisplayMode::CalcKey(resolution, 0.0);
330  if (screenmap.find(key) == screenmap.end())
331  screenmap[key] = MythDisplayMode(resolution, physical, -1.0, rate);
332  else
333  screenmap[key].AddRefreshRate(rate);
334  m_modeMap.insert(MythDisplayMode::CalcKey(resolution, rate), mmode.id);
335  }
336 
337  for (auto & it : screenmap)
338  m_videoModes.push_back(it.second);
339 
340  DebugModes();
341  return m_videoModes;
342 }
343 
345 {
346  if (!m_interface)
347  {
349  return;
350  }
351 
352  UpdateResources();
353  m_modeComplete = true;
354 }
355 
357 {
358  delete m_interface;
359  m_interface = new QDBusInterface(DISP_CONFIG_SERVICE, DISP_CONFIG_PATH,
360  DISP_CONFIG_SERVICE, QDBusConnection::sessionBus());
361  if (m_interface->isValid())
362  {
363  QDBusMessage reply = m_interface->call("GetResources");
364 
365  if (reply.signature() == DISP_CONFIG_SIG)
366  {
367  QList<QVariant> args = reply.arguments();
368  if (args.size() == 6)
369  {
370  if (!QDBusConnection::sessionBus().connect(DISP_CONFIG_SERVICE, DISP_CONFIG_PATH,
371  DISP_CONFIG_SERVICE, "MonitorsChanged", this,
372  SLOT(MonitorsChanged())))
373  {
374  LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to register for MonitorsChanged");
375  }
376  return;
377  }
378  LOG(VB_GENERAL, LOG_ERR, LOC + "GetResources unexpected reply");
379  }
380  else
381  {
382  LOG(VB_GENERAL, LOG_ERR, LOC + "GetResources signature not recognised");
383  }
384  }
385 
386  delete m_interface;
387  m_interface = nullptr;
388 }
389 
391 bool MythDisplayMutter::SwitchToVideoMode(QSize Size, double DesiredRate)
392 {
393  if (!m_interface)
394  return false;
395 
396  auto rate = static_cast<double>(NAN);
397  QSize dummy(0, 0);
398  MythDisplayMode desired(Size, dummy, -1.0, DesiredRate);
399  int idx = MythDisplayMode::FindBestMatch(m_videoModes, desired, rate);
400 
401  if (idx < 0)
402  {
403  LOG(VB_GENERAL, LOG_ERR, LOC + "Desired resolution and frame rate not found.");
404  return false;
405  }
406 
407  auto mode = MythDisplayMode::CalcKey(Size, rate);
408  if (!m_modeMap.contains(mode))
409  {
410  LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to find mode");
411  return false;
412  }
413 
414  MythMutterCRTCOutList crtcs;
415  for (auto & crtc : m_crtcs)
416  {
417  // leave disabled CRTCs as disabled by ignoring
418  if ((crtc.currentmode < 0) || (crtc.width < 1) || (crtc.height < 1))
419  continue;
420 
421  MythMutterCRTCOut crtcout;
422  crtcout.id = crtc.id;
423  crtcout.new_mode = crtc.currentmode;
424  crtcout.x = crtc.x;
425  crtcout.y = crtc.y;
426  crtcout.transform = crtc.currenttransform;
427  crtcout.outputs = QList<uint32_t>();
428  crtcout.properties = MythMutterMap();
429  crtcs.append(crtcout);
430  }
431 
432  MythMutterOutputOutList outputs;
433  QDBusArgument crtcsarg;
434  QDBusArgument outarg;
435  QDBusReply<void> reply = m_interface->call(QLatin1String("ApplyConfiguration"),
436  m_serialVal, false,
437  QVariant::fromValue(crtcsarg << crtcs),
438  QVariant::fromValue(outarg << outputs));
439  if (!reply.isValid())
440  {
441  LOG(VB_GENERAL, LOG_WARNING, LOC + QString("Error applying new display configuration ('%1: %2')")
442  .arg(reply.error().type()).arg(reply.error().message()));
443  return false;
444  }
445 
446  // If ApplyConfiguration is successful, then serial will have been updated
447  // and we need it for the next change
448  QDBusMessage resources = m_interface->call("GetResources");
449  QList<QVariant> args = resources.arguments();
450  if ((resources.signature() != DISP_CONFIG_SIG) || (args.size() != 6))
451  {
452  LOG(VB_GENERAL, LOG_WARNING, LOC + "Failed to get updated DisplayConfig serial"
453  " - further display changes may fail");
454  }
455  else
456  {
457  m_serialVal = args[0].toUInt();
458  // TODO Validate the new config against the expected result?
459  }
460 
461  return true;
462 }
463 
465 {
466  if (!m_interface)
467  return;
468 
469  m_crtcs.clear();
470  m_outputs.clear();
471  m_modes.clear();
472  m_serialVal = 0;
473  m_outputIdx = -1;
474 
475  QDBusMessage reply = m_interface->call("GetResources");
476  QList<QVariant> args = reply.arguments();
477  if ((reply.signature() != DISP_CONFIG_SIG) || (args.size() != 6))
478  return;
479 
480  m_serialVal = args[0].toUInt();
481 
482  args[1].value<QDBusArgument>() >> m_crtcs;
483  for (auto & crtc : m_crtcs)
484  {
485  LOG(VB_GENERAL, LOG_DEBUG, LOC + QString("CRTC %1/%2: %3x%4+%5+%6 Mode: %7")
486  .arg(crtc.id).arg(crtc.sys_id).arg(crtc.width)
487  .arg(crtc.height).arg(crtc.x).arg(crtc.y).arg(crtc.currentmode));
488  }
489 
490  args[2].value<QDBusArgument>() >> m_outputs;
491  for (auto & output : m_outputs)
492  {
493  QStringList possiblecrtcs;
494  for (auto poss : std::as_const(output.possible_crtcs))
495  possiblecrtcs.append(QString::number(poss));
496  QStringList modes;
497  for (auto mode : std::as_const(output.modes))
498  modes.append(QString::number(mode));
499  QStringList props;
500  for (const auto& prop : std::as_const(output.properties))
501  props.append(QString("%1:%2").arg(prop.first, prop.second.variant().toString()));
502  LOG(VB_GENERAL, LOG_DEBUG, LOC +
503  QString("Output %1/%2: CRTC: %3 Possible CRTCs: %4 Name: '%5'")
504  .arg(output.id).arg(output.sys_id).arg(output.current_crtc)
505  .arg(possiblecrtcs.join(","), output.name));
506  LOG(VB_GENERAL, LOG_DEBUG, LOC +
507  QString("Output %1/%2: Modes: %3")
508  .arg(output.id).arg(output.sys_id).arg(modes.join(",")));
509  LOG(VB_GENERAL, LOG_DEBUG, LOC +
510  QString("Output %1/%2: Properties: %3")
511  .arg(output.id).arg(output.sys_id).arg(props.join(",")));
512  }
513 
514  args[3].value<QDBusArgument>() >> m_modes;
515  for (auto & mode : m_modes)
516  {
517  LOG(VB_GENERAL, LOG_DEBUG, LOC +
518  QString("Mode %1/%2: %3x%4@%5 Flags: 0x%6")
519  .arg(mode.id).arg(mode.sys_id).arg(mode.width)
520  .arg(mode.height).arg(mode.frequency).arg(mode.flags, 0, 16));
521  }
522 
523  if (m_outputs.empty())
524  {
525  LOG(VB_GENERAL, LOG_WARNING, LOC + "No connected outputs");
526  return;
527  }
528 
529  // only one connected device - use it
530  if (m_outputs.size() == 1)
531  {
532  m_outputIdx = 0;
533  }
534  else
535  {
536  // TODO - we may be able to match based on name - but need to check with Wayland
537  // Use the serial number from the current QScreen to select a suitable device
538  auto serial = m_screen->serialNumber();
539  if (serial.isEmpty())
540  {
541  LOG(VB_GENERAL, LOG_INFO, LOC + "No serial number to search for - using first output");
542  m_outputIdx = 0;
543  }
544  // search for the best connected output
545  else
546  {
547  int idx = 0;
548  for (auto & output : m_outputs)
549  {
550  if (output.serialnumber == serial)
551  {
552  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Matched serial '%1' to device '%2'")
553  .arg(serial, output.name));
554  m_outputIdx = idx;
555  break;
556  }
557  ++idx;
558  }
559 
560  if (m_outputIdx == -1)
561  {
562  LOG(VB_GENERAL, LOG_WARNING, LOC + "Failed to match display serial - using first device");
563  m_outputIdx = 0;
564  }
565  }
566  }
567 
568  // retrieve details
569  LOG(VB_GENERAL, LOG_INFO, LOC + QString("Using device '%1'").arg(m_outputs[m_outputIdx].name));
570 
571  int32_t mode = m_crtcs[m_outputs[m_outputIdx].current_crtc].currentmode;
572  m_refreshRate = m_modes[mode].frequency;
573  m_resolution = QSize(static_cast<int>(m_modes[mode].width),
574  static_cast<int>(m_modes[mode].height));
575  m_physicalSize = QSize(m_outputs[m_outputIdx].widthmm, m_outputs[m_outputIdx].heightmm);
577 }
MythMutterCRTC::transforms
QList< uint32_t > transforms
Definition: mythdisplaymutter.h:34
MythDisplay::m_physicalSize
QSize m_physicalSize
Definition: mythdisplay.h:93
mythdisplaymutter.h
build_compdb.args
args
Definition: build_compdb.py:11
DISP_CONFIG_SIG
#define DISP_CONFIG_SIG
Definition: mythdisplaymutter.h:17
MythMutterCRTCOut::properties
MythMutterMap properties
Definition: mythdisplaymutter.cpp:27
MythMutterOutput
Definition: mythdisplaymutter.h:39
MythMutterOutput::heightmm
int heightmm
Definition: mythdisplaymutter.h:54
MythDisplayMutter::MythDisplayMutter
MythDisplayMutter()
Definition: mythdisplaymutter.cpp:270
operator<<
static QDBusArgument & operator<<(QDBusArgument &Argument, const MythMutterOutputOut &Output)
Definition: mythdisplaymutter.cpp:44
MythMutterOutput::properties
MythMutterProperties properties
Definition: mythdisplaymutter.h:48
MythMutterMap
QMap< QString, QDBusVariant > MythMutterMap
Definition: mythdisplaymutter.h:19
MythDisplay::m_resolution
QSize m_resolution
Definition: mythdisplay.h:92
Mode
Mode
Definition: synaesthesia.h:23
MythMutterCRTC::properties
MythMutterProperties properties
Definition: mythdisplaymutter.h:35
MythDisplayMutter::IsValid
bool IsValid()
Definition: mythdisplaymutter.cpp:281
MythDisplayModes
std::vector< MythDisplayMode > MythDisplayModes
Definition: mythdisplaymode.h:18
MythMutterCRTC::currentmode
int32_t currentmode
Definition: mythdisplaymutter.h:32
MythMutterCRTCOut::y
int32_t y
Definition: mythdisplaymutter.cpp:24
MythDisplayMutter::UpdateResources
void UpdateResources()
Definition: mythdisplaymutter.cpp:464
MythDisplayMode::CalcKey
static uint64_t CalcKey(QSize Size, double Rate)
Definition: mythdisplaymode.cpp:127
DISP_CONFIG_PATH
#define DISP_CONFIG_PATH
Definition: mythdisplaymutter.h:16
MythDisplayMutter::MonitorsChanged
void MonitorsChanged()
Definition: mythdisplaymutter.cpp:286
MythMutterCRTC::id
uint32_t id
Definition: mythdisplaymutter.h:26
MythMutterOutput::serialnumber
QString serialnumber
Definition: mythdisplaymutter.h:51
MythMutterOutput::name
QString name
Definition: mythdisplaymutter.h:45
MythMutterOutput::id
uint32_t id
Definition: mythdisplaymutter.h:41
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
MythMutterOutputOut
Definition: mythdisplaymutter.cpp:31
MythMutterCRTCOutList
QList< MythMutterCRTCOut > MythMutterCRTCOutList
Definition: mythdisplaymutter.cpp:37
MythDisplayMutter::SwitchToVideoMode
bool SwitchToVideoMode(QSize Size, double DesiredRate) override
Definition: mythdisplaymutter.cpp:391
MythDisplay::UpdateCurrentMode
virtual void UpdateCurrentMode()
Retrieve screen details.
Definition: mythdisplay.cpp:473
MythMutterCRTC::x
int32_t x
Definition: mythdisplaymutter.h:28
MythMutterOutput::clones
QList< uint32_t > clones
Definition: mythdisplaymutter.h:47
DRM_MODE_FLAG_INTERLACE
#define DRM_MODE_FLAG_INTERLACE
Definition: mythdisplaymutter.cpp:12
MythDisplay::m_modeComplete
bool m_modeComplete
Definition: mythdisplay.h:89
MythDisplayMutter::GetVideoModes
const MythDisplayModes & GetVideoModes(void) override
Definition: mythdisplaymutter.cpp:299
MythMutterCRTCOut::outputs
QList< uint32_t > outputs
Definition: mythdisplaymutter.cpp:26
MythMutterCRTCOut::transform
uint32_t transform
Definition: mythdisplaymutter.cpp:25
MythDisplay::DebugModes
void DebugModes() const
Definition: mythdisplay.cpp:1133
MythMutterCRTC::y
int32_t y
Definition: mythdisplaymutter.h:29
MythDisplayMutter::UsingVideoModes
bool UsingVideoModes() override
Definition: mythdisplaymutter.cpp:292
MythMutterMode::flags
uint32_t flags
Definition: mythdisplaymutter.h:65
MythMutterCRTC::width
int32_t width
Definition: mythdisplaymutter.h:30
mythlogging.h
MythMutterOutput::modes
QList< uint32_t > modes
Definition: mythdisplaymutter.h:46
MythMutterCRTCOut::new_mode
int32_t new_mode
Definition: mythdisplaymutter.cpp:22
MythMutterOutput::possible_crtcs
QList< uint32_t > possible_crtcs
Definition: mythdisplaymutter.h:44
MythDisplay::m_edid
MythEDID m_edid
Definition: mythdisplay.h:94
MythMutterOutputList
QList< MythMutterOutput > MythMutterOutputList
Definition: mythdisplaymutter.h:71
MythMutterOutputOut::properties
MythMutterMap properties
Definition: mythdisplaymutter.cpp:34
MythDisplayMutter::m_outputs
MythMutterOutputList m_outputs
Definition: mythdisplaymutter.h:104
MythDisplayMutter::m_outputIdx
int m_outputIdx
Definition: mythdisplaymutter.h:106
MythMutterOutputOut::id
uint32_t id
Definition: mythdisplaymutter.cpp:33
MythMutterMode::id
uint32_t id
Definition: mythdisplaymutter.h:60
MythDisplayMutter::m_crtcs
MythMutterCRTCList m_crtcs
Definition: mythdisplaymutter.h:103
MythDisplayMutter::m_serialVal
uint32_t m_serialVal
Definition: mythdisplaymutter.h:102
uint
unsigned int uint
Definition: compat.h:81
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
MythDisplayMutter::InitialiseInterface
void InitialiseInterface()
Definition: mythdisplaymutter.cpp:356
MythDisplay::m_videoModes
MythDisplayModes m_videoModes
Definition: mythdisplay.h:98
MythDisplayMutter::m_interface
QDBusInterface * m_interface
Definition: mythdisplaymutter.h:101
MythMutterCRTC
Definition: mythdisplaymutter.h:24
MythDisplayMode
Definition: mythdisplaymode.h:22
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:906
MythMutterMode::height
uint32_t height
Definition: mythdisplaymutter.h:63
DISP_CONFIG_SERVICE
#define DISP_CONFIG_SERVICE
Definition: mythdisplaymutter.h:15
MythMutterCRTC::height
int32_t height
Definition: mythdisplaymutter.h:31
MythDisplay::m_refreshRate
double m_refreshRate
Definition: mythdisplay.h:90
LOC
#define LOC
Definition: mythdisplaymutter.cpp:16
MythDisplay::Initialise
void Initialise()
Definition: mythdisplay.cpp:533
MythMutterMode::frequency
double frequency
Definition: mythdisplaymutter.h:64
mythcorecontext.h
MythMutterOutput::current_crtc
int32_t current_crtc
Definition: mythdisplaymutter.h:43
MythMutterMode
Definition: mythdisplaymutter.h:58
DisplayModeMap
std::map< uint64_t, MythDisplayMode > DisplayModeMap
Definition: mythdisplaymode.h:19
MythMutterCRTCOut
Definition: mythdisplaymutter.cpp:19
MythDisplayMutter::~MythDisplayMutter
~MythDisplayMutter() override
Definition: mythdisplaymutter.cpp:276
MythDisplay::m_screen
QScreen * m_screen
Definition: mythdisplay.h:97
MythMutterCRTCList
QList< MythMutterCRTC > MythMutterCRTCList
Definition: mythdisplaymutter.h:68
MythMutterOutput::widthmm
int widthmm
Definition: mythdisplaymutter.h:53
MythDisplayMutter::Create
static MythDisplayMutter * Create()
Create a valid instance.
Definition: mythdisplaymutter.cpp:191
MythMutterCRTCOut::id
uint32_t id
Definition: mythdisplaymutter.cpp:21
MythMutterCRTC::sys_id
qint64 sys_id
Definition: mythdisplaymutter.h:27
MythMutterOutputOutList
QList< MythMutterOutputOut > MythMutterOutputOutList
Definition: mythdisplaymutter.cpp:40
MythMutterOutput::edid
QByteArray edid
Definition: mythdisplaymutter.h:52
MythDisplayMode::FindBestMatch
static int FindBestMatch(const MythDisplayModes &Modes, const MythDisplayMode &Mode, double &TargetRate)
Definition: mythdisplaymode.cpp:140
MythDisplayMutter::m_modes
MythMutterModeList m_modes
Definition: mythdisplaymutter.h:105
MythMutterOutput::sys_id
qint64 sys_id
Definition: mythdisplaymutter.h:42
MythDisplayMutter
A subclass of MythDisplay using the org.gnome.Mutter.DisplayConfig DBUS interface.
Definition: mythdisplaymutter.h:78
MythMutterModeList
QList< MythMutterMode > MythMutterModeList
Definition: mythdisplaymutter.h:74
output
#define output
Definition: synaesthesia.cpp:220
MythMutterCRTCOut::x
int32_t x
Definition: mythdisplaymutter.cpp:23
MythMutterCRTC::currenttransform
uint32_t currenttransform
Definition: mythdisplaymutter.h:33
operator>>
static const QDBusArgument & operator>>(const QDBusArgument &Argument, MythMutterOutputOut &Output)
Definition: mythdisplaymutter.cpp:61
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(MythMutterCRTCOut)
MythDisplayMutter::m_modeMap
QMap< uint64_t, uint32_t > m_modeMap
Definition: mythdisplaymutter.h:107
MythMutterMode::width
uint32_t width
Definition: mythdisplaymutter.h:62
MythDisplayMutter::UpdateCurrentMode
void UpdateCurrentMode() override
Retrieve screen details.
Definition: mythdisplaymutter.cpp:344
MythEDID
Definition: mythedid.h:21