From 9f2970f28a28076897fda1100de2b6eb9a92be79 Mon Sep 17 00:00:00 2001 From: LongChair Date: Sun, 29 Apr 2018 15:09:16 +0200 Subject: drm/atomic: refactor hwdec_drmprime_drm with native resources That new API was introduced and allows to have several native resources. Thisuses that mechanisma for drm resources rather than the deprecated opengl-cb structs. This patch therefore add two structs that can be used with the drm atomic interop. - mpv_opengl_drm_params : which will hold all the drm handles - mpv_opengl_drm_osd_size : which will hold osd layer size This commit adds a drm-osd-size=WxH parameter to commandline which allows to define the OSD plane dimension. OSD can be upscaled to screen resolution when having OSD at video resolution is too heavy. This is especially useful for UHD modes on embedded devices where the GPU cannot handle UHD modes at a decent framerate. --- video/out/gpu/libmpv_gpu.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'video/out/gpu') diff --git a/video/out/gpu/libmpv_gpu.c b/video/out/gpu/libmpv_gpu.c index f687c97b51..fce2acfa4d 100644 --- a/video/out/gpu/libmpv_gpu.c +++ b/video/out/gpu/libmpv_gpu.c @@ -1,6 +1,7 @@ #include "config.h" #include "hwdec.h" #include "libmpv_gpu.h" +#include "libmpv/render_gl.h" #include "video.h" #include "video/out/libmpv.h" @@ -31,6 +32,14 @@ static const struct native_resource_entry native_resource_map[] = { .name = "wl", .size = 0, }, + [MPV_RENDER_PARAM_DRM_DISPLAY] = { + .name = "drm_params", + .size = sizeof (mpv_opengl_drm_params), + }, + [MPV_RENDER_PARAM_DRM_OSD_SIZE] = { + .name = "drm_osd_size", + .size = sizeof (mpv_opengl_drm_osd_size), + }, }; static int init(struct render_backend *ctx, mpv_render_param *params) -- cgit v1.2.3