Skip to content

Commit 64c5293

Browse files
naushirpopcornmix
authored andcommitted
drivers: media: pisp_be: Update seqeuence numbers of the buffers
Add a framebuffer sequence counter and increment on every completed job. This counter is then used to update the VB2 buffer sequence count before calling vb2_buffer_done(). Signed-off-by: Naushir Patuck <[email protected]>
1 parent 47ee2b8 commit 64c5293

File tree

1 file changed

+5
-0
lines changed
  • drivers/media/platform/raspberrypi/pisp_be

1 file changed

+5
-0
lines changed

drivers/media/platform/raspberrypi/pisp_be/pisp_be.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ struct pispbe_node_group {
203203
struct media_pad pad[PISPBE_NUM_NODES]; /* output pads first */
204204
struct pisp_be_tiles_config *config;
205205
dma_addr_t config_dma_addr;
206+
unsigned int sequence;
206207
};
207208

208209
/* Records details of the jobs currently running or queued on the h/w. */
@@ -703,10 +704,13 @@ static void pispbe_isr_jobdone(struct pispbe_dev *pispbe,
703704
for (i = 0; i < PISPBE_NUM_NODES; i++) {
704705
if (buf[i]) {
705706
buf[i]->vb.vb2_buf.timestamp = ts;
707+
buf[i]->vb.sequence = job->node_group->sequence;
706708
vb2_buffer_done(&buf[i]->vb.vb2_buf,
707709
VB2_BUF_STATE_DONE);
708710
}
709711
}
712+
713+
job->node_group->sequence++;
710714
}
711715

712716
static irqreturn_t pispbe_isr(int irq, void *dev)
@@ -962,6 +966,7 @@ static int pispbe_node_start_streaming(struct vb2_queue *q, unsigned int count)
962966

963967
spin_lock_irqsave(&pispbe->hw_lock, flags);
964968
node->node_group->streaming_map |= BIT(node->id);
969+
node->node_group->sequence = 0;
965970
spin_unlock_irqrestore(&pispbe->hw_lock, flags);
966971

967972
dev_dbg(pispbe->dev, "%s: for node %s (count %u)\n",

0 commit comments

Comments
 (0)