eglfs_kms: Mode support
Add support for reporting available modes. [ChangeLog][QPA][eglfs][kms] List screen modes, current and preferred mode. Change-Id: If64c1512271fadbafbb8c9fd715e64663d598599 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
parent
78236be8d7
commit
30b829a5a9
@ -330,6 +330,7 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
|
|||||||
crtc_id,
|
crtc_id,
|
||||||
physSize,
|
physSize,
|
||||||
selected_mode,
|
selected_mode,
|
||||||
|
selected_mode,
|
||||||
false,
|
false,
|
||||||
drmModeGetCrtc(m_dri_fd, crtc_id),
|
drmModeGetCrtc(m_dri_fd, crtc_id),
|
||||||
modes,
|
modes,
|
||||||
|
@ -100,6 +100,7 @@ struct QKmsOutput
|
|||||||
uint32_t connector_id;
|
uint32_t connector_id;
|
||||||
uint32_t crtc_id;
|
uint32_t crtc_id;
|
||||||
QSizeF physical_size;
|
QSizeF physical_size;
|
||||||
|
int preferred_mode; // index of preferred mode in list below
|
||||||
int mode; // index of selected mode in list below
|
int mode; // index of selected mode in list below
|
||||||
bool mode_set;
|
bool mode_set;
|
||||||
drmModeCrtcPtr saved_crtc;
|
drmModeCrtcPtr saved_crtc;
|
||||||
|
@ -173,6 +173,28 @@ qreal QEglFSKmsScreen::refreshRate() const
|
|||||||
return refresh > 0 ? refresh : 60;
|
return refresh > 0 ? refresh : 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QVector<QPlatformScreen::Mode> QEglFSKmsScreen::modes() const
|
||||||
|
{
|
||||||
|
QVector<QPlatformScreen::Mode> list;
|
||||||
|
list.reserve(m_output.modes.size());
|
||||||
|
|
||||||
|
for (const drmModeModeInfo &info : qAsConst(m_output.modes))
|
||||||
|
list.append({QSize(info.hdisplay, info.vdisplay),
|
||||||
|
qreal(info.vrefresh > 0 ? info.vrefresh : 60)});
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
int QEglFSKmsScreen::currentMode() const
|
||||||
|
{
|
||||||
|
return m_output.mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
int QEglFSKmsScreen::preferredMode() const
|
||||||
|
{
|
||||||
|
return m_output.preferred_mode;
|
||||||
|
}
|
||||||
|
|
||||||
QPlatformScreen::SubpixelAntialiasingType QEglFSKmsScreen::subpixelAntialiasingTypeHint() const
|
QPlatformScreen::SubpixelAntialiasingType QEglFSKmsScreen::subpixelAntialiasingTypeHint() const
|
||||||
{
|
{
|
||||||
return m_output.subpixelAntialiasingTypeHint();
|
return m_output.subpixelAntialiasingTypeHint();
|
||||||
|
@ -77,6 +77,11 @@ public:
|
|||||||
QList<QPlatformScreen *> virtualSiblings() const override { return m_siblings; }
|
QList<QPlatformScreen *> virtualSiblings() const override { return m_siblings; }
|
||||||
void setVirtualSiblings(QList<QPlatformScreen *> sl) { m_siblings = sl; }
|
void setVirtualSiblings(QList<QPlatformScreen *> sl) { m_siblings = sl; }
|
||||||
|
|
||||||
|
QVector<QPlatformScreen::Mode> modes() const override;
|
||||||
|
|
||||||
|
int currentMode() const override;
|
||||||
|
int preferredMode() const override;
|
||||||
|
|
||||||
QKmsDevice *device() const { return m_device; }
|
QKmsDevice *device() const { return m_device; }
|
||||||
|
|
||||||
void destroySurface();
|
void destroySurface();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user