From 6bed0f0bdb7192bd9d902d12a91dfd1ef977d77c Mon Sep 17 00:00:00 2001 From: Baofeng Tian Date: Fri, 1 Sep 2023 10:28:12 +0800 Subject: [PATCH] audio: host: remove duplicated calculation for sample bytes in parameter, dma sample bytes already was calculated and assigned to dma config, during copy, this can be directly used, cycle saving is quite remarkable, 452 to 425, previous target is 420, we already meet with this patch. note: test platform is tgl board with sof debug build. Signed-off-by: Baofeng Tian --- src/audio/host-zephyr.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/audio/host-zephyr.c b/src/audio/host-zephyr.c index 793b8f3a9..60a319900 100644 --- a/src/audio/host-zephyr.c +++ b/src/audio/host-zephyr.c @@ -374,7 +374,6 @@ static uint32_t host_get_copy_bytes_normal(struct host_data *hd, struct comp_dev { struct comp_buffer *buffer = hd->local_buffer; struct comp_buffer *buffer_c; - struct comp_buffer *dma_buf_c; struct dma_status dma_stat; uint32_t avail_samples; uint32_t free_samples; @@ -391,9 +390,7 @@ static uint32_t host_get_copy_bytes_normal(struct host_data *hd, struct comp_dev return 0; } - dma_buf_c = buffer_acquire(hd->dma_buffer); - dma_sample_bytes = get_sample_bytes(audio_stream_get_frm_fmt(&dma_buf_c->stream)); - buffer_release(dma_buf_c); + dma_sample_bytes = hd->config.src_width; buffer_c = buffer_acquire(buffer);