summaryrefslogtreecommitdiff
path: root/libkms++
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2015-10-09 12:32:38 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-10-09 12:32:38 +0300
commit3ea1d4ebea22a60e8e849897d88780e2eb0f6eb9 (patch)
tree262b58726f82e531a248dff1516d38a57d03467f /libkms++
parent105ee0be5a083dae2b2f6480a7c72ba6225bba66 (diff)
libkms: Add Plane::supports_format
Diffstat (limited to 'libkms++')
-rw-r--r--libkms++/plane.cpp11
-rw-r--r--libkms++/plane.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/libkms++/plane.cpp b/libkms++/plane.cpp
index b9884e2..93567f1 100644
--- a/libkms++/plane.cpp
+++ b/libkms++/plane.cpp
@@ -57,6 +57,17 @@ bool Plane::supports_crtc(Crtc* crtc) const
return m_priv->drm_plane->possible_crtcs & (1 << crtc->idx());
}
+bool Plane::supports_format(PixelFormat fmt) const
+{
+ auto p = m_priv->drm_plane;
+
+ for (unsigned i = 0; i < p->count_formats; ++i)
+ if ((uint32_t)fmt == p->formats[i])
+ return true;
+
+ return false;
+}
+
PlaneType Plane::plane_type() const
{
if (card().has_has_universal_planes())
diff --git a/libkms++/plane.h b/libkms++/plane.h
index 671e150..0c232c0 100644
--- a/libkms++/plane.h
+++ b/libkms++/plane.h
@@ -21,6 +21,7 @@ public:
void print_short() const;
bool supports_crtc(Crtc* crtc) const;
+ bool supports_format(PixelFormat fmt) const;
PlaneType plane_type() const;