Skip to content

Commit

Permalink
audio: host: remove duplicated calculation for sample bytes
Browse files Browse the repository at this point in the history
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 <baofeng.tian@intel.com>
  • Loading branch information
btian1 authored and kv2019i committed Sep 15, 2023
1 parent dd2a64b commit 6bed0f0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/audio/host-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down

0 comments on commit 6bed0f0

Please sign in to comment.