From 49aad0ca789fdee8732107ca89143aa67f46d3d7 Mon Sep 17 00:00:00 2001 From: Ajay Nandakumar Date: Tue, 27 Dec 2016 13:51:55 +0530 Subject: [PATCH] platform: nvadsp: Decrease size of shared memory Decrease the size of app message(send/receive) queue from 16KB from 4096 bytes. This is to reduce the foot print of adsp. Decreasing size of ADSP log buffer from 1MB to 16 KB. This helps reducing the amount of memory used by ADSP. Based on: platform: nvadsp: Decrease size of app msg queue platform: nvadsp: Reduce the size of adsp logger Bug 1774702 Bug 200270956 Change-Id: I3b4b5d28d2fe05ad9fe2b1247327497ca63767fe Signed-off-by: Ajay Nandakumar Reviewed-on: http://git-master/r/1468350 Signed-off-by: Nitin Kumbhar Reviewed-on: https://git-master.nvidia.com/r/1537320 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit --- drivers/platform/tegra/nvadsp/adsp_shared_struct.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/platform/tegra/nvadsp/adsp_shared_struct.h b/drivers/platform/tegra/nvadsp/adsp_shared_struct.h index f2c2d64e..db0bdf15 100644 --- a/drivers/platform/tegra/nvadsp/adsp_shared_struct.h +++ b/drivers/platform/tegra/nvadsp/adsp_shared_struct.h @@ -3,7 +3,7 @@ * * A header file containing shared data structures shared with ADSP OS * - * Copyright (C) 2015-2016 NVIDIA Corporation. All rights reserved. + * Copyright (C) 2015-2017 NVIDIA Corporation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -26,7 +26,7 @@ #define ADSP_OS_LOAD_TIMEOUT 5000 /* 5000 ms */ -#define DRAM_DEBUG_LOG_SIZE 0x100000 +#define DRAM_DEBUG_LOG_SIZE 0x4000 /* 16 KB */ #define NVADSP_NAME_SZ 128 @@ -102,11 +102,16 @@ union app_complete_status_message { /*ADSP message pool structure */ +#define ADSP_MAX_MSGQ_SIZE 4096 +#define ADSP_MAX_MSGQ_WSIZE (ADSP_MAX_MSGQ_SIZE / sizeof(int32_t)) +#define ADSP_MSGQ_MAX_QUEUE_WSIZE \ + (ADSP_MAX_MSGQ_WSIZE - (int32_t)MSGQ_HEADER_WSIZE) + union app_loader_msgq { msgq_t msgq; struct { int32_t header[MSGQ_HEADER_WSIZE]; - int32_t queue[MSGQ_MAX_QUEUE_WSIZE]; + int32_t queue[ADSP_MSGQ_MAX_QUEUE_WSIZE]; }; };