diff options
author | Ming Qian <ming.qian@nxp.com> | 2022-08-12 15:22:09 +0800 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2022-09-30 16:43:53 +0200 |
commit | df71c6e4d5e54a79a772c3f8a3676ab6bf169c46 (patch) | |
tree | 820220ae5b9d82b9b2bee2a6927c4c8d4238b4c8 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |
parent | ccc9f1db9c6b06205f35d4dcbd19a9cb16a25d03 (diff) |
media: imx-jpeg: Lock on ioctl encoder/decoder stop cmd
the ioctl encoder/decoder cmd is under queue lock,
and buf_done is in the irq, it can't be locked with the mutex,
they are not synchronized.
when v4l2_update_last_buf_state is called to
handle the encoder/decoder stop cmd,
the last src buffer may be done at the same time.
so it's possible that last_src_buf is set,
but the output rdy_queue is empty,
then driver won't mark it stopped,
as v4l2_m2m_is_last_draining_src_buf() will always return false and
v4l2_m2m_dst_buf_is_last() return false too.
In this case, the drain will be blocked.
add the hw lock around the ioctl encoder/decoder cmd,
to synchronize with the buf_done.
Fixes: 4911c5acf935 ("media: imx-jpeg: Implement drain using v4l2-mem2mem helpers")
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
0 files changed, 0 insertions, 0 deletions