codec_mm: CF1 modify 2k platform codec_mm scatter cache size. [1/1]

PD#SWPL-159404

Problem:
reduce scatter cache memory setting for 2k platform.

Solution:
modify 2k platform codec_mm scatter cache size.

Verify:
t5d/S805X2/TXHD2/S1A/S805X3

Change-Id: Icef2f68fb854466726699ecad4bd34a1cb0c3bef
Signed-off-by: lele xiang <lele.xiang@amlogic.com>
This commit is contained in:
lele xiang
2024-03-11 08:04:58 +00:00
committed by gerrit autosubmit
parent 94a9773f61
commit 762e4a63cc
3 changed files with 17 additions and 1 deletions
+14
View File
@@ -4056,6 +4056,20 @@ int __nocfi get_mte_sync_tags_hook_kprobe(void *data)
}
#endif
bool is_2k_platform(void)
{
int cpu_type = get_cpu_type();
int pack_type = get_meson_cpu_version(MESON_CPU_VERSION_LVL_PACK);
if (cpu_type == MESON_CPU_MAJOR_ID_T5D ||
cpu_type == MESON_CPU_MAJOR_ID_TXHD2 ||
cpu_type == MESON_CPU_MAJOR_ID_S1A ||
(cpu_type == MESON_CPU_MAJOR_ID_S4 && pack_type == 2) ||
(cpu_type == MESON_CPU_MAJOR_ID_S7 && pack_type == 3))
return true;
return false;
}
static int codec_mm_probe(struct platform_device *pdev)
{
int r;
@@ -46,4 +46,5 @@ void codec_mm_scatter_level_increase(int size);
void codec_mm_set_min_linear_size(int min_mem_val);
int codec_mm_get_min_linear_size(void);
int codec_mm_get_scatter_watermark(void);
bool is_2k_platform(void);
#endif /**/
@@ -3103,7 +3103,8 @@ static int codec_mm_scatter_mgt_alloc_in(struct codec_mm_scatter_mgt **psmgt)
smgt->try_alloc_in_sys_page_cnt = MAX_SYS_BLOCK_PAGE;
smgt->try_alloc_in_sys_page_cnt_min = MIN_SYS_BLOCK_PAGE;
smgt->reserved_block_mm_M = 300;
smgt->keep_size_PAGE = 20 * SZ_1M >> PAGE_SHIFT;
smgt->keep_size_PAGE = is_2k_platform() ?
4 * SZ_1M >> PAGE_SHIFT : 20 * SZ_1M >> PAGE_SHIFT;
smgt->alloc_from_cma_first = 1;
smgt->enable_slot_from_sys = 0;
smgt->expected_slot_sid[0] = MAX_SID;