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

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

Merge "msm: mdss: use vmalloc for sglist allocation"

parents 7bd82663 3364e59c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@

#include <linux/msm-bus.h>
#include <linux/msm-bus-board.h>
#include <linux/vmalloc.h>

#include <linux/msm_dma_iommu_mapping.h>

@@ -1367,7 +1368,7 @@ int mdp3_put_img(struct mdp3_img_data *data, int client)
		return -EINVAL;
	}
	if (client == MDP3_CLIENT_PPP || client == MDP3_CLIENT_DMA_P) {
		kfree(data->tab_clone->sgl);
		vfree(data->tab_clone->sgl);
		kfree(data->tab_clone);
	}
	return 0;
@@ -1496,7 +1497,7 @@ int mdp3_get_img(struct msmfb_data *img, struct mdp3_img_data *data, int client)
	dma_buf_put(data->srcp_dma_buf);

	if (client ==  MDP3_CLIENT_PPP || client == MDP3_CLIENT_DMA_P) {
		kfree(data->tab_clone->sgl);
		vfree(data->tab_clone->sgl);
		kfree(data->tab_clone);
	}
	return ret;
+3 −2
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <linux/dma-buf.h>
#include <linux/of_platform.h>
#include <linux/msm_dma_iommu_mapping.h>
#include <linux/vmalloc.h>

#include <asm/dma-iommu.h>
#include "soc/qcom/secure_buffer.h"
@@ -522,7 +523,7 @@ static void mdss_smmu_deinit_v2(struct mdss_data_type *mdata)
 *   either sides of sgl.
 *
 * Returns:
 *   Pointer to new kmalloced sg list, ERR_PTR() on error
 *   Pointer to new vmalloced sg list, ERR_PTR() on error
 *
 */
static struct scatterlist *sg_clone(struct scatterlist *orig_sgl, u64 len,
@@ -538,7 +539,7 @@ static struct scatterlist *sg_clone(struct scatterlist *orig_sgl, u64 len,
	if (padding)
		nents += 2;

	head = kmalloc_array(nents, sizeof(struct scatterlist), gfp_mask);
	head = vmalloc(nents * sizeof(struct scatterlist));
	if (!head)
		return ERR_PTR(-ENOMEM);