nv_host_ctrl: Make Sync GPU variant always return synced result.

This commit is contained in:
Fernando Sahmkow 2019-06-10 08:19:27 -04:00 committed by FernandoS27
parent 600dddf88d
commit 0706d633bf
5 changed files with 16 additions and 5 deletions

View file

@ -60,6 +60,11 @@ u32 nvhost_ctrl::IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>&
} }
auto& gpu = Core::System::GetInstance().GPU(); auto& gpu = Core::System::GetInstance().GPU();
// This is mostly to take into account unimplemented features. As synced
// gpu is always synced.
if (!gpu.IsAsync()) {
return NvResult::Success;
}
gpu.Guard(true); gpu.Guard(true);
u32 current_syncpoint_value = gpu.GetSyncpointValue(params.syncpt_id); u32 current_syncpoint_value = gpu.GetSyncpointValue(params.syncpt_id);
if (current_syncpoint_value >= params.threshold) { if (current_syncpoint_value >= params.threshold) {

View file

@ -29,8 +29,8 @@ u32 FramebufferConfig::BytesPerPixel(PixelFormat format) {
UNREACHABLE(); UNREACHABLE();
} }
GPU::GPU(Core::System& system, VideoCore::RendererBase& renderer) GPU::GPU(Core::System& system, VideoCore::RendererBase& renderer, bool is_async)
: system{system}, renderer{renderer} { : system{system}, renderer{renderer}, is_async{is_async} {
auto& rasterizer{renderer.Rasterizer()}; auto& rasterizer{renderer.Rasterizer()};
memory_manager = std::make_unique<Tegra::MemoryManager>(rasterizer); memory_manager = std::make_unique<Tegra::MemoryManager>(rasterizer);
dma_pusher = std::make_unique<Tegra::DmaPusher>(*this); dma_pusher = std::make_unique<Tegra::DmaPusher>(*this);

View file

@ -131,7 +131,7 @@ class MemoryManager;
class GPU { class GPU {
public: public:
explicit GPU(Core::System& system, VideoCore::RendererBase& renderer); explicit GPU(Core::System& system, VideoCore::RendererBase& renderer, bool is_async);
virtual ~GPU(); virtual ~GPU();
@ -184,6 +184,10 @@ public:
} }
} }
bool IsAsync() const {
return is_async;
}
/// Returns a const reference to the GPU DMA pusher. /// Returns a const reference to the GPU DMA pusher.
const Tegra::DmaPusher& DmaPusher() const; const Tegra::DmaPusher& DmaPusher() const;
@ -298,6 +302,8 @@ private:
std::array<std::list<Event>, Service::Nvidia::MaxSyncPoints> events; std::array<std::list<Event>, Service::Nvidia::MaxSyncPoints> events;
std::mutex sync_mutex; std::mutex sync_mutex;
const bool is_async;
}; };
#define ASSERT_REG_POSITION(field_name, position) \ #define ASSERT_REG_POSITION(field_name, position) \

View file

@ -11,7 +11,7 @@
namespace VideoCommon { namespace VideoCommon {
GPUAsynch::GPUAsynch(Core::System& system, VideoCore::RendererBase& renderer) GPUAsynch::GPUAsynch(Core::System& system, VideoCore::RendererBase& renderer)
: GPU(system, renderer), gpu_thread{system} {} : GPU(system, renderer, true), gpu_thread{system} {}
GPUAsynch::~GPUAsynch() = default; GPUAsynch::~GPUAsynch() = default;

View file

@ -8,7 +8,7 @@
namespace VideoCommon { namespace VideoCommon {
GPUSynch::GPUSynch(Core::System& system, VideoCore::RendererBase& renderer) GPUSynch::GPUSynch(Core::System& system, VideoCore::RendererBase& renderer)
: GPU(system, renderer) {} : GPU(system, renderer, false) {}
GPUSynch::~GPUSynch() = default; GPUSynch::~GPUSynch() = default;