diff options
Diffstat (limited to 'minui/graphics_drm.h')
-rw-r--r-- | minui/graphics_drm.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/minui/graphics_drm.h b/minui/graphics_drm.h index 57ba39b83..fe3beaff9 100644 --- a/minui/graphics_drm.h +++ b/minui/graphics_drm.h @@ -59,16 +59,23 @@ class MinuiBackendDrm : public MinuiBackend { GRSurface* Init() override; GRSurface* Flip() override; void Blank(bool) override; + void Blank(bool blank, DrmConnector index) override; private: void DrmDisableCrtc(int drm_fd, drmModeCrtc* crtc); - bool DrmEnableCrtc(int drm_fd, drmModeCrtc* crtc, const std::unique_ptr<GRSurfaceDrm>& surface); + bool DrmEnableCrtc(int drm_fd, drmModeCrtc* crtc, const std::unique_ptr<GRSurfaceDrm>& surface, + uint32_t* conntcors); void DisableNonMainCrtcs(int fd, drmModeRes* resources, drmModeCrtc* main_crtc); - drmModeConnector* FindMainMonitor(int fd, drmModeRes* resources, uint32_t* mode_index); + bool FindAndSetMonitor(int fd, drmModeRes* resources); + + struct DrmInterface { + std::unique_ptr<GRSurfaceDrm> GRSurfaceDrms[2]; + int current_buffer{ 0 }; + drmModeCrtc* monitor_crtc{ nullptr }; + drmModeConnector* monitor_connector{ nullptr }; + uint32_t selected_mode{ 0 }; + } drm[DRM_MAX]; - std::unique_ptr<GRSurfaceDrm> GRSurfaceDrms[2]; - int current_buffer{ 0 }; - drmModeCrtc* main_monitor_crtc{ nullptr }; - drmModeConnector* main_monitor_connector{ nullptr }; int drm_fd{ -1 }; + DrmConnector active_display = DRM_MAIN; }; |