disp: msm: use vzalloc for large allocations

Large allocations using kzalloc can lead to timeouts. This updates
the allocation calls accordingly to use vzalloc to remove
requirements on contiguous memory.

Change-Id: I86fa0ae13277d97477210a082703514df792d8a9
Signed-off-by: Nilaan Gunabalachandran <quic_ngunabal@quicinc.com>
This commit is contained in:
Nilaan Gunabalachandran
2021-11-04 15:55:23 -04:00
parent 669a9a3190
commit e51018b92c
6 changed files with 32 additions and 29 deletions

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2009-2021, The Linux Foundation. All rights reserved.
*/
@@ -1060,7 +1060,7 @@ static void _sde_dbg_dump_sde_dbg_bus(struct sde_dbg_sde_debug_bus *bus, u32 ena
SDE_DBG_LOG_MARKER(name, SDE_DBG_LOG_START, in_log);
if (in_mem && (!(*dump_mem))) {
*dump_mem = kvzalloc(list_size, GFP_KERNEL);
*dump_mem = vzalloc(list_size);
bus->cmn.content_size = list_size / sizeof(u32);
}
dump_addr = *dump_mem;
@@ -1104,7 +1104,7 @@ static void _sde_dbg_dump_dsi_dbg_bus(struct sde_dbg_sde_debug_bus *bus, u32 ena
mutex_lock(&sde_dbg_dsi_mutex);
if (in_mem && (!(*dump_mem))) {
*dump_mem = kvzalloc(list_size, GFP_KERNEL);
*dump_mem = vzalloc(list_size);
bus->cmn.content_size = list_size / sizeof(u32);
}
dump_addr = *dump_mem;
@@ -1139,7 +1139,7 @@ static void _sde_dump_array(bool do_panic, const char *name, bool dump_secure, u
reg_dump_size = _sde_dbg_get_reg_dump_size();
if (!dbg_base->reg_dump_base)
dbg_base->reg_dump_base = kvzalloc(reg_dump_size, GFP_KERNEL);
dbg_base->reg_dump_base = vzalloc(reg_dump_size);
dbg_base->reg_dump_addr = dbg_base->reg_dump_base;
@@ -1624,7 +1624,7 @@ static ssize_t sde_recovery_regdump_read(struct file *file, char __user *ubuf,
if (!rbuf->dump_done && !rbuf->cur_blk) {
if (!rbuf->buf)
rbuf->buf = kvzalloc(DUMP_BUF_SIZE, GFP_KERNEL);
rbuf->buf = vzalloc(DUMP_BUF_SIZE);
if (!rbuf->buf) {
len = -ENOMEM;
goto err;
@@ -2431,7 +2431,7 @@ static void sde_dbg_reg_base_destroy(void)
list_del(&blk_base->reg_base_head);
kfree(blk_base);
}
kvfree(dbg_base->reg_dump_base);
vfree(dbg_base->reg_dump_base);
}
static void sde_dbg_dsi_ctrl_destroy(void)
@@ -2450,12 +2450,12 @@ static void sde_dbg_buses_destroy(void)
{
struct sde_dbg_base *dbg_base = &sde_dbg_base;
kvfree(dbg_base->dbgbus_sde.cmn.dumped_content);
kvfree(dbg_base->dbgbus_vbif_rt.cmn.dumped_content);
kvfree(dbg_base->dbgbus_dsi.cmn.dumped_content);
kvfree(dbg_base->dbgbus_lutdma.cmn.dumped_content);
kvfree(dbg_base->dbgbus_rsc.cmn.dumped_content);
kvfree(dbg_base->dbgbus_dp.cmn.dumped_content);
vfree(dbg_base->dbgbus_sde.cmn.dumped_content);
vfree(dbg_base->dbgbus_vbif_rt.cmn.dumped_content);
vfree(dbg_base->dbgbus_dsi.cmn.dumped_content);
vfree(dbg_base->dbgbus_lutdma.cmn.dumped_content);
vfree(dbg_base->dbgbus_rsc.cmn.dumped_content);
vfree(dbg_base->dbgbus_dp.cmn.dumped_content);
}
/**
@@ -2463,7 +2463,7 @@ static void sde_dbg_buses_destroy(void)
*/
void sde_dbg_destroy(void)
{
kvfree(sde_dbg_base.regbuf.buf);
vfree(sde_dbg_base.regbuf.buf);
memset(&sde_dbg_base.regbuf, 0, sizeof(sde_dbg_base.regbuf));
_sde_dbg_debugfs_destroy();
sde_dbg_base_evtlog = NULL;