OSDN Git Service

media: vb2: drop VB2_BUF_STATE_PREPARED, use bool prepared/synced instead
authorHans Verkuil <hans.verkuil@cisco.com>
Sun, 3 Jun 2018 09:02:27 +0000 (05:02 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 31 Aug 2018 15:16:10 +0000 (11:16 -0400)
commit55028695c3bbd8f202b969a5a702caa7d7a51675
treef779079ae468634929eacee087349b3e425667a8
parent559cd0a3e4848050810d125ffba36dab1e686c9d
media: vb2: drop VB2_BUF_STATE_PREPARED, use bool prepared/synced instead

The PREPARED state becomes a problem with the request API: a buffer
could be PREPARED but dequeued, or PREPARED and in state IN_REQUEST.

PREPARED is really not a state as such, but more a property of the
buffer. So make new 'prepared' and 'synced' bools instead to remember
whether the buffer is prepared and/or synced or not.

V4L2_BUF_FLAG_PREPARED is only set if the buffer is both synced and
prepared and in the DEQUEUED state.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/common/videobuf2/videobuf2-core.c
drivers/media/common/videobuf2/videobuf2-v4l2.c
include/media/videobuf2-core.h