Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0cbb06d authored by Isaac J. Manjarres's avatar Isaac J. Manjarres
Browse files

staging: android: ion: Use the MSM dmabuf ops when possible



Use the MSM dmabuf operations for cache maintenance on ION
buffers if they are present. Otherwise, fallback to the
default ION dmabuf operations.

Change-Id: I56e7eabb2614a958aca11c9c1fa4ecd5415ce96a
Signed-off-by: default avatarIsaac J. Manjarres <isaacm@codeaurora.org>
parent a876bf5e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include <linux/vmalloc.h>

#include "ion.h"
#include "msm_ion_priv.h"

static struct ion_device *internal_dev;

@@ -427,7 +428,11 @@ static struct dma_buf *ion_alloc_dmabuf(size_t len, unsigned int heap_id_mask,
	if (IS_ERR(buffer))
		return ERR_CAST(buffer);

#if IS_ENABLED(CONFIG_ION_MSM_HEAPS)
	exp_info.ops = &msm_ion_dma_buf_ops;
#else
	exp_info.ops = &dma_buf_ops;
#endif
	exp_info.size = buffer->size;
	exp_info.flags = O_RDWR;
	exp_info.priv = buffer;