summaryrefslogtreecommitdiffstats
path: root/src/audio_core/renderer/memory
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2024-02-21 02:02:36 +0100
committerLiam <byteslice@airmail.cc>2024-02-21 04:15:37 +0100
commit6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f (patch)
tree0c4925aa6e1c67ab3f91723c690ebfce90089356 /src/audio_core/renderer/memory
parentaudio: split IHardwarweOpusDecoder, move IHardwareOpusDecoderManager (diff)
downloadyuzu-6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f.tar
yuzu-6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f.tar.gz
yuzu-6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f.tar.bz2
yuzu-6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f.tar.lz
yuzu-6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f.tar.xz
yuzu-6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f.tar.zst
yuzu-6012c9fe3af1c649e5ac6392dc4b74bd3cfd0c4f.zip
Diffstat (limited to 'src/audio_core/renderer/memory')
-rw-r--r--src/audio_core/renderer/memory/pool_mapper.cpp22
-rw-r--r--src/audio_core/renderer/memory/pool_mapper.h14
2 files changed, 21 insertions, 15 deletions
diff --git a/src/audio_core/renderer/memory/pool_mapper.cpp b/src/audio_core/renderer/memory/pool_mapper.cpp
index 999bb746b..1df786feb 100644
--- a/src/audio_core/renderer/memory/pool_mapper.cpp
+++ b/src/audio_core/renderer/memory/pool_mapper.cpp
@@ -8,13 +8,13 @@
namespace AudioCore::Renderer {
-PoolMapper::PoolMapper(u32 process_handle_, bool force_map_)
+PoolMapper::PoolMapper(Kernel::KProcess* process_handle_, bool force_map_)
: process_handle{process_handle_}, force_map{force_map_} {}
-PoolMapper::PoolMapper(u32 process_handle_, std::span<MemoryPoolInfo> pool_infos_, u32 pool_count_,
- bool force_map_)
- : process_handle{process_handle_}, pool_infos{pool_infos_.data()},
- pool_count{pool_count_}, force_map{force_map_} {}
+PoolMapper::PoolMapper(Kernel::KProcess* process_handle_, std::span<MemoryPoolInfo> pool_infos_,
+ u32 pool_count_, bool force_map_)
+ : process_handle{process_handle_}, pool_infos{pool_infos_.data()}, pool_count{pool_count_},
+ force_map{force_map_} {}
void PoolMapper::ClearUseState(std::span<MemoryPoolInfo> pools, const u32 count) {
for (u32 i = 0; i < count; i++) {
@@ -106,15 +106,17 @@ bool PoolMapper::IsForceMapEnabled() const {
return force_map;
}
-u32 PoolMapper::GetProcessHandle(const MemoryPoolInfo* pool) const {
+Kernel::KProcess* PoolMapper::GetProcessHandle(const MemoryPoolInfo* pool) const {
switch (pool->GetLocation()) {
case MemoryPoolInfo::Location::CPU:
return process_handle;
case MemoryPoolInfo::Location::DSP:
- return Kernel::Svc::CurrentProcess;
+ // return Kernel::Svc::CurrentProcess;
+ return nullptr;
}
LOG_WARNING(Service_Audio, "Invalid MemoryPoolInfo location!");
- return Kernel::Svc::CurrentProcess;
+ // return Kernel::Svc::CurrentProcess;
+ return nullptr;
}
bool PoolMapper::Map([[maybe_unused]] const u32 handle, [[maybe_unused]] const CpuAddr cpu_addr,
@@ -147,14 +149,14 @@ bool PoolMapper::Unmap([[maybe_unused]] const u32 handle, [[maybe_unused]] const
}
bool PoolMapper::Unmap(MemoryPoolInfo& pool) const {
- [[maybe_unused]] u32 handle{0};
+ [[maybe_unused]] Kernel::KProcess* handle{};
switch (pool.GetLocation()) {
case MemoryPoolInfo::Location::CPU:
handle = process_handle;
break;
case MemoryPoolInfo::Location::DSP:
- handle = Kernel::Svc::CurrentProcess;
+ // handle = Kernel::Svc::CurrentProcess;
break;
}
// nn::audio::dsp::UnmapUserPointer(handle, pool->cpu_address, pool->size);
diff --git a/src/audio_core/renderer/memory/pool_mapper.h b/src/audio_core/renderer/memory/pool_mapper.h
index 95ae5d8ea..fb5122b73 100644
--- a/src/audio_core/renderer/memory/pool_mapper.h
+++ b/src/audio_core/renderer/memory/pool_mapper.h
@@ -10,6 +10,10 @@
#include "common/common_types.h"
#include "core/hle/service/audio/errors.h"
+namespace Kernel {
+class KProcess;
+}
+
namespace AudioCore::Renderer {
class AddressInfo;
@@ -18,9 +22,9 @@ class AddressInfo;
*/
class PoolMapper {
public:
- explicit PoolMapper(u32 process_handle, bool force_map);
- explicit PoolMapper(u32 process_handle, std::span<MemoryPoolInfo> pool_infos, u32 pool_count,
- bool force_map);
+ explicit PoolMapper(Kernel::KProcess* process_handle, bool force_map);
+ explicit PoolMapper(Kernel::KProcess* process_handle, std::span<MemoryPoolInfo> pool_infos,
+ u32 pool_count, bool force_map);
/**
* Clear the usage state for all given pools.
@@ -98,7 +102,7 @@ public:
* @return CurrentProcessHandle if location == DSP,
* the PoolMapper's process_handle if location == CPU
*/
- u32 GetProcessHandle(const MemoryPoolInfo* pool) const;
+ Kernel::KProcess* GetProcessHandle(const MemoryPoolInfo* pool) const;
/**
* Map the given region with the given handle. This is a no-op.
@@ -167,7 +171,7 @@ public:
private:
/// Process handle for this mapper, used when location == CPU
- u32 process_handle;
+ Kernel::KProcess* process_handle{};
/// List of memory pools assigned to this mapper
MemoryPoolInfo* pool_infos{};
/// The number of pools