diff options
Diffstat (limited to 'drivers/media/platform/vsp1/vsp1_video.c')
-rw-r--r-- | drivers/media/platform/vsp1/vsp1_video.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c index 4b0ac07af662..b4687a834f85 100644 --- a/drivers/media/platform/vsp1/vsp1_video.c +++ b/drivers/media/platform/vsp1/vsp1_video.c | |||
@@ -488,11 +488,17 @@ static bool vsp1_pipeline_ready(struct vsp1_pipeline *pipe) | |||
488 | * This function completes the current buffer by filling its sequence number, | 488 | * This function completes the current buffer by filling its sequence number, |
489 | * time stamp and payload size, and hands it back to the videobuf core. | 489 | * time stamp and payload size, and hands it back to the videobuf core. |
490 | * | 490 | * |
491 | * When operating in DU output mode (deep pipeline to the DU through the LIF), | ||
492 | * the VSP1 needs to constantly supply frames to the display. In that case, if | ||
493 | * no other buffer is queued, reuse the one that has just been processed instead | ||
494 | * of handing it back to the videobuf core. | ||
495 | * | ||
491 | * Return the next queued buffer or NULL if the queue is empty. | 496 | * Return the next queued buffer or NULL if the queue is empty. |
492 | */ | 497 | */ |
493 | static struct vsp1_video_buffer * | 498 | static struct vsp1_video_buffer * |
494 | vsp1_video_complete_buffer(struct vsp1_video *video) | 499 | vsp1_video_complete_buffer(struct vsp1_video *video) |
495 | { | 500 | { |
501 | struct vsp1_pipeline *pipe = to_vsp1_pipeline(&video->video.entity); | ||
496 | struct vsp1_video_buffer *next = NULL; | 502 | struct vsp1_video_buffer *next = NULL; |
497 | struct vsp1_video_buffer *done; | 503 | struct vsp1_video_buffer *done; |
498 | unsigned long flags; | 504 | unsigned long flags; |
@@ -507,6 +513,13 @@ vsp1_video_complete_buffer(struct vsp1_video *video) | |||
507 | 513 | ||
508 | done = list_first_entry(&video->irqqueue, | 514 | done = list_first_entry(&video->irqqueue, |
509 | struct vsp1_video_buffer, queue); | 515 | struct vsp1_video_buffer, queue); |
516 | |||
517 | /* In DU output mode reuse the buffer if the list is singular. */ | ||
518 | if (pipe->lif && list_is_singular(&video->irqqueue)) { | ||
519 | spin_unlock_irqrestore(&video->irqlock, flags); | ||
520 | return done; | ||
521 | } | ||
522 | |||
510 | list_del(&done->queue); | 523 | list_del(&done->queue); |
511 | 524 | ||
512 | if (!list_empty(&video->irqqueue)) | 525 | if (!list_empty(&video->irqqueue)) |