summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;