summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/out/drm_atomic.c13
-rw-r--r--video/out/opengl/hwdec_drmprime_drm.c4
2 files changed, 11 insertions, 6 deletions
diff --git a/video/out/drm_atomic.c b/video/out/drm_atomic.c
index 5c6b3bbe21..f530d91b66 100644
--- a/video/out/drm_atomic.c
+++ b/video/out/drm_atomic.c
@@ -263,21 +263,16 @@ struct drm_atomic_context *drm_atomic_create_context(struct mp_log *log, int fd,
mp_verbose(log, "Using default plane %d for video\n", overlay_id);
ctx->video_plane = drm_object_create(log, ctx->fd, overlay_id, DRM_MODE_OBJECT_PLANE);
} else {
- mp_err(log, "Failed to find video plane with id=%d\n", video_plane_id);
- goto fail;
+ mp_verbose(log, "Failed to find video plane with id=%d. drmprime-drm hwdec interop will not work\n", video_plane_id);
}
} else {
mp_verbose(log, "Found video plane with ID %d\n", ctx->video_plane->id);
}
- mp_verbose(log, "Found Video plane with ID %d, OSD with ID %d\n",
- ctx->video_plane->id, ctx->osd_plane->id);
-
drmModeFreePlaneResources(plane_res);
drmModeFreeResources(res);
return ctx;
-
fail:
if (res)
drmModeFreeResources(res);
@@ -301,6 +296,9 @@ void drm_atomic_destroy_context(struct drm_atomic_context *ctx)
static bool drm_atomic_save_plane_state(struct drm_object *plane,
struct drm_atomic_plane_state *plane_state)
{
+ if (!plane)
+ return true;
+
bool ret = true;
if (0 > drm_object_get_property(plane, "FB_ID", &plane_state->fb_id))
@@ -333,6 +331,9 @@ static bool drm_atomic_restore_plane_state(drmModeAtomicReq *request,
struct drm_object *plane,
const struct drm_atomic_plane_state *plane_state)
{
+ if (!plane)
+ return true;
+
bool ret = true;
if (0 > drm_object_set_property(request, plane, "FB_ID", plane_state->fb_id))
diff --git a/video/out/opengl/hwdec_drmprime_drm.c b/video/out/opengl/hwdec_drmprime_drm.c
index 5e09c5a215..d4543b0f47 100644
--- a/video/out/opengl/hwdec_drmprime_drm.c
+++ b/video/out/opengl/hwdec_drmprime_drm.c
@@ -257,6 +257,10 @@ static int init(struct ra_hwdec *hw)
mp_err(p->log, "Failed to retrieve DRM atomic context.\n");
goto err;
}
+ if (!p->ctx->video_plane) {
+ mp_warn(p->log, "No video plane. You might need to specify it manually using --drm-video-plane-id\n");
+ goto err;
+ }
} else {
mp_verbose(p->log, "Failed to retrieve DRM fd from native display.\n");
goto err;