mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-27 08:05:41 +00:00
DRMDisplay: Add mode queries
This commit is contained in:
parent
0c71a97e02
commit
748e2e9a70
|
@ -18,6 +18,15 @@ public:
|
||||||
u32 GetWidth() const { return m_mode->hdisplay; }
|
u32 GetWidth() const { return m_mode->hdisplay; }
|
||||||
u32 GetHeight() const { return m_mode->vdisplay; }
|
u32 GetHeight() const { return m_mode->vdisplay; }
|
||||||
|
|
||||||
|
u32 GetModeCount() const { return m_connector->count_modes; }
|
||||||
|
u32 GetModeWidth(u32 i) const { return m_connector->modes[i].hdisplay; }
|
||||||
|
u32 GetModeHeight(u32 i) const { return m_connector->modes[i].vdisplay; }
|
||||||
|
float GetModeRefreshRate(u32 i) const
|
||||||
|
{
|
||||||
|
return (static_cast<float>(m_connector->modes[i].clock) * 1000.0f) /
|
||||||
|
(static_cast<float>(m_connector->modes[i].htotal) * static_cast<float>(m_connector->modes[i].vtotal));
|
||||||
|
}
|
||||||
|
|
||||||
std::optional<u32> AddBuffer(u32 width, u32 height, u32 format, u32 handle, u32 pitch, u32 offset);
|
std::optional<u32> AddBuffer(u32 width, u32 height, u32 format, u32 handle, u32 pitch, u32 offset);
|
||||||
void RemoveBuffer(u32 fb_id);
|
void RemoveBuffer(u32 fb_id);
|
||||||
void PresentBuffer(u32 fb_id, bool wait_for_vsync);
|
void PresentBuffer(u32 fb_id, bool wait_for_vsync);
|
||||||
|
@ -33,6 +42,8 @@ private:
|
||||||
int m_card_id = 0;
|
int m_card_id = 0;
|
||||||
int m_card_fd = -1;
|
int m_card_fd = -1;
|
||||||
u32 m_crtc_id = 0;
|
u32 m_crtc_id = 0;
|
||||||
|
|
||||||
|
drmModeRes* m_resources = nullptr;
|
||||||
drmModeConnector* m_connector = nullptr;
|
drmModeConnector* m_connector = nullptr;
|
||||||
drmModeModeInfo* m_mode = nullptr;
|
drmModeModeInfo* m_mode = nullptr;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue