summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
60fcc5b)
The params and stats entities have a field 'is_streaming'.
This field is not needed since the entities can have available
buffers only if they stream and therefore it is enough to
check if there are buffers available.
As a result, their start_stream callbacks can be removed since
they only set the 'is_streaming' field.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
*
* @vnode: video node
* @rkisp1: pointer to the rkisp1 device
*
* @vnode: video node
* @rkisp1: pointer to the rkisp1 device
- * @lock: locks the buffer list 'stat' and 'is_streaming'
+ * @lock: locks the buffer list 'stat'
* @stat: queue of rkisp1_buffer
* @vdev_fmt: v4l2_format of the metadata format
* @stat: queue of rkisp1_buffer
* @vdev_fmt: v4l2_format of the metadata format
- * @is_streaming: device is streaming
*/
struct rkisp1_stats {
struct rkisp1_vdev_node vnode;
struct rkisp1_device *rkisp1;
*/
struct rkisp1_stats {
struct rkisp1_vdev_node vnode;
struct rkisp1_device *rkisp1;
- spinlock_t lock; /* locks the buffers list 'stats' and 'is_streaming' */
+ spinlock_t lock; /* locks the buffers list 'stats' */
struct list_head stat;
struct v4l2_format vdev_fmt;
struct list_head stat;
struct v4l2_format vdev_fmt;
*
* @vnode: video node
* @rkisp1: pointer to the rkisp1 device
*
* @vnode: video node
* @rkisp1: pointer to the rkisp1 device
- * @config_lock: locks the buffer list 'params' and 'is_streaming'
+ * @config_lock: locks the buffer list 'params'
* @params: queue of rkisp1_buffer
* @vdev_fmt: v4l2_format of the metadata format
* @params: queue of rkisp1_buffer
* @vdev_fmt: v4l2_format of the metadata format
- * @is_streaming: device is streaming
* @quantization: the quantization configured on the isp's src pad
* @raw_type: the bayer pattern on the isp video sink pad
*/
* @quantization: the quantization configured on the isp's src pad
* @raw_type: the bayer pattern on the isp video sink pad
*/
struct rkisp1_vdev_node vnode;
struct rkisp1_device *rkisp1;
struct rkisp1_vdev_node vnode;
struct rkisp1_device *rkisp1;
- spinlock_t config_lock; /* locks the buffers list 'params' and 'is_streaming' */
+ spinlock_t config_lock; /* locks the buffers list 'params' */
struct list_head params;
struct v4l2_format vdev_fmt;
struct list_head params;
struct v4l2_format vdev_fmt;
enum v4l2_quantization quantization;
enum rkisp1_fmt_raw_pat_type raw_type;
enum v4l2_quantization quantization;
enum rkisp1_fmt_raw_pat_type raw_type;
struct rkisp1_params *params = &rkisp1->params;
spin_lock(¶ms->config_lock);
struct rkisp1_params *params = &rkisp1->params;
spin_lock(¶ms->config_lock);
- if (!params->is_streaming) {
- spin_unlock(¶ms->config_lock);
- return;
- }
rkisp1_params_apply_params_cfg(params, frame_sequence);
spin_unlock(¶ms->config_lock);
rkisp1_params_apply_params_cfg(params, frame_sequence);
spin_unlock(¶ms->config_lock);
spin_lock_irq(¶ms->config_lock);
/* apply the first buffer if there is one already */
spin_lock_irq(¶ms->config_lock);
/* apply the first buffer if there is one already */
- if (params->is_streaming)
- rkisp1_params_apply_params_cfg(params, 0);
+ rkisp1_params_apply_params_cfg(params, 0);
spin_unlock_irq(¶ms->config_lock);
}
spin_unlock_irq(¶ms->config_lock);
}
* without holding the lock
*/
spin_lock_irq(¶ms->config_lock);
* without holding the lock
*/
spin_lock_irq(¶ms->config_lock);
- params->is_streaming = false;
list_splice_init(¶ms->params, &tmp_list);
spin_unlock_irq(¶ms->config_lock);
list_splice_init(¶ms->params, &tmp_list);
spin_unlock_irq(¶ms->config_lock);
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
}
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
}
-static int
-rkisp1_params_vb2_start_streaming(struct vb2_queue *queue, unsigned int count)
-{
- struct rkisp1_params *params = queue->drv_priv;
-
- spin_lock_irq(¶ms->config_lock);
- params->is_streaming = true;
- spin_unlock_irq(¶ms->config_lock);
-
- return 0;
-}
-
static struct vb2_ops rkisp1_params_vb2_ops = {
.queue_setup = rkisp1_params_vb2_queue_setup,
.wait_prepare = vb2_ops_wait_prepare,
.wait_finish = vb2_ops_wait_finish,
.buf_queue = rkisp1_params_vb2_buf_queue,
.buf_prepare = rkisp1_params_vb2_buf_prepare,
static struct vb2_ops rkisp1_params_vb2_ops = {
.queue_setup = rkisp1_params_vb2_queue_setup,
.wait_prepare = vb2_ops_wait_prepare,
.wait_finish = vb2_ops_wait_finish,
.buf_queue = rkisp1_params_vb2_buf_queue,
.buf_prepare = rkisp1_params_vb2_buf_prepare,
- .start_streaming = rkisp1_params_vb2_start_streaming,
.stop_streaming = rkisp1_params_vb2_stop_streaming,
};
.stop_streaming = rkisp1_params_vb2_stop_streaming,
};
unsigned int i;
spin_lock_irq(&stats->lock);
unsigned int i;
spin_lock_irq(&stats->lock);
- stats->is_streaming = false;
for (i = 0; i < RKISP1_ISP_STATS_REQ_BUFS_MAX; i++) {
if (list_empty(&stats->stat))
break;
for (i = 0; i < RKISP1_ISP_STATS_REQ_BUFS_MAX; i++) {
if (list_empty(&stats->stat))
break;
spin_unlock_irq(&stats->lock);
}
spin_unlock_irq(&stats->lock);
}
-static int
-rkisp1_stats_vb2_start_streaming(struct vb2_queue *queue, unsigned int count)
-{
- struct rkisp1_stats *stats = queue->drv_priv;
-
- spin_lock_irq(&stats->lock);
- stats->is_streaming = true;
- spin_unlock_irq(&stats->lock);
-
- return 0;
-}
-
static const struct vb2_ops rkisp1_stats_vb2_ops = {
.queue_setup = rkisp1_stats_vb2_queue_setup,
.buf_queue = rkisp1_stats_vb2_buf_queue,
static const struct vb2_ops rkisp1_stats_vb2_ops = {
.queue_setup = rkisp1_stats_vb2_queue_setup,
.buf_queue = rkisp1_stats_vb2_buf_queue,
.wait_prepare = vb2_ops_wait_prepare,
.wait_finish = vb2_ops_wait_finish,
.stop_streaming = rkisp1_stats_vb2_stop_streaming,
.wait_prepare = vb2_ops_wait_prepare,
.wait_finish = vb2_ops_wait_finish,
.stop_streaming = rkisp1_stats_vb2_stop_streaming,
- .start_streaming = rkisp1_stats_vb2_start_streaming,
if (isp_mis_tmp & RKISP1_STATS_MEAS_MASK)
rkisp1->debug.stats_error++;
if (isp_mis_tmp & RKISP1_STATS_MEAS_MASK)
rkisp1->debug.stats_error++;
- if (!stats->is_streaming)
- goto unlock;
if (isp_ris & RKISP1_STATS_MEAS_MASK)
rkisp1_stats_send_measurement(stats, isp_ris);
if (isp_ris & RKISP1_STATS_MEAS_MASK)
rkisp1_stats_send_measurement(stats, isp_ris);
spin_unlock(&stats->lock);
}
spin_unlock(&stats->lock);
}