summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-28 18:27:30 +0100
committerwm4 <wm4@nowhere>2017-01-28 18:27:30 +0100
commit443d3a91d335188be15c3bd2616d2cc9c4728566 (patch)
tree0c3b8aaab56e84a1f807ff88cd6b6b1d4f0c5bbc /video/out
parentd9ef1333c6ada98f4b71c20e0a6aa02ed55983c9 (diff)
downloadmpv-443d3a91d335188be15c3bd2616d2cc9c4728566.tar.bz2
mpv-443d3a91d335188be15c3bd2616d2cc9c4728566.tar.xz
vaapi: remove central lock around vaapi API calls
The lock was disabled recently. This commit gets rid of the dummied out calls. The main reason for removing it is that there is no apparent need for it anymore, and the new FFmpeg vaapi code does not use or provide such a lock (there are some places which we cannot control and which do vaapi API calls, like frame destructors).
Diffstat (limited to 'video/out')
-rw-r--r--video/out/opengl/hwdec_vaegl.c8
-rw-r--r--video/out/opengl/hwdec_vaglx.c2
-rw-r--r--video/out/vo_vaapi.c10
3 files changed, 0 insertions, 20 deletions
diff --git a/video/out/opengl/hwdec_vaegl.c b/video/out/opengl/hwdec_vaegl.c
index 4b164ab407..a66ad7f390 100644
--- a/video/out/opengl/hwdec_vaegl.c
+++ b/video/out/opengl/hwdec_vaegl.c
@@ -146,8 +146,6 @@ static void unmap_frame(struct gl_hwdec *hw)
p->images[n] = 0;
}
- va_lock(p->ctx);
-
if (p->buffer_acquired) {
status = vaReleaseBufferHandle(p->display, p->current_image.buf);
CHECK_VA_STATUS(p, "vaReleaseBufferHandle()");
@@ -158,8 +156,6 @@ static void unmap_frame(struct gl_hwdec *hw)
CHECK_VA_STATUS(p, "vaDestroyImage()");
p->current_image.image_id = VA_INVALID_ID;
}
-
- va_unlock(p->ctx);
}
static void destroy_textures(struct gl_hwdec *hw)
@@ -310,8 +306,6 @@ static int map_frame(struct gl_hwdec *hw, struct mp_image *hw_image,
unmap_frame(hw);
- va_lock(p->ctx);
-
status = vaDeriveImage(p->display, va_surface_id(hw_image), va_image);
if (!CHECK_VA_STATUS(p, "vaDeriveImage()"))
goto err;
@@ -385,11 +379,9 @@ static int map_frame(struct gl_hwdec *hw, struct mp_image *hw_image,
if (va_image->format.fourcc == VA_FOURCC_YV12)
MPSWAP(struct gl_hwdec_plane, out_frame->planes[1], out_frame->planes[2]);
- va_unlock(p->ctx);
return 0;
err:
- va_unlock(p->ctx);
if (!p->probing_formats)
MP_FATAL(p, "mapping VAAPI EGL image failed\n");
unmap_frame(hw);
diff --git a/video/out/opengl/hwdec_vaglx.c b/video/out/opengl/hwdec_vaglx.c
index ac817d79c4..6248a64434 100644
--- a/video/out/opengl/hwdec_vaglx.c
+++ b/video/out/opengl/hwdec_vaglx.c
@@ -181,14 +181,12 @@ static int map_frame(struct gl_hwdec *hw, struct mp_image *hw_image,
if (!p->pixmap)
return -1;
- va_lock(p->ctx);
status = vaPutSurface(p->display, va_surface_id(hw_image), p->pixmap,
0, 0, hw_image->w, hw_image->h,
0, 0, hw_image->w, hw_image->h,
NULL, 0,
va_get_colorspace_flag(hw_image->params.color.space));
CHECK_VA_STATUS(p, "vaPutSurface()");
- va_unlock(p->ctx);
*out_frame = (struct gl_hwdec_frame){
.planes = {
diff --git a/video/out/vo_vaapi.c b/video/out/vo_vaapi.c
index 4aa1ef37df..85b8159f68 100644
--- a/video/out/vo_vaapi.c
+++ b/video/out/vo_vaapi.c
@@ -205,8 +205,6 @@ static bool render_to_screen(struct priv *p, struct mp_image *mpi)
if (surface == VA_INVALID_ID)
return false;
- va_lock(p->mpvaapi);
-
for (int n = 0; n < MAX_OSD_PARTS; n++) {
struct vaapi_osd_part *part = &p->osd_parts[n];
if (part->active) {
@@ -252,8 +250,6 @@ static bool render_to_screen(struct priv *p, struct mp_image *mpi)
}
}
- va_unlock(p->mpvaapi);
-
return true;
}
@@ -424,8 +420,6 @@ static void draw_osd(struct vo *vo)
if (!p->osd_format.fourcc)
return;
- va_lock(p->mpvaapi);
-
struct mp_osd_res vid_res = osd_res_from_image_params(vo->params);
struct mp_osd_res *res;
@@ -438,8 +432,6 @@ static void draw_osd(struct vo *vo)
for (int n = 0; n < MAX_OSD_PARTS; n++)
p->osd_parts[n].active = false;
osd_draw(vo->osd, *res, pts, 0, osd_formats, draw_osd_cb, p);
-
- va_unlock(p->mpvaapi);
}
static int get_displayattribtype(const char *name)
@@ -520,9 +512,7 @@ static int set_equalizer(struct priv *p, const char *name, int value)
MP_VERBOSE(p, "Changing '%s' (range [%d, %d]) to %d\n", name,
attr->max_value, attr->min_value, attr->value);
- va_lock(p->mpvaapi);
status = vaSetDisplayAttributes(p->display, attr, 1);
- va_unlock(p->mpvaapi);
if (!CHECK_VA_STATUS(p, "vaSetDisplayAttributes()"))
return VO_FALSE;
return VO_TRUE;