@@ -490,7 +490,7 @@ class ion_allocator
490490 int alloc (size_t size, struct ion_memory * mem);
491491 int free (struct ion_memory * mem);
492492
493- int flush (struct ion_memory * mem);
493+ int flush (struct ion_memory * mem, int offset, int size );
494494
495495public:
496496 int ion_fd;
@@ -643,11 +643,11 @@ int ion_allocator::free(struct ion_memory* mem)
643643 return ret;
644644}
645645
646- int ion_allocator::flush (struct ion_memory * mem)
646+ int ion_allocator::flush (struct ion_memory * mem, int offset, int size )
647647{
648648 struct sunxi_cache_range range;
649- range.start = (long )mem->virt_addr ;
650- range.end = range.start + mem-> size ;
649+ range.start = (long )mem->virt_addr + offset ;
650+ range.end = range.start + size;
651651 if (ioctl (ion_fd, ION_IOC_SUNXI_FLUSH_RANGE, (void *)&range))
652652 {
653653 fprintf (stderr, " ioctl ION_IOC_SUNXI_FLUSH_RANGE failed %d %s\n " , errno, strerror (errno));
@@ -1469,7 +1469,7 @@ int capture_v4l2_aw_isp_impl::read_frame(unsigned char* bgrdata)
14691469 fprintf (stderr, " ioctl G2D_CMD_BITBLT_H failed %d %s\n " , errno, strerror (errno));
14701470 }
14711471
1472- ion.flush (&bgr_ion);
1472+ ion.flush (&bgr_ion, 0 , output_width * output_height * 3 );
14731473
14741474 // copy to bgrdata
14751475 memcpy (bgrdata, (const unsigned char *)bgr_ion.virt_addr , output_width * output_height * 3 );
0 commit comments