v4l: vsp1: Extend vsp1_du_atomic_flush to return frame index
We need to be able to identify the frame sequences that we have queued,
vs the frames that have completed. Return a sequence number to the
caller of vsp1_du_atomic_flush() such that it can be compared with the
completion sequence number
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c
index 8dd26a0..fa37858 100644
--- a/drivers/media/platform/vsp1/vsp1_drm.c
+++ b/drivers/media/platform/vsp1/vsp1_drm.c
@@ -456,7 +456,7 @@ static unsigned int rpf_zpos(struct vsp1_device *vsp1, struct vsp1_rwpf *rpf)
* vsp1_du_atomic_flush - Commit an atomic update
* @dev: the VSP device
*/
-void vsp1_du_atomic_flush(struct device *dev)
+unsigned int vsp1_du_atomic_flush(struct device *dev)
{
struct vsp1_device *vsp1 = dev_get_drvdata(dev);
struct vsp1_pipeline *pipe = &vsp1->drm->pipe;
@@ -554,6 +554,8 @@ void vsp1_du_atomic_flush(struct device *dev)
vsp1_write(vsp1, VI6_DISP_IRQ_ENB, 0);
vsp1_pipeline_stop(pipe);
}
+
+ return vsp1->drm->pending;
}
EXPORT_SYMBOL_GPL(vsp1_du_atomic_flush);
diff --git a/include/media/vsp1.h b/include/media/vsp1.h
index d5b9663..cd4c43f 100644
--- a/include/media/vsp1.h
+++ b/include/media/vsp1.h
@@ -40,6 +40,6 @@ struct vsp1_du_atomic_config {
void vsp1_du_atomic_begin(struct device *dev);
int vsp1_du_atomic_update(struct device *dev, unsigned int rpf,
const struct vsp1_du_atomic_config *cfg);
-void vsp1_du_atomic_flush(struct device *dev);
+unsigned int vsp1_du_atomic_flush(struct device *dev);
#endif /* __MEDIA_VSP1_H__ */