//struct sg_table *sgt;
dma_addr_t *paddr;
unsigned int i;
+ buffer->sizeimage = 0;
if (video->is_mp) {
for (i = 0; i < fmt_mp->num_planes; i++) {
paddr = vb2_plane_cookie(vb, i);
buffer->addr[i] = *paddr;
+ buffer->sizeimage += vb2_plane_size(vb, i);
}
if (fmt_mp->num_planes == 1
fmt_mp->height;
} else {
paddr = vb2_plane_cookie(vb, 0);
+ buffer->sizeimage = vb2_plane_size(vb, 0);
buffer->addr[0] = *paddr;
if (fmt->pixelformat == V4L2_PIX_FMT_NV12
|| fmt->pixelformat == V4L2_PIX_FMT_NV21
}
}
+extern void sifive_l2_flush64_range(unsigned long start, unsigned long len);
static void vin_buffer_done(struct vin_line *line, struct vin_params *params)
{
struct stfcamss_buffer *ready_buf;
while ((ready_buf = vin_buf_get_ready(output))) {
ready_buf->vb.vb2_buf.timestamp = ts;
ready_buf->vb.sequence = output->sequence++;
+
+ /* The stf_isp_ctrl currently buffered with mmap,
+ * which will not update cache by default.
+ * Flush L2 cache to make sure data is updated.
+ */
+ if (ready_buf->vb.vb2_buf.memory == VB2_MEMORY_MMAP)
+ sifive_l2_flush64_range(ready_buf->addr[0], ready_buf->sizeimage);
+
vb2_buffer_done(&ready_buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
}