Loading drivers/staging/android/ion/msm/msm_ion.c +22 −3 Original line number Diff line number Diff line Loading @@ -301,13 +301,23 @@ static int ion_pages_cache_ops( }; for_each_sg(table->sgl, sg, table->nents, i) { unsigned int sg_offset, sg_left, size = 0; len += sg->length; if (len < offset) if (len <= offset) continue; __do_cache_ops(sg_page(sg), sg->offset, sg->length, op); sg_left = len - offset; sg_offset = sg->length - sg_left; size = (length < sg_left) ? length : sg_left; __do_cache_ops(sg_page(sg), sg_offset, size, op); offset += size; length -= size; if (len > length + offset) if (length == 0) break; } return 0; Loading Loading @@ -356,6 +366,15 @@ int msm_ion_do_cache_op(struct ion_client *client, struct ion_handle *handle, } EXPORT_SYMBOL(msm_ion_do_cache_op); int msm_ion_do_cache_offset_op( struct ion_client *client, struct ion_handle *handle, void *vaddr, unsigned int offset, unsigned long len, unsigned int cmd) { return ion_do_cache_op(client, handle, vaddr, offset, len, cmd); } EXPORT_SYMBOL(msm_ion_do_cache_offset_op); static void msm_ion_allocate(struct ion_platform_heap *heap) { if (!heap->base && heap->extra_data) { Loading drivers/staging/android/ion/msm/msm_ion.h +13 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,11 @@ int ion_handle_get_size(struct ion_client *client, struct ion_handle *handle, int msm_ion_do_cache_op(struct ion_client *client, struct ion_handle *handle, void *vaddr, unsigned long len, unsigned int cmd); int msm_ion_do_cache_offset_op( struct ion_client *client, struct ion_handle *handle, void *vaddr, unsigned int offset, unsigned long len, unsigned int cmd); #else static inline struct ion_client *msm_ion_client_create(const char *name) { Loading @@ -187,6 +192,14 @@ static inline int msm_ion_do_cache_op( return -ENODEV; } int msm_ion_do_cache_offset_op( struct ion_client *client, struct ion_handle *handle, void *vaddr, unsigned int offset, unsigned long len, unsigned int cmd) { return -ENODEV; } #endif /* CONFIG_ION */ #endif Loading
drivers/staging/android/ion/msm/msm_ion.c +22 −3 Original line number Diff line number Diff line Loading @@ -301,13 +301,23 @@ static int ion_pages_cache_ops( }; for_each_sg(table->sgl, sg, table->nents, i) { unsigned int sg_offset, sg_left, size = 0; len += sg->length; if (len < offset) if (len <= offset) continue; __do_cache_ops(sg_page(sg), sg->offset, sg->length, op); sg_left = len - offset; sg_offset = sg->length - sg_left; size = (length < sg_left) ? length : sg_left; __do_cache_ops(sg_page(sg), sg_offset, size, op); offset += size; length -= size; if (len > length + offset) if (length == 0) break; } return 0; Loading Loading @@ -356,6 +366,15 @@ int msm_ion_do_cache_op(struct ion_client *client, struct ion_handle *handle, } EXPORT_SYMBOL(msm_ion_do_cache_op); int msm_ion_do_cache_offset_op( struct ion_client *client, struct ion_handle *handle, void *vaddr, unsigned int offset, unsigned long len, unsigned int cmd) { return ion_do_cache_op(client, handle, vaddr, offset, len, cmd); } EXPORT_SYMBOL(msm_ion_do_cache_offset_op); static void msm_ion_allocate(struct ion_platform_heap *heap) { if (!heap->base && heap->extra_data) { Loading
drivers/staging/android/ion/msm/msm_ion.h +13 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,11 @@ int ion_handle_get_size(struct ion_client *client, struct ion_handle *handle, int msm_ion_do_cache_op(struct ion_client *client, struct ion_handle *handle, void *vaddr, unsigned long len, unsigned int cmd); int msm_ion_do_cache_offset_op( struct ion_client *client, struct ion_handle *handle, void *vaddr, unsigned int offset, unsigned long len, unsigned int cmd); #else static inline struct ion_client *msm_ion_client_create(const char *name) { Loading @@ -187,6 +192,14 @@ static inline int msm_ion_do_cache_op( return -ENODEV; } int msm_ion_do_cache_offset_op( struct ion_client *client, struct ion_handle *handle, void *vaddr, unsigned int offset, unsigned long len, unsigned int cmd) { return -ENODEV; } #endif /* CONFIG_ION */ #endif