[media] v4l: vsp1: Support runtime modification of controls
[deliverable/linux.git] / drivers / media / platform / vsp1 / vsp1_video.c
index a9aec5c0bec68cab3172ec912997ce723b75d46b..01654232b695382d91b2281986ee1cf010838ce6 100644 (file)
@@ -219,7 +219,7 @@ vsp1_video_complete_buffer(struct vsp1_video *video)
 
        spin_unlock_irqrestore(&video->irqlock, flags);
 
-       done->buf.sequence = video->sequence++;
+       done->buf.sequence = pipe->sequence;
        done->buf.vb2_buf.timestamp = ktime_get_ns();
        for (i = 0; i < done->buf.vb2_buf.num_planes; ++i)
                vb2_set_plane_payload(&done->buf.vb2_buf, i,
@@ -251,11 +251,17 @@ static void vsp1_video_frame_end(struct vsp1_pipeline *pipe,
 static void vsp1_video_pipeline_run(struct vsp1_pipeline *pipe)
 {
        struct vsp1_device *vsp1 = pipe->output->entity.vsp1;
+       struct vsp1_entity *entity;
        unsigned int i;
 
        if (!pipe->dl)
                pipe->dl = vsp1_dl_list_get(pipe->output->dlm);
 
+       list_for_each_entry(entity, &pipe->entities, list_pipe) {
+               if (entity->ops->configure)
+                       entity->ops->configure(entity, pipe, pipe->dl, false);
+       }
+
        for (i = 0; i < vsp1->info->rpf_count; ++i) {
                struct vsp1_rwpf *rwpf = pipe->inputs[i];
 
@@ -632,7 +638,7 @@ static int vsp1_video_setup_pipeline(struct vsp1_pipeline *pipe)
                vsp1_entity_route_setup(entity, pipe->dl);
 
                if (entity->ops->configure)
-                       entity->ops->configure(entity, pipe, pipe->dl);
+                       entity->ops->configure(entity, pipe, pipe->dl, true);
        }
 
        return 0;
@@ -674,7 +680,7 @@ static void vsp1_video_stop_streaming(struct vb2_queue *vq)
        int ret;
 
        mutex_lock(&pipe->lock);
-       if (--pipe->stream_count == 0) {
+       if (--pipe->stream_count == pipe->num_inputs) {
                /* Stop the pipeline. */
                ret = vsp1_pipeline_stop(pipe);
                if (ret == -ETIMEDOUT)
@@ -696,7 +702,7 @@ static void vsp1_video_stop_streaming(struct vb2_queue *vq)
        spin_unlock_irqrestore(&video->irqlock, flags);
 }
 
-static struct vb2_ops vsp1_video_queue_qops = {
+static const struct vb2_ops vsp1_video_queue_qops = {
        .queue_setup = vsp1_video_queue_setup,
        .buf_prepare = vsp1_video_buffer_prepare,
        .buf_queue = vsp1_video_buffer_queue,
@@ -805,8 +811,6 @@ vsp1_video_streamon(struct file *file, void *fh, enum v4l2_buf_type type)
        if (video->queue.owner && video->queue.owner != file->private_data)
                return -EBUSY;
 
-       video->sequence = 0;
-
        /* Get a pipeline for the video node and start streaming on it. No link
         * touching an entity in the pipeline can be activated or deactivated
         * once streaming is started.
@@ -915,7 +919,7 @@ static int vsp1_video_release(struct file *file)
        return 0;
 }
 
-static struct v4l2_file_operations vsp1_video_fops = {
+static const struct v4l2_file_operations vsp1_video_fops = {
        .owner = THIS_MODULE,
        .unlocked_ioctl = video_ioctl2,
        .open = vsp1_video_open,
This page took 0.064357 seconds and 5 git commands to generate.