linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Add v4l2_ctrl_request_create()
@ 2020-07-28  9:48 Hans Verkuil
  2020-07-28  9:48 ` [RFC PATCH 1/2] v4l2-ctrls.c: add v4l2_ctrl_request_create Hans Verkuil
  2020-07-28  9:48 ` [RFC PATCH 2/2] vivid: call v4l2_ctrl_request_create() Hans Verkuil
  0 siblings, 2 replies; 5+ messages in thread
From: Hans Verkuil @ 2020-07-28  9:48 UTC (permalink / raw)
  To: linux-media; +Cc: Yunfei Dong

The Request API is missing a feature: if userspace did not set any controls,
then the request object will not contain a control object (that's created
only if the user sets a control in the request).

This is fine for e.g. stateless codecs since they require that each request
contains controls, so this is always done. And this is also the reason that
this hasn't been a problem before, since the Request API is almost exclusively
used by stateless codecs.

But for e.g. vivid this means that the completed request does not contain
any controls in the request containing the control values at the time that
the frame was captured (or output).

In addition, if a driver needs to set a status control, then that control
won't be part of the request either.

This RFC series adds a v4l2_ctrl_request_create() function that can be
called in the req_validate() callback of the request. If the request
doesn't contain a control object, then it will add a new one.

This is an RFC for now. Hopefully this will help Yunfei Dong with the
development of Read-Only Requests, since that should be a lot simpler with
this new function.

Also, I am not entirely happy with the name of the function and I also
think that we might need a helper in v4l2-common.c that combines with
function with vb2_request_validate(), thus avoiding that drivers need
to remember to call both v4l2_ctrl_request_create() and vb2_request_validate().

Regards,

	Hans

Hans Verkuil (2):
  v4l2-ctrls.c: add v4l2_ctrl_request_create
  vivid: call v4l2_ctrl_request_create()

 drivers/media/mc/mc-request.c                 |  3 +-
 drivers/media/test-drivers/vivid/vivid-core.c |  4 +++
 drivers/media/v4l2-core/v4l2-ctrls.c          | 35 +++++++++++++++++++
 include/media/v4l2-ctrls.h                    | 16 +++++++++
 4 files changed, 57 insertions(+), 1 deletion(-)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-18 11:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28  9:48 [RFC PATCH 0/2] Add v4l2_ctrl_request_create() Hans Verkuil
2020-07-28  9:48 ` [RFC PATCH 1/2] v4l2-ctrls.c: add v4l2_ctrl_request_create Hans Verkuil
2020-08-18 11:30   ` Stanimir Varbanov
2020-08-18 11:39     ` Hans Verkuil
2020-07-28  9:48 ` [RFC PATCH 2/2] vivid: call v4l2_ctrl_request_create() Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).