summaryrefslogtreecommitdiffstats
path: root/video/out/drm_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/drm_common.c')
-rw-r--r--video/out/drm_common.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/video/out/drm_common.c b/video/out/drm_common.c
index 2971d77094..36e72b3b9a 100644
--- a/video/out/drm_common.c
+++ b/video/out/drm_common.c
@@ -48,6 +48,9 @@ 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_CHOICE("drm-atomic", drm_atomic, 0,
+ ({"no", 0},
+ {"auto", 1})),
OPT_CHOICE_OR_INT("drm-draw-plane", drm_draw_plane, 0, 0, INT_MAX,
({"primary", DRM_OPTS_PRIMARY_PLANE},
{"overlay", DRM_OPTS_OVERLAY_PLANE})),
@@ -65,6 +68,7 @@ const struct m_sub_options drm_conf = {
{0},
},
.defaults = &(const struct drm_opts) {
+ .drm_atomic = 1,
.drm_draw_plane = DRM_OPTS_PRIMARY_PLANE,
.drm_drmprime_video_plane = DRM_OPTS_OVERLAY_PLANE,
},
@@ -276,9 +280,9 @@ 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 draw_plane, int drmprime_video_plane)
+ int mode_id, int draw_plane, int drmprime_video_plane,
+ bool use_atomic)
{
int card_no = -1;
char *connector_name = NULL;
@@ -321,8 +325,10 @@ struct kms *kms_create(struct mp_log *log, const char *connector_spec,
mp_err(log, "Failed to set Universal planes capability\n");
}
- if (drmSetClientCap(kms->fd, DRM_CLIENT_CAP_ATOMIC, 1)) {
- mp_verbose(log, "No DRM Atomic support found\n");
+ if (!use_atomic) {
+ mp_verbose(log, "Using Legacy Modesetting\n");
+ } else if (drmSetClientCap(kms->fd, DRM_CLIENT_CAP_ATOMIC, 1)) {
+ mp_verbose(log, "No DRM Atomic support found. Falling back to legacy modesetting\n");
} else {
mp_verbose(log, "DRM Atomic support found\n");
kms->atomic_context = drm_atomic_create_context(kms->log, kms->fd, kms->crtc_id,