display: msm: optimize driver debug allocations

This change uses kvzalloc to allocate memory for eventlog and register
dumps. This is needed since kernel cannot guarantee that physically
contiguous allocations greater than 32 KB will succeed.
Additionally it reduces the number of entries for evt logs and
register dumps for trusted vm.

Change-Id: I8b76e79d62850904f6445d8b66c882529ba6e9ba
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
This commit is contained in:
Abhijit Kulkarni
2021-05-20 13:59:01 -07:00
parent 72f7dfe428
commit b4f00361f3
3 changed files with 16 additions and 6 deletions

View File

@@ -1467,7 +1467,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 = kzalloc(DUMP_BUF_SIZE, GFP_KERNEL);
rbuf->buf = kvzalloc(DUMP_BUF_SIZE, GFP_KERNEL);
if (!rbuf->buf) {
len = -ENOMEM;
goto err;
@@ -2292,7 +2292,7 @@ static void sde_dbg_dsi_ctrl_destroy(void)
*/
void sde_dbg_destroy(void)
{
kfree(sde_dbg_base.regbuf.buf);
kvfree(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;