Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: v4l2-ctrls: add change flag for when dimensions change

Add a new V4L2_EVENT_CTRL_CH_DIMENSIONS change flag that is issued
when the dimensions of an array change as a result of a
__v4l2_ctrl_modify_dimensions() call.

This will inform userspace that there are new dimensions.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
43cc0ec3 09752745

+9 -1
+5
Documentation/userspace-api/media/v4l/vidioc-dqevent.rst
··· 332 332 - 0x0004 333 333 - This control event was triggered because the minimum, maximum, 334 334 step or the default value of the control changed. 335 + * - ``V4L2_EVENT_CTRL_CH_DIMENSIONS`` 336 + - 0x0008 337 + - This control event was triggered because the dimensions of the 338 + control changed. Note that the number of dimensions remains the 339 + same. 335 340 336 341 337 342 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|
+1
Documentation/userspace-api/media/videodev2.h.rst.exceptions
··· 514 514 replace define V4L2_EVENT_CTRL_CH_VALUE ctrl-changes-flags 515 515 replace define V4L2_EVENT_CTRL_CH_FLAGS ctrl-changes-flags 516 516 replace define V4L2_EVENT_CTRL_CH_RANGE ctrl-changes-flags 517 + replace define V4L2_EVENT_CTRL_CH_DIMENSIONS ctrl-changes-flags 517 518 518 519 replace define V4L2_EVENT_SRC_CH_RESOLUTION src-changes-flags 519 520
+2 -1
drivers/media/v4l2-core/v4l2-ctrls-api.c
··· 1020 1020 for (i = 0; i < elems; i++) 1021 1021 ctrl->type_ops->init(ctrl, i, ctrl->p_cur); 1022 1022 cur_to_new(ctrl); 1023 - send_event(NULL, ctrl, V4L2_EVENT_CTRL_CH_VALUE); 1023 + send_event(NULL, ctrl, V4L2_EVENT_CTRL_CH_VALUE | 1024 + V4L2_EVENT_CTRL_CH_DIMENSIONS); 1024 1025 return 0; 1025 1026 } 1026 1027 EXPORT_SYMBOL(__v4l2_ctrl_modify_dimensions);
+1
include/uapi/linux/videodev2.h
··· 2435 2435 #define V4L2_EVENT_CTRL_CH_VALUE (1 << 0) 2436 2436 #define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1) 2437 2437 #define V4L2_EVENT_CTRL_CH_RANGE (1 << 2) 2438 + #define V4L2_EVENT_CTRL_CH_DIMENSIONS (1 << 3) 2438 2439 2439 2440 struct v4l2_event_ctrl { 2440 2441 __u32 changes;