From 7847572e4a8e8cbb36681326f22d14fe4262b0fd Mon Sep 17 00:00:00 2001 From: Marcin Rajwa Date: Thu, 27 Jun 2019 01:18:00 +0200 Subject: [PATCH 1/2] ipc: align stream.h with kernel This change is to align sof_ipc_stream_params with its kernel equivalent. In this patch no_stream_position parameter is added to relax host_period_bytes from storing information about the need of stream position update. Signed-off-by: Marcin Rajwa --- src/include/ipc/stream.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/ipc/stream.h b/src/include/ipc/stream.h index 1807dab43f4a..ba10a41f50c8 100644 --- a/src/include/ipc/stream.h +++ b/src/include/ipc/stream.h @@ -91,10 +91,10 @@ struct sof_ipc_stream_params { uint16_t sample_valid_bytes; uint16_t sample_container_bytes; - /* for notifying host period has completed - 0 means no period IRQ */ uint32_t host_period_bytes; + uint16_t no_stream_position; /**< 1 means don't send stream position */ - uint32_t reserved[2]; + uint16_t reserved[3]; uint16_t chmap[SOF_IPC_MAX_CHANNELS]; /**< channel map - SOF_CHMAP_ */ } __attribute__((packed)); From a86bb6bebde786ee733914a3d4dba87fd5c35895 Mon Sep 17 00:00:00 2001 From: Marcin Rajwa Date: Thu, 27 Jun 2019 01:29:07 +0200 Subject: [PATCH 2/2] host: fix wrong check for host_period_bytes This patch fixes the incorrect check for host_period_bytes. This value was incorrectly used to store host request for stream position. After we introduced dedicated parameter for this purpose (no_stream_position) the check needs to be updated accordingly. Therefore this patch adds a check for no_stream_position rather than host_period_bytes to decide if stream position shall be send. Signed-off-by: Marcin Rajwa --- src/audio/host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/audio/host.c b/src/audio/host.c index da8061d0d80e..4e0eb649e92d 100644 --- a/src/audio/host.c +++ b/src/audio/host.c @@ -134,8 +134,8 @@ static void host_update_position(struct comp_dev *dev, uint32_t bytes) if (hd->local_pos >= hd->host_size) hd->local_pos = 0; - /* NO_IRQ mode if host_period_size == 0 */ - if (dev->params.host_period_bytes != 0) { + /* Don't send stream position if no_stream_position == 1 */ + if (!dev->params.no_stream_position) { hd->report_pos += bytes; /* send IPC message to driver if needed */