diff options
Diffstat (limited to 'kms++/src')
-rw-r--r-- | kms++/src/plane.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/kms++/src/plane.cpp b/kms++/src/plane.cpp index 10aaeda..e19910b 100644 --- a/kms++/src/plane.cpp +++ b/kms++/src/plane.cpp @@ -50,10 +50,20 @@ bool Plane::supports_format(PixelFormat fmt) const PlaneType Plane::plane_type() const { - if (card().has_has_universal_planes()) - return (PlaneType)get_prop_value("type"); - else + if (card().has_has_universal_planes()) { + switch (get_prop_value("type")) { + case DRM_PLANE_TYPE_OVERLAY: + return PlaneType::Overlay; + case DRM_PLANE_TYPE_PRIMARY: + return PlaneType::Primary; + case DRM_PLANE_TYPE_CURSOR: + return PlaneType::Cursor; + default: + throw invalid_argument("Bad plane type"); + } + } else { return PlaneType::Overlay; + } } vector<PixelFormat> Plane::get_formats() const |