From: Alexandre Courbot <acourbot@chromium.org>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil@xs4all.nl>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Pawel Osciak <posciak@chromium.org>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Tomasz Figa <tfiga@chromium.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Hans Verkuil <hans.verkuil@cisco.com>,
Alexandre Courbot <acourbot@chromium.org>
Subject: [RFCv2 07/17] v4l2-ctrls: prepare internal structs for request API
Date: Wed, 31 Jan 2018 19:24:25 +0900 [thread overview]
Message-ID: <20180131102427.207721-8-acourbot@chromium.org> (raw)
In-Reply-To: <20180131102427.207721-1-acourbot@chromium.org>
From: Hans Verkuil <hans.verkuil@cisco.com>
Add a refcount and is_request bool to struct v4l2_ctrl_handler:
this is used to refcount a handler that represents a request.
Add a p_req field to struct v4l2_ctrl_ref that will store the
request value.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
---
drivers/media/v4l2-core/v4l2-ctrls.c | 1 +
include/media/v4l2-ctrls.h | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index 54444e3b8883..9d99679b543c 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -1751,6 +1751,7 @@ int v4l2_ctrl_handler_init_class(struct v4l2_ctrl_handler *hdl,
sizeof(hdl->buckets[0]),
GFP_KERNEL | __GFP_ZERO);
hdl->error = hdl->buckets ? 0 : -ENOMEM;
+ hdl->is_request = false;
return hdl->error;
}
EXPORT_SYMBOL(v4l2_ctrl_handler_init_class);
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index a762f3392d90..a215f25a82cf 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -18,6 +18,7 @@
#define _V4L2_CTRLS_H
#include <linux/list.h>
+#include <linux/kref.h>
#include <linux/mutex.h>
#include <linux/videodev2.h>
@@ -250,6 +251,7 @@ struct v4l2_ctrl_ref {
struct v4l2_ctrl_ref *next;
struct v4l2_ctrl *ctrl;
struct v4l2_ctrl_helper *helper;
+ union v4l2_ctrl_ptr p_req;
bool from_other_dev;
};
@@ -285,7 +287,9 @@ struct v4l2_ctrl_handler {
v4l2_ctrl_notify_fnc notify;
void *notify_priv;
u16 nr_of_buckets;
+ bool is_request;
int error;
+ struct kref ref;
};
/**
--
2.16.0.rc1.238.g530d649a79-goog
next prev parent reply other threads:[~2018-01-31 10:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-31 10:24 [RFCv2 00/17] Request API, take three Alexandre Courbot
2018-01-31 10:24 ` [RFCv2 01/17] media: add request API core and UAPI Alexandre Courbot
2018-01-31 10:24 ` [RFCv2 02/17] videodev2.h: Add request_fd field to v4l2_buffer Alexandre Courbot
2018-02-04 22:16 ` Sakari Ailus
2018-01-31 10:24 ` [RFCv2 03/17] media: videobuf2: add support for requests Alexandre Courbot
2018-01-31 10:24 ` [RFCv2 04/17] media: vb2: add support for requests in QBUF ioctl Alexandre Courbot
2018-01-31 10:24 ` [RFCv2 05/17] media: Document the media request API Alexandre Courbot
2018-02-01 18:14 ` Randy Dunlap
2018-02-02 6:02 ` Alexandre Courbot
2018-01-31 10:24 ` [RFCv2 06/17] v4l2-ctrls: v4l2_ctrl_add_handler: add from_other_dev Alexandre Courbot
2018-01-31 10:24 ` Alexandre Courbot [this message]
2018-01-31 10:24 ` [RFCv2 08/17] v4l2-ctrls: add core request API Alexandre Courbot
2018-01-31 10:24 ` [RFCv2 09/17] v4l2-ctrls: use ref in helper instead of ctrl Alexandre Courbot
2018-02-02 12:09 ` [RFCv2 00/17] Request API, take three Sakari Ailus
2018-02-06 9:49 ` Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180131102427.207721-8-acourbot@chromium.org \
--to=acourbot@chromium.org \
--cc=gustavo.padovan@collabora.com \
--cc=hans.verkuil@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mchehab@kernel.org \
--cc=posciak@chromium.org \
--cc=sakari.ailus@linux.intel.com \
--cc=tfiga@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®