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

Commit f7346920 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 305ef729 55317ea0
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@
#include <linux/msm-bus-board.h>
#include <linux/qcom_iommu.h>
#include <linux/msm_iommu_domains.h>
#include <linux/vmalloc.h>

#include <linux/msm_dma_iommu_mapping.h>

@@ -1869,7 +1870,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;
@@ -2026,7 +2027,7 @@ err_unmap:
	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;
+4 −3
Original line number Diff line number Diff line
/* Copyright (c) 2007-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2007-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -26,6 +26,7 @@
#include <linux/dma-buf.h>
#include <linux/of_platform.h>
#include <linux/msm_dma_iommu_mapping.h>
#include <linux/vmalloc.h>

#include <linux/qcom_iommu.h>
#include <asm/dma-iommu.h>
@@ -495,7 +496,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,
@@ -511,7 +512,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);