summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/hwdec_drmprime_drm.c
diff options
context:
space:
mode:
authorAnton Kindestam <antonki@kth.se>2019-09-12 21:00:50 +0200
committerJan Ekström <jeebjp@gmail.com>2019-09-18 23:59:32 +0300
commite08f235578aa6305a41e7c7132225e58bd191ef0 (patch)
tree5a96a85f873f1dc0e117d2fb3fb0191e6e44c462 /video/out/opengl/hwdec_drmprime_drm.c
parentb04ddcdc0b24c8d594bcb001c964035aa7ebd008 (diff)
downloadmpv-e08f235578aa6305a41e7c7132225e58bd191ef0.tar.bz2
mpv-e08f235578aa6305a41e7c7132225e58bd191ef0.tar.xz
drm: fix libmpv ABI breakage introduced in 351c083487050c88adb0e3d60f2174850f869018
Extending the client-allocated mpv_opengl_drm_params struct constituted a break of ABI that could cause UB. Create a clean break by deprecating "drm_params" and related structs and enum values, and replacing it with "drm_params_v2". Also fix some comments and code that wrongly assumed that open could return any other negative number than -1 for failure. This commit updates the libmpv version to 1.104
Diffstat (limited to 'video/out/opengl/hwdec_drmprime_drm.c')
-rw-r--r--video/out/opengl/hwdec_drmprime_drm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/video/out/opengl/hwdec_drmprime_drm.c b/video/out/opengl/hwdec_drmprime_drm.c
index fd3d383c55..7328fbb284 100644
--- a/video/out/opengl/hwdec_drmprime_drm.c
+++ b/video/out/opengl/hwdec_drmprime_drm.c
@@ -146,8 +146,8 @@ static int overlay_frame(struct ra_hwdec *hw, struct mp_image *hw_image,
// grab atomic request from native resources
if (p->ctx) {
- struct mpv_opengl_drm_params *drm_params;
- drm_params = (mpv_opengl_drm_params *)ra_get_native_resource(hw->ra, "drm_params");
+ struct mpv_opengl_drm_params_v2 *drm_params;
+ drm_params = (mpv_opengl_drm_params_v2 *)ra_get_native_resource(hw->ra, "drm_params_v2");
if (!drm_params) {
MP_ERR(hw, "Failed to retrieve drm params from native resources\n");
return -1;
@@ -250,9 +250,9 @@ static int init(struct ra_hwdec *hw)
drmprime_video_plane = opts->drm_drmprime_video_plane;
talloc_free(tmp);
- struct mpv_opengl_drm_params *drm_params;
+ struct mpv_opengl_drm_params_v2 *drm_params;
- drm_params = ra_get_native_resource(hw->ra, "drm_params");
+ drm_params = ra_get_native_resource(hw->ra, "drm_params_v2");
if (drm_params) {
p->ctx = drm_atomic_create_context(p->log, drm_params->fd, drm_params->crtc_id,
drm_params->connector_id, draw_plane, drmprime_video_plane);