From 556c973a330e1e1b48e968a211de5ff54a935bfc Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Wed, 22 Dec 2021 09:04:50 +0100 Subject: [PATCH] early-access version 2334 --- CMakeLists.txt | 2 +- README.md | 2 +- src/core/hle/kernel/svc.cpp | 23 ++++++++----------- .../command_classes/codecs/codec.cpp | 2 +- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18d553f4d..7d9056aa3 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -508,7 +508,7 @@ set(FFmpeg_COMPONENTS avutil swscale) -if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +if (UNIX AND NOT APPLE) Include(FindPkgConfig REQUIRED) pkg_check_modules(LIBVA libva) endif() diff --git a/README.md b/README.md index 27720aba3..87f209f69 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2333. +This is the source code for early-access 2334. ## Legal Notice diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index bb9475c56..37d67b72e 100755 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -880,22 +880,17 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle return ResultSuccess; } case GetInfoType::IdleTickCount: { - if (handle == 0) { - LOG_ERROR(Kernel_SVC, "Thread handle does not exist, handle=0x{:08X}", - static_cast(handle)); - return ResultInvalidHandle; - } + // Verify the input handle is invalid. + R_UNLESS(handle == InvalidHandle, ResultInvalidHandle); - if (info_sub_id != 0xFFFFFFFFFFFFFFFF && - info_sub_id != system.Kernel().CurrentPhysicalCoreIndex()) { - LOG_ERROR(Kernel_SVC, "Core is not the current core, got {}", info_sub_id); - return ResultInvalidCombination; - } + // Verify the requested core is valid. + const bool core_valid = + (info_sub_id == static_cast(-1ULL)) || + (info_sub_id == static_cast(system.Kernel().CurrentPhysicalCoreIndex())); + R_UNLESS(core_valid, ResultInvalidCombination); - const auto& scheduler = *system.Kernel().CurrentScheduler(); - const auto* const idle_thread = scheduler.GetIdleThread(); - - *result = idle_thread->GetCpuTime(); + // Get the idle tick count. + *result = system.Kernel().CurrentScheduler()->GetIdleThread()->GetCpuTime(); return ResultSuccess; } default: diff --git a/src/video_core/command_classes/codecs/codec.cpp b/src/video_core/command_classes/codecs/codec.cpp index 868b82f9b..04d0f3a2f 100755 --- a/src/video_core/command_classes/codecs/codec.cpp +++ b/src/video_core/command_classes/codecs/codec.cpp @@ -32,7 +32,7 @@ constexpr std::array PREFERRED_GPU_DECODERS = { #ifdef _WIN32 AV_HWDEVICE_TYPE_D3D11VA, AV_HWDEVICE_TYPE_DXVA2, -#elif defined(__linux__) +#elif defined(__unix__) AV_HWDEVICE_TYPE_VAAPI, AV_HWDEVICE_TYPE_VDPAU, #endif