From 4baaaf6a99ad763958bbc0ffa6d30ce75309f80a Mon Sep 17 00:00:00 2001 From: Kelebek1 Date: Thu, 7 Sep 2023 20:53:48 +0100 Subject: Do not reset the command buffer command count each time --- src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp | 9 +++++++-- src/audio_core/adsp/apps/audio_renderer/audio_renderer.h | 3 ++- .../adsp/apps/audio_renderer/command_list_processor.cpp | 5 ----- src/audio_core/adsp/apps/audio_renderer/command_list_processor.h | 8 -------- 4 files changed, 9 insertions(+), 16 deletions(-) (limited to 'src/audio_core/adsp') diff --git a/src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp index 3da342ea3..2e549bc6f 100644 --- a/src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp +++ b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.cpp @@ -88,8 +88,13 @@ MailboxMessage AudioRenderer::Receive(Direction dir, bool block) { return mailbox.Receive(dir, block); } -void AudioRenderer::SetCommandBuffer(s32 session_id, CommandBuffer& buffer) noexcept { - command_buffers[session_id] = buffer; +void AudioRenderer::SetCommandBuffer(s32 session_id, CpuAddr buffer, u64 size, u64 time_limit, + u64 applet_resource_user_id, bool reset) noexcept { + command_buffers[session_id].buffer = buffer; + command_buffers[session_id].size = size; + command_buffers[session_id].time_limit = time_limit; + command_buffers[session_id].applet_resource_user_id = applet_resource_user_id; + command_buffers[session_id].reset_buffer = reset; } u32 AudioRenderer::GetRemainCommandCount(s32 session_id) const noexcept { diff --git a/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h index b225e10fb..3f5b7dca2 100644 --- a/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h +++ b/src/audio_core/adsp/apps/audio_renderer/audio_renderer.h @@ -75,7 +75,8 @@ public: void Send(Direction dir, MailboxMessage message); MailboxMessage Receive(Direction dir, bool block = true); - void SetCommandBuffer(s32 session_id, CommandBuffer& buffer) noexcept; + void SetCommandBuffer(s32 session_id, CpuAddr buffer, u64 size, u64 time_limit, + u64 applet_resource_user_id, bool reset) noexcept; u32 GetRemainCommandCount(s32 session_id) const noexcept; void ClearRemainCommandCount(s32 session_id) noexcept; u64 GetRenderingStartTick(s32 session_id) const noexcept; diff --git a/src/audio_core/adsp/apps/audio_renderer/command_list_processor.cpp b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.cpp index acbc9100c..24e4d0496 100644 --- a/src/audio_core/adsp/apps/audio_renderer/command_list_processor.cpp +++ b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.cpp @@ -37,11 +37,6 @@ u32 CommandListProcessor::GetRemainingCommandCount() const { return command_count - processed_command_count; } -void CommandListProcessor::SetBuffer(const CpuAddr buffer, const u64 size) { - commands = reinterpret_cast(buffer + sizeof(Renderer::CommandListHeader)); - commands_buffer_size = size; -} - Sink::SinkStream* CommandListProcessor::GetOutputSinkStream() const { return stream; } diff --git a/src/audio_core/adsp/apps/audio_renderer/command_list_processor.h b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.h index 9d6fe1851..4e5fb793e 100644 --- a/src/audio_core/adsp/apps/audio_renderer/command_list_processor.h +++ b/src/audio_core/adsp/apps/audio_renderer/command_list_processor.h @@ -56,14 +56,6 @@ public: */ u32 GetRemainingCommandCount() const; - /** - * Set the command buffer. - * - * @param buffer - The buffer to use. - * @param size - The size of the buffer. - */ - void SetBuffer(CpuAddr buffer, u64 size); - /** * Get the stream for this command list. * -- cgit v1.2.3