- 31 8月, 2018 40 次提交
-
-
由 Hans Verkuil 提交于
Add support for requests to vivid. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Add support for the media_device to vivid. This is a prerequisite for request support. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Add support for requests to vim2m. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
v4l2_ctrl uses mutexes, so we can't setup a ctrl_handler in interrupt context. Switch to a workqueue instead and drop the timer. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
For mem2mem devices we have to make sure that v4l2_m2m_try_schedule() is called whenever a request is queued. We do that by creating a vb2_m2m_request_queue() helper that should be used instead of the 'normal' vb2_request_queue() helper. The m2m helper function will call v4l2_m2m_try_schedule() as needed. In addition we also avoid calling v4l2_m2m_try_schedule() when preparing or queueing a buffer for a request since that is no longer needed. Instead this helper function will do that when the request is actually queued. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Check if the vb2 queue uses requests, and if so refuse to add buffers that are not part of a request. Also check for the reverse: a vb2 queue did not use requests, and an attempt was made to queue a buffer to a request. We might relax this in the future, but for now just return -EPERM in that case. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Set the first time a buffer from a request is queued to vb2 (uses_requests) or directly queued (uses_qbuf). Cleared when the queue is canceled. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
The generic vb2_request_validate helper function checks if there are buffers in the request and if so, prepares (validates) all objects in the request. The generic vb2_request_queue helper function queues all buffer objects in the validated request. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Add a new helper function to tell if a request object is a buffer. Add a new helper function that returns true if a media_request contains at least one buffer. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
This implements the V4L2 part of the request support. The main change is that vb2_qbuf and vb2_prepare_buf now have a new media_device pointer. This required changes to several drivers that did not use the vb2_ioctl_qbuf/prepare_buf helper functions. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Buffers can now be prepared or queued for a request. A buffer is unbound from the request at vb2_buffer_done time or when the queue is cancelled. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Make vb2_buffer a request object. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
We need to initialize the request_fd field in struct vb2_v4l2_buffer to -1 instead of the default of 0. So we need to add a new op that is called when struct vb2_v4l2_buffer is allocated. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
When queuing buffers allow for passing the request that should be associated with this buffer. If V4L2_BUF_FLAG_REQUEST_FD is set, then request_fd is used as the file descriptor. If a buffer is stored in a request, but not yet queued to the driver, then V4L2_BUF_FLAG_IN_REQUEST is set. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
The PREPARED state becomes a problem with the request API: a buffer could be PREPARED but dequeued, or PREPARED and in state IN_REQUEST. PREPARED is really not a state as such, but more a property of the buffer. So make new 'prepared' and 'synced' bools instead to remember whether the buffer is prepared and/or synced or not. V4L2_BUF_FLAG_PREPARED is only set if the buffer is both synced and prepared and in the DEQUEUED state. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
There is no need to check the vb2 state in the buf_prepare callback: it can never be wrong. Since VB2_BUF_STATE_PREPARED will be removed in the next patch we'll remove this unnecessary check (and use of that state) first. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
The userspace-provided plane data needs to be stored in vb2_v4l2_buffer. Currently this information is applied by __fill_vb2_buffer() which is called by the core prepare_buf and qbuf functions, but when using requests these functions aren't called yet since the buffer won't be prepared until the media request is actually queued. In the meantime this information has to be stored somewhere and vb2_v4l2_buffer is a good place for it. The __fill_vb2_buffer callback now just copies the relevant information from vb2_v4l2_buffer into the planes array. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Replace 'if' statements by a switch in __fill_vb2_buffer() in preparation of the next patch. No other changes. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Move the __fill_v4l2_buffer() to before the vb2_queue_or_prepare_buf() function to prepare for the next two patches. No other changes. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
If a driver needs to find/inspect the controls set in a request then it can use these functions. E.g. to check if a required control is set in a request use this in the req_validate() implementation: int res = -EINVAL; hdl = v4l2_ctrl_request_hdl_find(req, parent_hdl); if (hdl) { if (v4l2_ctrl_request_hdl_ctrl_find(hdl, ctrl_id)) res = 0; v4l2_ctrl_request_hdl_put(hdl); } return res; Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
The v4l2_g/s_ext_ctrls functions now support control handlers that represent requests. The v4l2_ctrls_find_req_obj() function is responsible for finding the request from the fd. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Integrate the request support. This adds the v4l2_ctrl_request_complete and v4l2_ctrl_request_setup functions to complete a request and (as a helper function) to apply a request to the hardware. It takes care of queuing requests and correctly chaining control values in the request queue. Note that when a request is marked completed it will copy control values to the internal request state. This can be optimized in the future since this is sub-optimal when dealing with large compound and/or array controls. For the initial 'stateless codec' use-case the current implementation is sufficient. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
The next patch needs the reference to a control instead of the control itself, so change struct v4l2_ctrl_helper accordingly. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
To store request data the handler_new_ref() allocates memory for it if needed. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Embed and initialize a media_request_object in struct v4l2_ctrl_handler. Add a p_req field to struct v4l2_ctrl_ref that will store the request value. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NAlexandre Courbot <acourbot@chromium.org> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Add a 'bool from_other_dev' argument: set to true if the two handlers refer to different devices (e.g. it is true when inheriting controls from a subdev into a main v4l2 bridge driver). This will be used later when implementing support for the request API since we need to skip such controls. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NAlexandre Courbot <acourbot@chromium.org> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Alexandre Courbot 提交于
If 'which' is V4L2_CTRL_WHICH_REQUEST_VAL, then the 'request_fd' field can be used to specify a request for the G/S/TRY_EXT_CTRLS ioctls. Signed-off-by: NAlexandre Courbot <acourbot@chromium.org> Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
We need to serialize streamon/off with queueing new requests. These ioctls may trigger the cancellation of a streaming operation, and that should not be mixed with queuing a new request at the same time. Finally close() needs this lock since that too can trigger the cancellation of a streaming operation. We take the req_queue_mutex here before any other locks since it is a very high-level lock. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Add a simple helper function that tests if the driver supports the request API. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Add media_request_object_find to find a request object inside a request based on ops and priv values. Objects of the same type (vb2 buffer, control handler) will have the same ops value. And objects that refer to the same 'parent' object (e.g. the v4l2_ctrl_handler that has the current driver state) will have the same priv value. The caller has to call media_request_object_put() for the returned object since this function increments the refcount. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Add media_request_get_by_fd() to find a request based on the file descriptor. The caller has to call media_request_put() for the returned request since this function increments the refcount. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Sakari Ailus 提交于
media-request.h has been recently added; add it to the documentation build as well. Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Add initial media request support: 1) Add MEDIA_IOC_REQUEST_ALLOC ioctl support to media-device.c 2) Add struct media_request to store request objects. 3) Add struct media_request_object to represent a request object. 4) Add MEDIA_REQUEST_IOC_QUEUE/REINIT ioctl support. Basic lifecycle: the application allocates a request, adds objects to it, queues the request, polls until it is completed and can then read the final values of the objects at the time of completion. When it closes the file descriptor the request memory will be freed (actually, when the last user of that request releases the request). Drivers will bind an object to a request (the 'adds objects to it' phase), when MEDIA_REQUEST_IOC_QUEUE is called the request is validated (req_validate op), then queued (the req_queue op). When done with an object it can either be unbound from the request (e.g. when the driver has finished with a vb2 buffer) or marked as completed (e.g. for controls associated with a buffer). When all objects in the request are completed (or unbound), then the request fd will signal an exception (poll). Co-developed-by: NSakari Ailus <sakari.ailus@linux.intel.com> Co-developed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com> Co-developed-by: NAlexandre Courbot <acourbot@chromium.org> Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Define the public request API. This adds the new MEDIA_IOC_REQUEST_ALLOC ioctl to allocate a request and two ioctls that operate on a request in order to queue the contents of the request to the driver and to re-initialize the request. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Alexandre Courbot 提交于
Document the request API for V4L2 devices, and amend the documentation of system calls influenced by it. Signed-off-by: NAlexandre Courbot <acourbot@chromium.org> Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Reviewed-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
The pixelclock detection of the adv7842 is precise enough to detect if the framerate is 60 Hz or 59.94 Hz (aka "reduced fps"). Implement this detection. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Jose Abreu 提交于
Currently, cobalt driver always returns 60fps in g_parm. This patch uses the new v4l2_calc_timeperframe helper to calculate the time per frame value. Signed-off-by: NJose Abreu <joabreu@synopsys.com> Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Jose Abreu 提交于
A new helper function was introduced to facilitate the calculation of time per frame value whenever we have access to the full v4l2_dv_timings structure. This should be used only for receivers and only when there is enough accuracy in the measured pixel clock value as well as in the horizontal/vertical values. Signed-off-by: NJose Abreu <joabreu@synopsys.com> Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Jose Abreu 提交于
Add a new flag to UAPI for DV timings which, whenever set, indicates that hardware can detect the difference between regular FPS and 1000/1001 FPS. This is specific to HDMI receivers. Also, it is only valid when V4L2_DV_FL_CAN_REDUCE_FPS is set. Signed-off-by: NJose Abreu <joabreu@synopsys.com> Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-
由 Hans Verkuil 提交于
Document the new V4L2_DV_FL_CAN_DETECT_REDUCED_FPS flag and update the V4L2_DV_FL_REDUCED_FPS description since it can now also be used with receivers. Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
-