OSDN Git Service

media: ti-vpe: cal: Set cal_dmaqueue.pending to NULL when no pending buffer
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sun, 6 Dec 2020 23:53:50 +0000 (00:53 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 4 Jan 2021 11:13:09 +0000 (12:13 +0100)
commit2e2279b53a9f48b6bab045a41096dbd781020cdd
tree6ea3a865232b7ff02c6d092fa14ec60e1aef3ae7
parentca4fec54f6ba0825532ac21698cf2b7324d02737
media: ti-vpe: cal: Set cal_dmaqueue.pending to NULL when no pending buffer

When a pending buffer becomes active, the cal_dmaqueue.active field is
updated, but the pending field keeps the same value until a new buffer
becomes pending. This requires handling the special case of
pending == active in different places. Simplify the code by setting the
pending field to NULL when the pending buffer becomes active. Buffers
are now simply moved from queue to pending and from pending to active.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/ti-vpe/cal-video.c
drivers/media/platform/ti-vpe/cal.c