From 917e64b8c5e6059d797ae3358cfd94abb8e3a0ad Mon Sep 17 00:00:00 2001 From: Tomasz Lauda Date: Wed, 12 Jun 2019 13:05:50 +0200 Subject: [PATCH] component: remove min_bytes argument from comp_xrun methods Removes min_bytes argument from comp_underrun and comp_overrun methods. With the current way of copying as much data as possible min_bytes doesn't say anything Signed-off-by: Tomasz Lauda --- src/audio/dai.c | 4 ++-- src/include/sof/audio/component.h | 20 ++++++++------------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/audio/dai.c b/src/audio/dai.c index 2e1c03145..f0a3f0311 100644 --- a/src/audio/dai.c +++ b/src/audio/dai.c @@ -560,12 +560,12 @@ static int dai_check_for_xrun(struct comp_dev *dev, uint32_t copy_bytes) trace_dai_error_with_ids(dev, "dai_check_for_xrun() " "error: underrun due to no data " "available"); - comp_underrun(dev, dd->dma_buffer, copy_bytes, 0); + comp_underrun(dev, dd->dma_buffer, copy_bytes); } else { trace_dai_error_with_ids(dev, "dai_check_for_xrun() " "error: overrun due to no data " "available"); - comp_overrun(dev, dd->dma_buffer, copy_bytes, 0); + comp_overrun(dev, dd->dma_buffer, copy_bytes); } return -ENODATA; diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index 630e66f42..a4d333899 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -722,16 +722,14 @@ static inline int comp_get_endpoint_type(struct comp_dev *dev) * @param dev Component device. * @param source Source buffer. * @param copy_bytes Requested size of data to be available. - * @param min_bytes */ static inline void comp_underrun(struct comp_dev *dev, struct comp_buffer *source, - uint32_t copy_bytes, uint32_t min_bytes) + uint32_t copy_bytes) { - trace_comp("comp_underrun(), ((dev->comp.id << 16) | source->avail) =" - " %u, ((min_bytes << 16) | copy_bytes) = %u", - (dev->comp.id << 16) | source->avail, - (min_bytes << 16) | copy_bytes); + trace_comp_error("comp_underrun() error: dev->comp.id = %u, " + "source->avail = %u, copy_bytes = %u", dev->comp.id, + source->avail, copy_bytes); pipeline_xrun(dev->pipeline, dev, (int32_t)source->avail - copy_bytes); } @@ -741,15 +739,13 @@ static inline void comp_underrun(struct comp_dev *dev, * @param dev Component device. * @param sink Sink buffer. * @param copy_bytes Requested size of free space to be available. - * @param min_bytes */ static inline void comp_overrun(struct comp_dev *dev, struct comp_buffer *sink, - uint32_t copy_bytes, uint32_t min_bytes) + uint32_t copy_bytes) { - trace_comp("comp_overrun(), ((dev->comp.id << 16) | sink->free) = %u, " - "((min_bytes << 16) | copy_bytes) = %u", - (dev->comp.id << 16) | sink->free, - (min_bytes << 16) | copy_bytes); + trace_comp_error("comp_overrun() error: dev->comp.id = %u, sink->free " + "= %u, copy_bytes = %u", dev->comp.id, sink->free, + copy_bytes); pipeline_xrun(dev->pipeline, dev, (int32_t)copy_bytes - sink->free); }