host1x.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // SPDX-FileCopyrightText: 2021 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-3.0-or-later
  3. #pragma once
  4. #include "common/common_types.h"
  5. #include "common/address_space.h"
  6. #include "video_core/host1x/syncpoint_manager.h"
  7. #include "video_core/memory_manager.h"
  8. namespace Core {
  9. class System;
  10. } // namespace Core
  11. namespace Tegra {
  12. namespace Host1x {
  13. class Host1x {
  14. public:
  15. explicit Host1x(Core::System& system);
  16. SyncpointManager& GetSyncpointManager() {
  17. return syncpoint_manager;
  18. }
  19. const SyncpointManager& GetSyncpointManager() const {
  20. return syncpoint_manager;
  21. }
  22. Tegra::MemoryManager& MemoryManager() {
  23. return memory_manager;
  24. }
  25. const Tegra::MemoryManager& MemoryManager() const {
  26. return memory_manager;
  27. }
  28. Common::FlatAllocator<u32, 0, 32>& Allocator() {
  29. return *allocator;
  30. }
  31. const Common::FlatAllocator<u32, 0, 32>& Allocator() const {
  32. return *allocator;
  33. }
  34. private:
  35. Core::System& system;
  36. SyncpointManager syncpoint_manager;
  37. Tegra::MemoryManager memory_manager;
  38. std::unique_ptr<Common::FlatAllocator<u32, 0, 32>> allocator;
  39. };
  40. } // namespace Host1x
  41. } // namespace Tegra