summaryrefslogtreecommitdiffstats
path: root/video/out/drm_common.c
diff options
context:
space:
mode:
authorLongChair <longchair@hotmail.com>2018-04-29 17:46:23 +0200
committerJan Ekström <jeebjp@gmail.com>2018-05-01 20:48:02 +0300
commited94f8dc00dd75bf5d88bdf73b9d69a579c0f8ef (patch)
treea7464c8db4f154423ee148c2c6e08f047b41a762 /video/out/drm_common.c
parent49bc07faea5f3c621eed437fadf68653b4b2498b (diff)
downloadmpv-ed94f8dc00dd75bf5d88bdf73b9d69a579c0f8ef.tar.bz2
mpv-ed94f8dc00dd75bf5d88bdf73b9d69a579c0f8ef.tar.xz
drm/atomic: refactor planes names
We are currently using primary / overlay planes drm objects, assuming that primary plane is osd and overlay plane is video. This commit is doing two things : - replace the primary / overlay planes members with osd and video planes member without the assumption - Add two more options to determine which one of the primary / overlay is associated to osd / video. - It will default osd to overlay and video to primary if unspecified
Diffstat (limited to 'video/out/drm_common.c')
-rw-r--r--video/out/drm_common.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/video/out/drm_common.c b/video/out/drm_common.c
index e0b0581834..3393954a5e 100644
--- a/video/out/drm_common.c
+++ b/video/out/drm_common.c
@@ -47,13 +47,18 @@ 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-overlay", drm_overlay_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("drm-format", drm_format, 0,
({"xrgb8888", DRM_OPTS_FORMAT_XRGB8888},
{"xrgb2101010", DRM_OPTS_FORMAT_XRGB2101010})),
OPT_SIZE_BOX("drm-osd-size", drm_osd_size, 0),
{0},
},
+ .defaults = &(const struct drm_opts) {
+ .drm_osd_plane_id = -1,
+ .drm_video_plane_id = -1,
+ },
.size = sizeof(struct drm_opts),
};
@@ -238,7 +243,7 @@ static void parse_connector_spec(struct mp_log *log,
struct kms *kms_create(struct mp_log *log, const char *connector_spec,
- int mode_id, int overlay_id)
+ int mode_id, int osd_plane_id, int video_plane_id)
{
int card_no = -1;
char *connector_name = NULL;
@@ -286,7 +291,7 @@ struct kms *kms_create(struct mp_log *log, const char *connector_spec,
} else {
mp_verbose(log, "DRM Atomic support found\n");
kms->atomic_context = drm_atomic_create_context(kms->log, kms->fd, kms->crtc_id,
- kms->connector->connector_id, overlay_id);
+ kms->connector->connector_id, osd_plane_id, video_plane_id);
if (!kms->atomic_context) {
mp_err(log, "Failed to create DRM atomic context\n");
goto err;