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

Commit 80730093 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cma: Add support for cma_get_size"

parents ac263b32 9ccb66aa
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -563,6 +563,13 @@ phys_addr_t cma_get_base(struct device *dev)
	return cma->base_pfn << PAGE_SHIFT;
}

unsigned long cma_get_size(struct device *dev)
{
	struct cma *cma = dev_get_cma_area(dev);

	return cma->count << PAGE_SHIFT;
}

static void clear_cma_bitmap(struct cma *cma, unsigned long pfn, int count)
{
	mutex_lock(&cma->lock);
+2 −1
Original line number Diff line number Diff line
@@ -66,13 +66,14 @@ static int msm_shared_heap_populate_base_and_size
	if (pnode != NULL) {
		const u32 *addr;
		u64 len;

		addr = of_get_address(pnode, 0, &len, NULL);
		if (!addr) {
			of_node_put(pnode);
			ret = -EINVAL;
			goto out;
		}
		*size = (size_t)len;
		*size = cma_get_size(priv);
		*base = cma_get_base(priv);
		of_node_put(pnode);
	} else {
+6 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ struct device;


phys_addr_t cma_get_base(struct device *dev);
unsigned long cma_get_size(struct device *dev);

extern struct cma *dma_contiguous_def_area;

@@ -154,6 +155,11 @@ static inline phys_addr_t cma_get_base(struct device *dev)
	return 0;
}

static inline unsigned long cma_get_size(struct device *dev)
{
	return 0;
}

#endif

#endif