]> git.baikalelectronics.ru Git - kernel.git/commit
[media] v4l2-event: fix regression with initial event handling
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 7 May 2012 19:53:20 +0000 (16:53 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 15 May 2012 11:43:06 +0000 (08:43 -0300)
commit1fa887ec97fd04f32e026dcba2e7595485e38e4f
tree479d1c19b79849098e35b6e2f604794541f0fe0b
parent4f4bd4144f866705fdce1dfb6e797bd5a2679e1b
[media] v4l2-event: fix regression with initial event handling

If the V4L2_EVENT_SUB_FL_SEND_INITIAL was set, then the application expects
to receive an initial event of the initial value of the control.

However, commit 20b3aa42c7f24f6f0f035e2defd2cfba01c92eae that added the new
v4l2_subscribed_event_ops introduced a regression: while the code still queued
that initial event the __v4l2_event_queue_fh() function was modified to ignore
such requests if sev->elems was 0 (meaning that the event subscription wasn't
finished yet).

And sev->elems was only set to a non-zero value after the add operation
returned.

This patch fixes this by passing the elems value to the add function. Then the
add function can set it before queuing the initial event.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/uvc/uvc_ctrl.c
drivers/media/video/v4l2-ctrls.c
drivers/media/video/v4l2-event.c
include/media/v4l2-event.h