From 3dea57a9d5eed91d357bb2353fd74ee2921a0f8a Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 27 Sep 2019 20:45:41 +0300 Subject: [PATCH] backend-drm: Add a helper to display plane type as a 'string' Signed-off-by: Marius Vlad --- libweston/backend-drm/drm-internal.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libweston/backend-drm/drm-internal.h b/libweston/backend-drm/drm-internal.h index 2bd5b347..8ba3e92b 100644 --- a/libweston/backend-drm/drm-internal.h +++ b/libweston/backend-drm/drm-internal.h @@ -536,6 +536,22 @@ to_drm_mode(struct weston_mode *base) return container_of(base, struct drm_mode, base); } +static inline const char * +drm_output_get_plane_type_name(struct drm_plane *p) +{ + switch (p->type) { + case WDRM_PLANE_TYPE_PRIMARY: + return "primary"; + case WDRM_PLANE_TYPE_CURSOR: + return "cursor"; + case WDRM_PLANE_TYPE_OVERLAY: + return "overlay"; + default: + assert(0); + break; + } +} + struct drm_output * drm_output_find_by_crtc(struct drm_backend *b, uint32_t crtc_id);