Merge "display: msm: optimize driver debug allocations"

This commit is contained in:
qctecmdr
2021-06-04 19:50:11 -07:00
committed by Gerrit - the friendly Code Review server
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->dump_done && !rbuf->cur_blk) {
if (!rbuf->buf) if (!rbuf->buf)
rbuf->buf = kzalloc(DUMP_BUF_SIZE, GFP_KERNEL); rbuf->buf = kvzalloc(DUMP_BUF_SIZE, GFP_KERNEL);
if (!rbuf->buf) { if (!rbuf->buf) {
len = -ENOMEM; len = -ENOMEM;
goto err; goto err;
@@ -2292,7 +2292,7 @@ static void sde_dbg_dsi_ctrl_destroy(void)
*/ */
void sde_dbg_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)); memset(&sde_dbg_base.regbuf, 0, sizeof(sde_dbg_base.regbuf));
_sde_dbg_debugfs_destroy(); _sde_dbg_debugfs_destroy();
sde_dbg_base_evtlog = NULL; sde_dbg_base_evtlog = NULL;

View File

@@ -117,7 +117,13 @@ enum sde_dbg_dump_context {
* number must be greater than print entry to prevent out of bound evtlog * number must be greater than print entry to prevent out of bound evtlog
* entry array access. * entry array access.
*/ */
#if IS_ENABLED(CONFIG_DRM_SDE_VM)
#define SDE_EVTLOG_ENTRY (SDE_EVTLOG_PRINT_ENTRY * 8)
#else
#define SDE_EVTLOG_ENTRY (SDE_EVTLOG_PRINT_ENTRY * 32) #define SDE_EVTLOG_ENTRY (SDE_EVTLOG_PRINT_ENTRY * 32)
#endif /* IS_ENABLED(CONFIG_DRM_SDE_VM) */
#define SDE_EVTLOG_MAX_DATA 15 #define SDE_EVTLOG_MAX_DATA 15
#define SDE_EVTLOG_BUF_MAX 512 #define SDE_EVTLOG_BUF_MAX 512
#define SDE_EVTLOG_BUF_ALIGN 32 #define SDE_EVTLOG_BUF_ALIGN 32
@@ -162,7 +168,11 @@ extern struct sde_dbg_evtlog *sde_dbg_base_evtlog;
* number must be greater than number of possible writes in at least one * number must be greater than number of possible writes in at least one
* single commit. * single commit.
*/ */
#if IS_ENABLED(CONFIG_DRM_SDE_VM)
#define SDE_REGLOG_ENTRY 256
#else
#define SDE_REGLOG_ENTRY 1024 #define SDE_REGLOG_ENTRY 1024
#endif /* IS_ENABLED(CONFIG_DRM_SDE_VM) */
struct sde_dbg_reglog_log { struct sde_dbg_reglog_log {
s64 time; s64 time;

View File

@@ -224,7 +224,7 @@ struct sde_dbg_evtlog *sde_evtlog_init(void)
{ {
struct sde_dbg_evtlog *evtlog; struct sde_dbg_evtlog *evtlog;
evtlog = kzalloc(sizeof(*evtlog), GFP_KERNEL); evtlog = kvzalloc(sizeof(*evtlog), GFP_KERNEL);
if (!evtlog) if (!evtlog)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
@@ -241,7 +241,7 @@ struct sde_dbg_reglog *sde_reglog_init(void)
{ {
struct sde_dbg_reglog *reglog; struct sde_dbg_reglog *reglog;
reglog = kzalloc(sizeof(*reglog), GFP_KERNEL); reglog = kvzalloc(sizeof(*reglog), GFP_KERNEL);
if (!reglog) if (!reglog)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
@@ -349,7 +349,7 @@ void sde_evtlog_destroy(struct sde_dbg_evtlog *evtlog)
list_del(&filter_node->list); list_del(&filter_node->list);
kfree(filter_node); kfree(filter_node);
} }
kfree(evtlog); kvfree(evtlog);
} }
void sde_reglog_destroy(struct sde_dbg_reglog *reglog) void sde_reglog_destroy(struct sde_dbg_reglog *reglog)
@@ -357,5 +357,5 @@ void sde_reglog_destroy(struct sde_dbg_reglog *reglog)
if (!reglog) if (!reglog)
return; return;
kfree(reglog); kvfree(reglog);
} }