Skip to content

Commit

Permalink
drm/atomic: Change --drm-osd-plane-id and --drm-video-plane-id defaults
Browse files Browse the repository at this point in the history
Using the primary plane for "OSD" plane makes more sense in the software
decoding scenario when this is the only plane being used for rendering. Seeing
as mpv by default does not use any hardware decoding (the user has to manually
specify --hwdec) it is better to optimize the default planes for software
decoding.
  • Loading branch information
xantoz committed Apr 21, 2018
1 parent d8e214a commit 575496d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DOCS/man/vo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -493,14 +493,14 @@ Available video output drivers are:
Index is zero based, and related to crtc.
When using this option with drm_prime renderer, it will only affect
the OSD contents. Otherwise it will set OSD & video plane.
(default: first overlay plane)
(default: primary plane)

``--drm-video-plane-id=<number>``
Select the DRM planed index to use for video layer.
Index is zero based, and related to crtc.
This option only has effect when using the drm_prime renderer (which
supports several layers) together with ``vo=gpu`` and ``gpu-context=drm``.
(default: primary plane)
(default: first overlay plane)

``--drm-format=<xrgb8888,xrgb2101010>``
Select the DRM format to use (default: xrgb8888). This allows you to
Expand Down
4 changes: 2 additions & 2 deletions video/out/drm_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ struct drm_atomic_context *drm_atomic_create_context(struct mp_log *log, int fd,
if (!ctx->osd_plane) {
if (overlay_id) {
mp_verbose(log, "Using default plane %d for OSD\n", overlay_id);
ctx->osd_plane = drm_object_create(log, ctx->fd, overlay_id, DRM_MODE_OBJECT_PLANE);
ctx->osd_plane = drm_object_create(log, ctx->fd, primary_id, DRM_MODE_OBJECT_PLANE);
} else {
mp_err(log, "Failed to find OSD plane with id=%d\n", osd_plane_id);
goto fail;
Expand All @@ -260,7 +260,7 @@ struct drm_atomic_context *drm_atomic_create_context(struct mp_log *log, int fd,
if (!ctx->video_plane) {
if (primary_id) {
mp_verbose(log, "Using default plane %d for video\n", primary_id);
ctx->video_plane = drm_object_create(log, ctx->fd, primary_id, DRM_MODE_OBJECT_PLANE);
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;
Expand Down

0 comments on commit 575496d

Please sign in to comment.