From cdc6ef1ba19056feb0aaf2ed2965dd374b092f93 Mon Sep 17 00:00:00 2001 From: Mohammed Mirza Mandayappurath Manzoor Date: Thu, 27 Aug 2020 13:58:55 -0700 Subject: [PATCH] msm: kgsl: Update the mailbox message and length for ACD QMP message Update the message string and adjust the message length as mailbox controller expects 4-byte aligned buffer. Change-Id: Ifc357a27b63d1d04f5d0149f637814e5d35262f4 Signed-off-by: Mohammed Mirza Mandayappurath Manzoor --- drivers/gpu/msm/adreno_a6xx_gmu.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/msm/adreno_a6xx_gmu.c b/drivers/gpu/msm/adreno_a6xx_gmu.c index 4be6ff6b4c55..ace1c586fb82 100644 --- a/drivers/gpu/msm/adreno_a6xx_gmu.c +++ b/drivers/gpu/msm/adreno_a6xx_gmu.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "adreno.h" @@ -2093,19 +2094,20 @@ void a6xx_gmu_snapshot(struct adreno_device *adreno_dev, void a6xx_gmu_aop_send_acd_state(struct a6xx_gmu_device *gmu, bool flag) { - char msg_buf[33]; + struct qmp_pkt msg; + char msg_buf[36]; + u32 size; int ret; - struct { - u32 len; - void *msg; - } msg; if (IS_ERR_OR_NULL(gmu->mailbox.channel)) return; - msg.len = scnprintf(msg_buf, sizeof(msg_buf), - "{class: gpu, res: acd, value: %d}", flag); - msg.msg = msg_buf; + size = scnprintf(msg_buf, sizeof(msg_buf), + "{class: gpu, res: acd, val: %d}", flag); + + /* mailbox controller expects 4-byte aligned buffer */ + msg.size = ALIGN((size + 1), SZ_4); + msg.data = msg_buf; ret = mbox_send_message(gmu->mailbox.channel, &msg);