summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJyri Sarha <jsarha@ti.com>2015-10-20 16:48:08 +0300
committerJyri Sarha <jsarha@ti.com>2015-10-20 19:18:32 +0300
commite3820f911a337c5eb1832449c378658469305ef1 (patch)
tree3d6c04b981c8db4d770aa869b9908700e3a8aa95
parent66429ef50279f0085d5637ceca7dae57bca5e981 (diff)
libkms++/plane: Add methods for getting details of the DRM object
-rw-r--r--libkms++/plane.cpp47
-rw-r--r--libkms++/plane.h9
2 files changed, 56 insertions, 0 deletions
diff --git a/libkms++/plane.cpp b/libkms++/plane.cpp
index 93567f1..3ad3ddf 100644
--- a/libkms++/plane.cpp
+++ b/libkms++/plane.cpp
@@ -75,4 +75,51 @@ PlaneType Plane::plane_type() const
else
return PlaneType::Overlay;
}
+
+vector<PixelFormat> Plane::get_formats() const
+{
+ auto p = m_priv->drm_plane;
+ vector<PixelFormat> r;
+
+ for (unsigned i = 0; i < p->count_formats; ++i)
+ r.push_back((PixelFormat) p->formats[i]);
+
+ return r;
+}
+
+uint32_t Plane::crtc_id() const
+{
+ return m_priv->drm_plane->crtc_id;
+}
+
+uint32_t Plane::fb_id() const
+{
+ return m_priv->drm_plane->fb_id;
+}
+
+uint32_t Plane::crtc_x() const
+{
+ return m_priv->drm_plane->crtc_x;
+}
+
+uint32_t Plane::crtc_y() const
+{
+ return m_priv->drm_plane->crtc_y;
+}
+
+uint32_t Plane::x() const
+{
+ return m_priv->drm_plane->x;
+}
+
+uint32_t Plane::y() const
+{
+ return m_priv->drm_plane->y;
+}
+
+uint32_t Plane::gamma_size() const
+{
+ return m_priv->drm_plane->gamma_size;
+}
+
}
diff --git a/libkms++/plane.h b/libkms++/plane.h
index 0c232c0..2faca78 100644
--- a/libkms++/plane.h
+++ b/libkms++/plane.h
@@ -25,6 +25,15 @@ public:
PlaneType plane_type() const;
+ std::vector<PixelFormat> get_formats() const;
+ uint32_t crtc_id() const;
+ uint32_t fb_id() const;
+
+ uint32_t crtc_x() const;
+ uint32_t crtc_y() const;
+ uint32_t x() const;
+ uint32_t y() const;
+ uint32_t gamma_size() const;
private:
Plane(Card& card, uint32_t id);
~Plane();