@@ -490,7 +490,7 @@ class ion_allocator
490
490
int alloc (size_t size, struct ion_memory * mem);
491
491
int free (struct ion_memory * mem);
492
492
493
- int flush (struct ion_memory * mem);
493
+ int flush (struct ion_memory * mem, int offset, int size );
494
494
495
495
public:
496
496
int ion_fd;
@@ -643,11 +643,11 @@ int ion_allocator::free(struct ion_memory* mem)
643
643
return ret;
644
644
}
645
645
646
- int ion_allocator::flush (struct ion_memory * mem)
646
+ int ion_allocator::flush (struct ion_memory * mem, int offset, int size )
647
647
{
648
648
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;
651
651
if (ioctl (ion_fd, ION_IOC_SUNXI_FLUSH_RANGE, (void *)&range))
652
652
{
653
653
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)
1469
1469
fprintf (stderr, " ioctl G2D_CMD_BITBLT_H failed %d %s\n " , errno, strerror (errno));
1470
1470
}
1471
1471
1472
- ion.flush (&bgr_ion);
1472
+ ion.flush (&bgr_ion, 0 , output_width * output_height * 3 );
1473
1473
1474
1474
// copy to bgrdata
1475
1475
memcpy (bgrdata, (const unsigned char *)bgr_ion.virt_addr , output_width * output_height * 3 );
0 commit comments