summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core.cpp8
-rw-r--r--src/core/hle/service/glue/time/manager.cpp7
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp21
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_gpu.h3
4 files changed, 22 insertions, 17 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 9e8936728..dc515bc82 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -425,11 +425,6 @@ struct System::Impl {
room_member->SendGameInfo(game_info);
}
- // Workarounds:
- // Activate this in Super Smash Brothers Ultimate, it only affects AMD cards using AMDVLK
- Settings::values.renderer_amdvlk_depth_bias_workaround =
- params.program_id == 0x1006A800016E000ULL;
-
status = SystemResultStatus::Success;
return status;
}
@@ -489,9 +484,6 @@ struct System::Impl {
room_member->SendGameInfo(game_info);
}
- // Workarounds
- Settings::values.renderer_amdvlk_depth_bias_workaround = false;
-
LOG_DEBUG(Core, "Shutdown OK");
}
diff --git a/src/core/hle/service/glue/time/manager.cpp b/src/core/hle/service/glue/time/manager.cpp
index 059ac3fc9..cb88486dd 100644
--- a/src/core/hle/service/glue/time/manager.cpp
+++ b/src/core/hle/service/glue/time/manager.cpp
@@ -51,16 +51,17 @@ s64 CalendarTimeToEpoch(Service::PSC::Time::CalendarTime calendar) {
}
s64 GetEpochTimeFromInitialYear(std::shared_ptr<Service::Set::ISystemSettingsServer>& set_sys) {
+ s32 year{2000};
+ set_sys->GetSettingsItemValueImpl(year, "time", "standard_user_clock_initial_year");
+
Service::PSC::Time::CalendarTime calendar{
- .year = 2000,
+ .year = static_cast<s16>(year),
.month = 1,
.day = 1,
.hour = 0,
.minute = 0,
.second = 0,
};
- set_sys->GetSettingsItemValueImpl<s16>(calendar.year, "time",
- "standard_user_clock_initial_year");
return CalendarTimeToEpoch(calendar);
}
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
index bf12d69a5..efc9cca1c 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
@@ -5,6 +5,7 @@
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/core.h"
+#include "core/hle/kernel/k_process.h"
#include "core/hle/service/nvdrv/core/container.h"
#include "core/hle/service/nvdrv/core/nvmap.h"
#include "core/hle/service/nvdrv/core/syncpoint_manager.h"
@@ -75,7 +76,7 @@ NvResult nvhost_gpu::Ioctl1(DeviceFD fd, Ioctl command, std::span<const u8> inpu
case 0xd:
return WrapFixed(this, &nvhost_gpu::SetChannelPriority, input, output);
case 0x1a:
- return WrapFixed(this, &nvhost_gpu::AllocGPFIFOEx2, input, output);
+ return WrapFixed(this, &nvhost_gpu::AllocGPFIFOEx2, input, output, fd);
case 0x1b:
return WrapFixedVariable(this, &nvhost_gpu::SubmitGPFIFOBase1, input, output, true);
case 0x1d:
@@ -120,8 +121,13 @@ NvResult nvhost_gpu::Ioctl3(DeviceFD fd, Ioctl command, std::span<const u8> inpu
return NvResult::NotImplemented;
}
-void nvhost_gpu::OnOpen(NvCore::SessionId session_id, DeviceFD fd) {}
-void nvhost_gpu::OnClose(DeviceFD fd) {}
+void nvhost_gpu::OnOpen(NvCore::SessionId session_id, DeviceFD fd) {
+ sessions[fd] = session_id;
+}
+
+void nvhost_gpu::OnClose(DeviceFD fd) {
+ sessions.erase(fd);
+}
NvResult nvhost_gpu::SetNVMAPfd(IoctlSetNvmapFD& params) {
LOG_DEBUG(Service_NVDRV, "called, fd={}", params.nvmap_fd);
@@ -161,7 +167,7 @@ NvResult nvhost_gpu::SetChannelPriority(IoctlChannelSetPriority& params) {
return NvResult::Success;
}
-NvResult nvhost_gpu::AllocGPFIFOEx2(IoctlAllocGpfifoEx2& params) {
+NvResult nvhost_gpu::AllocGPFIFOEx2(IoctlAllocGpfifoEx2& params, DeviceFD fd) {
LOG_WARNING(Service_NVDRV,
"(STUBBED) called, num_entries={:X}, flags={:X}, unk0={:X}, "
"unk1={:X}, unk2={:X}, unk3={:X}",
@@ -173,7 +179,12 @@ NvResult nvhost_gpu::AllocGPFIFOEx2(IoctlAllocGpfifoEx2& params) {
return NvResult::AlreadyAllocated;
}
- system.GPU().InitChannel(*channel_state);
+ u64 program_id{};
+ if (auto* const session = core.GetSession(sessions[fd]); session != nullptr) {
+ program_id = session->process->GetProgramId();
+ }
+
+ system.GPU().InitChannel(*channel_state, program_id);
params.fence_out = syncpoint_manager.GetSyncpointFence(channel_syncpoint);
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h
index e34a978db..e0aeef953 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h
+++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h
@@ -192,7 +192,7 @@ private:
NvResult ZCullBind(IoctlZCullBind& params);
NvResult SetErrorNotifier(IoctlSetErrorNotifier& params);
NvResult SetChannelPriority(IoctlChannelSetPriority& params);
- NvResult AllocGPFIFOEx2(IoctlAllocGpfifoEx2& params);
+ NvResult AllocGPFIFOEx2(IoctlAllocGpfifoEx2& params, DeviceFD fd);
NvResult AllocateObjectContext(IoctlAllocObjCtx& params);
NvResult SubmitGPFIFOImpl(IoctlSubmitGpfifo& params, Tegra::CommandList&& entries);
@@ -210,6 +210,7 @@ private:
NvCore::SyncpointManager& syncpoint_manager;
NvCore::NvMap& nvmap;
std::shared_ptr<Tegra::Control::ChannelState> channel_state;
+ std::unordered_map<DeviceFD, NvCore::SessionId> sessions;
u32 channel_syncpoint;
std::mutex channel_mutex;