mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-08 19:09:57 +00:00
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 <naush@raspberrypi.com>
This commit is contained in:
committed by
Phil Elwell
parent
1023dcfccd
commit
f74893f8a0
@@ -203,6 +203,7 @@ struct pispbe_node_group {
|
|||||||
struct media_pad pad[PISPBE_NUM_NODES]; /* output pads first */
|
struct media_pad pad[PISPBE_NUM_NODES]; /* output pads first */
|
||||||
struct pisp_be_tiles_config *config;
|
struct pisp_be_tiles_config *config;
|
||||||
dma_addr_t config_dma_addr;
|
dma_addr_t config_dma_addr;
|
||||||
|
unsigned int sequence;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Records details of the jobs currently running or queued on the h/w. */
|
/* 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,
|
|||||||
for (i = 0; i < PISPBE_NUM_NODES; i++) {
|
for (i = 0; i < PISPBE_NUM_NODES; i++) {
|
||||||
if (buf[i]) {
|
if (buf[i]) {
|
||||||
buf[i]->vb.vb2_buf.timestamp = ts;
|
buf[i]->vb.vb2_buf.timestamp = ts;
|
||||||
|
buf[i]->vb.sequence = job->node_group->sequence;
|
||||||
vb2_buffer_done(&buf[i]->vb.vb2_buf,
|
vb2_buffer_done(&buf[i]->vb.vb2_buf,
|
||||||
VB2_BUF_STATE_DONE);
|
VB2_BUF_STATE_DONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
job->node_group->sequence++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static irqreturn_t pispbe_isr(int irq, void *dev)
|
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)
|
|||||||
|
|
||||||
spin_lock_irqsave(&pispbe->hw_lock, flags);
|
spin_lock_irqsave(&pispbe->hw_lock, flags);
|
||||||
node->node_group->streaming_map |= BIT(node->id);
|
node->node_group->streaming_map |= BIT(node->id);
|
||||||
|
node->node_group->sequence = 0;
|
||||||
spin_unlock_irqrestore(&pispbe->hw_lock, flags);
|
spin_unlock_irqrestore(&pispbe->hw_lock, flags);
|
||||||
|
|
||||||
dev_dbg(pispbe->dev, "%s: for node %s (count %u)\n",
|
dev_dbg(pispbe->dev, "%s: for node %s (count %u)\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user