From 6c0d90237371c9adbe80a26c3e4f53b35ea57a0e Mon Sep 17 00:00:00 2001 From: ameerj <52414509+ameerj@users.noreply.github.com> Date: Fri, 1 Oct 2021 23:10:55 -0400 Subject: nvhost_ctrl: Refactor usage of gpu.LockSync() This seems to only be used to protect a later gpu function call. So we can move the lock into that call instead. --- src/video_core/gpu.cpp | 9 +-------- src/video_core/gpu.h | 12 ------------ 2 files changed, 1 insertion(+), 20 deletions(-) (limited to 'src/video_core') diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 520675873..ab7c21a49 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -262,6 +262,7 @@ struct GPU::Impl { } void RegisterSyncptInterrupt(u32 syncpoint_id, u32 value) { + std::lock_guard lock{sync_mutex}; auto& interrupt = syncpt_interrupts.at(syncpoint_id); bool contains = std::any_of(interrupt.begin(), interrupt.end(), [value](u32 in_value) { return in_value == value; }); @@ -300,10 +301,6 @@ struct GPU::Impl { return nanoseconds_num * gpu_ticks_num + (nanoseconds_rem * gpu_ticks_num) / gpu_ticks_den; } - [[nodiscard]] std::unique_lock LockSync() { - return std::unique_lock{sync_mutex}; - } - [[nodiscard]] bool IsAsync() const { return is_async; } @@ -862,10 +859,6 @@ u64 GPU::GetTicks() const { return impl->GetTicks(); } -std::unique_lock GPU::LockSync() { - return impl->LockSync(); -} - bool GPU::IsAsync() const { return impl->IsAsync(); } diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 39b304823..05e5c94f3 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h @@ -5,22 +5,12 @@ #pragma once #include -#include #include "common/bit_field.h" #include "common/common_types.h" #include "video_core/cdma_pusher.h" #include "video_core/framebuffer_config.h" -using CacheAddr = std::uintptr_t; -[[nodiscard]] inline CacheAddr ToCacheAddr(const void* host_ptr) { - return reinterpret_cast(host_ptr); -} - -[[nodiscard]] inline u8* FromCacheAddr(CacheAddr cache_addr) { - return reinterpret_cast(cache_addr); -} - namespace Core { namespace Frontend { class EmuWindow; @@ -230,8 +220,6 @@ public: [[nodiscard]] u64 GetTicks() const; - [[nodiscard]] std::unique_lock LockSync(); - [[nodiscard]] bool IsAsync() const; [[nodiscard]] bool UseNvdec() const; -- cgit v1.2.3