path: root/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
diff options
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>2018-11-30 03:16:17 -0500
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-12-07 08:20:40 -0500
commit22f54602526ec9d199342da43dbb304f5726ba56 (patch)
treeb7cc424059a236e3dd0b78612829f0d984c82bc0 /drivers/staging/media/sunxi/cedrus/cedrus_dec.c
parentfe8fb032732f6310888d7f765f593d1c337f7e36 (diff)
media: cedrus: Remove global IRQ spin lock from the driver
We initially introduced a spin lock to ensure that the VPU registers are not accessed concurrently between our setup function and IRQ handler. The V4L2 M2M API ensures that only one decoding job runs at a time, so the interrupt signaling the end of decoding will not occur while the next picture is being configured. Spurious interrupts are taken care of in the handler, by checking that we have a valid M2M context and a decoding status available before marking the buffers as done. In addition, holding a spin lock could be problematic if non-atomic operations are required in the setup process for future codec support. As a result, remove the global IRQ spin lock. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/staging/media/sunxi/cedrus/cedrus_dec.c')
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
index e40180a33951..6c5e310a7cf7 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c
@@ -28,7 +28,6 @@ void cedrus_device_run(void *priv)
struct cedrus_dev *dev = ctx->dev;
struct cedrus_run run = { 0 };
struct media_request *src_req;
- unsigned long flags;
run.src = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
run.dst = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
@@ -39,8 +38,6 @@ void cedrus_device_run(void *priv)
if (src_req)
v4l2_ctrl_request_setup(src_req, &ctx->hdl);
- spin_lock_irqsave(&ctx->dev->irq_lock, flags);
switch (ctx->src_fmt.pixelformat) {
run.mpeg2.slice_params = cedrus_find_control_data(ctx,
@@ -55,16 +52,10 @@ void cedrus_device_run(void *priv)
dev->dec_ops[ctx->current_codec]->setup(ctx, &run);
- spin_unlock_irqrestore(&ctx->dev->irq_lock, flags);
/* Complete request(s) controls if needed. */
if (src_req)
v4l2_ctrl_request_complete(src_req, &ctx->hdl);
- spin_lock_irqsave(&ctx->dev->irq_lock, flags);
- spin_unlock_irqrestore(&ctx->dev->irq_lock, flags);

Privacy Policy