Files
eden/src/video_core/host1x/host1x.cpp
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.5 KiB
C++
Raw Normal View History

// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
2025-10-05 05:41:20 +02:00
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
2022-01-30 22:26:01 +01:00
#include "core/core.h"
#include "video_core/host1x/host1x.h"
2024-04-05 01:58:29 +02:00
#include "video_core/host1x/nvdec.h"
#include "video_core/host1x/vic.h"
2022-01-30 22:26:01 +01:00
2024-04-05 01:58:29 +02:00
namespace Tegra::Host1x {
2022-01-30 22:26:01 +01:00
Host1x::Host1x(Core::System& system_)
: system{system_}
, syncpoint_manager{}
, memory_manager(system.DeviceMemory())
, gmmu_manager{system, memory_manager, 32, 0, 12}
, allocator{1 << 12}
{}
2022-01-30 22:26:01 +01:00
2023-12-30 04:37:25 +01:00
Host1x::~Host1x() = default;
2024-04-05 01:58:29 +02:00
void Host1x::StartDevice(s32 fd, ChannelType type, u32 syncpt) {
switch (type) {
case ChannelType::NvDec:
2025-10-05 05:41:20 +02:00
#ifdef YUZU_LEGACY
std::call_once(nvdec_first_init, []() {std::this_thread::sleep_for(std::chrono::milliseconds{500});}); // HACK: For Astroneer
#endif
devices[fd] = std::make_unique<Tegra::Host1x::Nvdec>(*this, fd, syncpt);
2024-04-05 01:58:29 +02:00
break;
case ChannelType::VIC:
2025-10-05 05:41:20 +02:00
#ifdef YUZU_LEGACY
std::call_once(vic_first_init, []() {std::this_thread::sleep_for(std::chrono::milliseconds{500});}); // HACK: For Astroneer
#endif
devices[fd] = std::make_unique<Tegra::Host1x::Vic>(*this, fd, syncpt);
2024-04-05 01:58:29 +02:00
break;
default:
LOG_ERROR(HW_GPU, "Unimplemented host1x device {}", static_cast<u32>(type));
break;
}
}
void Host1x::StopDevice(s32 fd, ChannelType type) {
devices.erase(fd);
}
2022-01-30 22:26:01 +01:00
2024-04-05 01:58:29 +02:00
} // namespace Tegra::Host1x