From 18ba50b6b24b75bc23346cf232e01ec47b050f81 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Tue, 20 Oct 2015 16:47:11 +0300 Subject: libkms++/crtc: Add methods for getting details of the DRM object --- libkms++/crtc.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ libkms++/crtc.h | 9 +++++++++ 2 files changed, 50 insertions(+) diff --git a/libkms++/crtc.cpp b/libkms++/crtc.cpp index 9716c97..321670c 100644 --- a/libkms++/crtc.cpp +++ b/libkms++/crtc.cpp @@ -87,4 +87,45 @@ int Crtc::page_flip(Framebuffer& fb, void *data) { return drmModePageFlip(card().fd(), id(), fb.id(), DRM_MODE_PAGE_FLIP_EVENT, data); } + +uint32_t Crtc::buffer_id() const +{ + return m_priv->drm_crtc->buffer_id; +} + +uint32_t Crtc::x() const +{ + return m_priv->drm_crtc->x; +} + +uint32_t Crtc::y() const +{ + return m_priv->drm_crtc->y; +} + +uint32_t Crtc::width() const +{ + return m_priv->drm_crtc->width; +} + +uint32_t Crtc::height() const +{ + return m_priv->drm_crtc->height; +} + +int Crtc::mode_valid() const +{ + return m_priv->drm_crtc->mode_valid; +} + +Videomode Crtc::mode() const +{ + return drm_mode_to_video_mode(m_priv->drm_crtc->mode); +} + +int Crtc::gamma_size() const +{ + return m_priv->drm_crtc->gamma_size; +} + } diff --git a/libkms++/crtc.h b/libkms++/crtc.h index 053c77d..7581302 100644 --- a/libkms++/crtc.h +++ b/libkms++/crtc.h @@ -26,6 +26,15 @@ public: int page_flip(Framebuffer& fb, void *data); int page_flip(Framebuffer& fb, PageFlipHandlerBase* data) { return page_flip(fb, (void*)data); } + + uint32_t buffer_id() const; + uint32_t x() const; + uint32_t y() const; + uint32_t width() const; + uint32_t height() const; + int mode_valid() const; + Videomode mode() const; + int gamma_size() const; private: Crtc(Card& card, uint32_t id, uint32_t idx); ~Crtc(); -- cgit v1.2.3