From c151fae054d12ef9b392f5b6dcc1bafe894005b0 Mon Sep 17 00:00:00 2001 From: Anton Kindestam Date: Sat, 2 Jun 2018 12:54:05 +0200 Subject: drm_atomic: Add general primary/overlay plane option Add general primary/overlay plane option to drm-osd-plane-id and drm-video-plane-id, so that the user can just request any usable primary or overlay plane for either of these two options. This should be somewhat more user-friendly (especially as neither of these two options currently have a useful help function), as usually you would only be interested in the type of the plane, and not exactly which plane gets picked. --- video/out/drm_common.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'video/out/drm_common.c') diff --git a/video/out/drm_common.c b/video/out/drm_common.c index aa3d0998c4..647d545eb9 100644 --- a/video/out/drm_common.c +++ b/video/out/drm_common.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "drm_common.h" @@ -47,8 +48,12 @@ const struct m_sub_options drm_conf = { OPT_STRING_VALIDATE("drm-connector", drm_connector_spec, 0, drm_validate_connector_opt), OPT_INT("drm-mode", drm_mode_id, 0), - OPT_INT("drm-osd-plane-id", drm_osd_plane_id, 0), - OPT_INT("drm-video-plane-id", drm_video_plane_id, 0), + OPT_CHOICE_OR_INT("drm-osd-plane-id", drm_osd_plane_id, 0, 0, INT_MAX, + ({"primary", DRM_OPTS_PRIMARY_PLANE}, + {"overlay", DRM_OPTS_OVERLAY_PLANE})), + OPT_CHOICE_OR_INT("drm-video-plane-id", drm_video_plane_id, 0, 0, INT_MAX, + ({"primary", DRM_OPTS_PRIMARY_PLANE}, + {"overlay", DRM_OPTS_OVERLAY_PLANE})), OPT_CHOICE("drm-format", drm_format, 0, ({"xrgb8888", DRM_OPTS_FORMAT_XRGB8888}, {"xrgb2101010", DRM_OPTS_FORMAT_XRGB2101010})), @@ -56,8 +61,8 @@ const struct m_sub_options drm_conf = { {0}, }, .defaults = &(const struct drm_opts) { - .drm_osd_plane_id = -1, - .drm_video_plane_id = -1, + .drm_osd_plane_id = DRM_OPTS_PRIMARY_PLANE, + .drm_video_plane_id = DRM_OPTS_OVERLAY_PLANE, }, .size = sizeof(struct drm_opts), }; -- cgit v1.2.3