diff options
author | Stanimir Varbanov <stanimir.varbanov@linaro.org> | 2020-09-28 19:44:31 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-01-12 20:32:36 +0300 |
commit | 21560ddf782688ca7f6acbdbf4efc68fa55f353b (patch) | |
tree | 0cb7dcd906db3f8a5f6657007e9c9855e1bab4df /drivers/media/platform/qcom/venus/venc.c | |
parent | a4ca67af8b831a781ac53060c5d5c3dccaf7676e (diff) | |
download | linux-21560ddf782688ca7f6acbdbf4efc68fa55f353b.tar.xz |
media: venus: helpers: Lock outside of buffer queue helper
After adding more logic in vdec buf_queue vb2 op it is not
practical to have two lock/unlock for one decoder buf_queue.
So move the instance lock in encoder and decoder vb2 buf_queue
operations.
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform/qcom/venus/venc.c')
-rw-r--r-- | drivers/media/platform/qcom/venus/venc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index a09550cd1dba..248bae1c5e80 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -929,13 +929,22 @@ bufs_done: return ret; } +static void venc_vb2_buf_queue(struct vb2_buffer *vb) +{ + struct venus_inst *inst = vb2_get_drv_priv(vb->vb2_queue); + + mutex_lock(&inst->lock); + venus_helper_vb2_buf_queue(vb); + mutex_unlock(&inst->lock); +} + static const struct vb2_ops venc_vb2_ops = { .queue_setup = venc_queue_setup, .buf_init = venus_helper_vb2_buf_init, .buf_prepare = venus_helper_vb2_buf_prepare, .start_streaming = venc_start_streaming, .stop_streaming = venus_helper_vb2_stop_streaming, - .buf_queue = venus_helper_vb2_buf_queue, + .buf_queue = venc_vb2_buf_queue, }; static void venc_buf_done(struct venus_inst *inst, unsigned int buf_type, |