Revert "msm: kgsl: Call dma_buf_unmap_attachment() early"

This reverts msm-5.10 commit b84bd97e37f8ac3a0f3194ebcbb1fa962e42cd73.

Warnings for direct dma clients during cache operations are now being
handled by dma-buf driver. Instead of doing dma_buf_unmap_attachment
early if we do it in destroy path, it helps in saving cycles and
improving performance during app launch.

Change-Id: Ic66dd3b66136318abf59685f95fee17890377fd4
Signed-off-by: Pankaj Gupta <quic_gpankaj@quicinc.com>
Signed-off-by: Archana Sriram <quic_c_apsrir@quicinc.com>
This commit is contained in:
Pankaj Gupta 2023-01-11 18:48:36 +05:30 • committed by Alexander Winkowski
commit 7393ba39db
No known key found for this signature in database
GPG key ID: 72762A66704CDE44

View file

@ -349,6 +349,7 @@ static void kgsl_destroy_ion(struct kgsl_memdesc *memdesc)
if (meta != NULL) {
remove_dmabuf_list(meta);
dma_buf_unmap_attachment(meta->attach, memdesc->sgt, DMA_BIDIRECTIONAL);
dma_buf_detach(meta->dmabuf, meta->attach);
dma_buf_put(meta->dmabuf);
kfree(meta);
@ -2996,7 +2997,7 @@ static int kgsl_setup_dma_buf(struct kgsl_device *device,
{
int ret = 0;
struct scatterlist *s;
struct sg_table *sg_table;
struct sg_table *sg_table = NULL;
struct dma_buf_attachment *attach = NULL;
struct kgsl_dma_buf_meta *meta;
@ -3038,8 +3039,6 @@ static int kgsl_setup_dma_buf(struct kgsl_device *device,
goto out;
}
dma_buf_unmap_attachment(attach, sg_table, DMA_BIDIRECTIONAL);
meta->table = sg_table;
entry->priv_data = meta;
entry->memdesc.sgt = sg_table;
@ -3094,6 +3093,9 @@ skip_access_check:
out:
if (ret) {
if (!IS_ERR_OR_NULL(sg_table))
dma_buf_unmap_attachment(attach, sg_table, DMA_BIDIRECTIONAL);
if (!IS_ERR_OR_NULL(attach))
dma_buf_detach(dmabuf, attach);