media: v4l2-ctrl: Fix flags field on Control events 75/175675/1
authorRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Tue, 17 Oct 2017 15:48:50 +0000 (11:48 -0400)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 11 Apr 2018 09:34:04 +0000 (18:34 +0900)
commit2cfc5a0c49ce08588441dc7fec209e1c10944721
tree9d7eca4f425e5185d2c71f908e9e9edb7edc92df
parent0e981864143f423df67d7404bf933643540c43f2
media: v4l2-ctrl: Fix flags field on Control events

commit 9cac9d2fb2fe0e0cadacdb94415b3fe49e3f724f upstream.

VIDIOC_DQEVENT and VIDIOC_QUERY_EXT_CTRL should give the same output for
the control flags field.

This patch creates a new function user_flags(), that calculates the user
exported flags value (which is different than the kernel internal flags
structure). This function is then used by all the code that exports the
internal flags to userspace.

Reported-by: Dimitrios Katsaros <patcherwork@gmail.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[sw0312.kim: cherry-pick from linux-3.18.y]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I7ce4c954bdf559e7cf60816202e4fb1f2fa2ad90
drivers/media/v4l2-core/v4l2-ctrls.c