diff --git a/src/audio_core/common/feature_support.h b/src/audio_core/common/feature_support.h index e2e00769c2..2fbf122154 100644 --- a/src/audio_core/common/feature_support.h +++ b/src/audio_core/common/feature_support.h @@ -54,6 +54,7 @@ constexpr u32 GetRevisionNum(u32 user_revision) { user_revision -= Common::MakeMagic('R', 'E', 'V', '0'); user_revision >>= 24; } + return user_revision; }; diff --git a/src/core/hle/result.h b/src/core/hle/result.h index b3e1978906..d06d6655e4 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h @@ -24,6 +24,7 @@ enum class ErrorModule : u32 { HTCS = 4, NCM = 5, DD = 6, + OSDBG = 7, LR = 8, Loader = 9, CMIF = 10, @@ -51,6 +52,7 @@ enum class ErrorModule : u32 { Util = 33, TIPC = 35, ANIF = 37, + CRT = 39, ETHC = 100, I2C = 101, GPIO = 102, @@ -106,6 +108,7 @@ enum class ErrorModule : u32 { Audio = 153, NPNS = 154, NPNSHTTPSTREAM = 155, + IDLE = 156, ARP = 157, SWKBD = 158, BOOT = 159, @@ -115,6 +118,7 @@ enum class ErrorModule : u32 { Fatal = 163, NIMShop = 164, SPSM = 165, + AOC = 166, BGTC = 167, UserlandCrash = 168, SASBUS = 169, @@ -176,13 +180,22 @@ enum class ErrorModule : u32 { DP2HDMI = 244, Cradle = 245, SProfile = 246, + Icm42607p = 248, NDRM = 250, + Fst2 = 251, + Nex = 306, + NPLN = 321, TSPM = 499, DevMenu = 500, + Nverpt = 520, + Am_StuckMonitor = 521, + Pia = 618, + Eagle = 623, GeneralWebApplet = 800, WifiWebAuthApplet = 809, WhitelistedApplet = 810, ShopN = 811, + Coral = 815 }; /// Encapsulates a Horizon OS error code, allowing it to be separated into its constituent fields. diff --git a/src/core/hle/service/am/lifecycle_manager.cpp b/src/core/hle/service/am/lifecycle_manager.cpp index 0dac27ed08..fbb9ad611f 100644 --- a/src/core/hle/service/am/lifecycle_manager.cpp +++ b/src/core/hle/service/am/lifecycle_manager.cpp @@ -9,7 +9,7 @@ namespace Service::AM { LifecycleManager::LifecycleManager(Core::System& system, KernelHelpers::ServiceContext& context, bool is_application) : m_system_event(context), m_operation_mode_changed_system_event(context), - m_is_application(is_application) {} + m_hdcp_state_changed_event(context), m_is_application(is_application) {} LifecycleManager::~LifecycleManager() = default; @@ -21,6 +21,10 @@ Event& LifecycleManager::GetOperationModeChangedSystemEvent() { return m_operation_mode_changed_system_event; } +Event& LifecycleManager::GetHDCPStateChangedEvent() { + return m_hdcp_state_changed_event; +} + void LifecycleManager::PushUnorderedMessage(AppletMessage message) { m_unordered_messages.push_back(message); this->SignalSystemEventIfNeeded(); diff --git a/src/core/hle/service/am/lifecycle_manager.h b/src/core/hle/service/am/lifecycle_manager.h index 7c70434a18..a1ddb9e2df 100644 --- a/src/core/hle/service/am/lifecycle_manager.h +++ b/src/core/hle/service/am/lifecycle_manager.h @@ -42,6 +42,7 @@ public: public: Event& GetSystemEvent(); Event& GetOperationModeChangedSystemEvent(); + Event& GetHDCPStateChangedEvent(); public: bool IsApplication() { @@ -145,12 +146,14 @@ private: private: Event m_system_event; Event m_operation_mode_changed_system_event; + Event m_hdcp_state_changed_event; std::list m_unordered_messages{}; bool m_is_application{}; bool m_focus_state_changed_notification_enabled{true}; bool m_operation_mode_changed_notification_enabled{true}; + bool m_hdcp_state_changed_notification_enabled{true}; bool m_performance_mode_changed_notification_enabled{true}; bool m_resume_notification_enabled{}; diff --git a/src/core/hle/service/am/service/common_state_getter.cpp b/src/core/hle/service/am/service/common_state_getter.cpp index f20071156e..c445e5e776 100644 --- a/src/core/hle/service/am/service/common_state_getter.cpp +++ b/src/core/hle/service/am/service/common_state_getter.cpp @@ -48,8 +48,8 @@ ICommonStateGetter::ICommonStateGetter(Core::System& system_, std::shared_ptr, "GetDefaultDisplayResolution"}, {61, D<&ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent>, "GetDefaultDisplayResolutionChangeEvent"}, - {62, nullptr, "GetHdcpAuthenticationState"}, - {63, nullptr, "GetHdcpAuthenticationStateChangeEvent"}, + {62, D<&ICommonStateGetter::GetHdcpAuthenticationState>, "GetHdcpAuthenticationState"}, + {63, D<&ICommonStateGetter::GetHdcpAuthenticationStateChangeEvent>, "GetHdcpAuthenticationStateChangeEvent"}, {64, nullptr, "SetTvPowerStateMatchingMode"}, {65, nullptr, "GetApplicationIdByContentActionName"}, {66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"}, @@ -140,6 +140,19 @@ Result ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent( R_SUCCEED(); } +Result ICommonStateGetter::GetHdcpAuthenticationState(Out out_state) { + LOG_DEBUG(Service_AM, "called"); + *out_state = 1; + R_SUCCEED(); +} + +Result ICommonStateGetter::GetHdcpAuthenticationStateChangeEvent( + OutCopyHandle out_event) { + LOG_DEBUG(Service_AM, "called"); + *out_event = m_applet->lifecycle_manager.GetHDCPStateChangedEvent().GetHandle(); + R_SUCCEED(); +} + Result ICommonStateGetter::GetOperationMode(Out out_operation_mode) { const bool use_docked_mode{Settings::IsDockedMode()}; LOG_DEBUG(Service_AM, "called, use_docked_mode={}", use_docked_mode); diff --git a/src/core/hle/service/am/service/common_state_getter.h b/src/core/hle/service/am/service/common_state_getter.h index 8c80e5bdbb..2be4d5e09a 100644 --- a/src/core/hle/service/am/service/common_state_getter.h +++ b/src/core/hle/service/am/service/common_state_getter.h @@ -35,6 +35,8 @@ private: Result GetWriterLockAccessorEx(Out> out_lock_accessor, u32 button_type); Result GetDefaultDisplayResolutionChangeEvent(OutCopyHandle out_event); + Result GetHdcpAuthenticationState(Out out_state); + Result GetHdcpAuthenticationStateChangeEvent(OutCopyHandle out_event); Result GetOperationMode(Out out_operation_mode); Result GetPerformanceMode(Out out_performance_mode); Result GetBootMode(Out out_boot_mode); diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index 37105d74b7..2c2db374ef 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp @@ -41,6 +41,7 @@ enum class IoMode : u32 { enum class OptionType : u32 { DoNotCloseSocket = 0, GetServerCertChain = 1, + EnableAlpn = 3, }; // This is nn::ssl::sf::SslVersion @@ -96,8 +97,8 @@ public: {23, nullptr, "GetOption"}, {24, nullptr, "GetVerifyCertErrors"}, {25, nullptr, "GetCipherInfo"}, - {26, nullptr, "SetNextAlpnProto"}, - {27, nullptr, "GetNextAlpnProto"}, + {26, &ISslConnection::SetNextAlpnProto, "SetNextAlpnProto"}, + {27, &ISslConnection::GetNextAlpnProto, "GetNextAlpnProto"}, {28, nullptr, "SetDtlsSocketDescriptor"}, {29, nullptr, "GetDtlsHandshakeTimeout"}, {30, nullptr, "SetPrivateOption"}, @@ -142,6 +143,7 @@ private: bool get_server_cert_chain = false; std::shared_ptr socket; bool did_handshake = false; + bool enable_alpn = false; Result SetSocketDescriptorImpl(s32* out_fd, s32 fd) { LOG_DEBUG(Service_SSL, "called, fd={}", fd); @@ -381,6 +383,10 @@ private: case OptionType::GetServerCertChain: get_server_cert_chain = static_cast(parameters.value); break; + case OptionType::EnableAlpn: + LOG_ERROR(Service_SSL, "Called with option={}, value={} (STUBBED)", parameters.option, parameters.value); + enable_alpn = static_cast(parameters.value); + break; default: LOG_WARNING(Service_SSL, "Unknown option={}, value={}", parameters.option, parameters.value); @@ -389,6 +395,20 @@ private: IPC::ResponseBuilder rb{ctx, 2}; rb.Push(ResultSuccess); } + + void SetNextAlpnProto(HLERequestContext& ctx) { + LOG_ERROR(Service_SSL, "(STUBBED) called."); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); + } + + void GetNextAlpnProto(HLERequestContext& ctx) { + LOG_ERROR(Service_SSL, "(STUBBED) called."); + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(ResultSuccess); + } }; class ISslContext final : public ServiceFramework { diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index d376d86d85..f054fd338a 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -1204,7 +1204,19 @@ void RasterizerOpenGL::SyncLogicOpState() { } flags[Dirty::LogicOp] = false; - const auto& regs = maxwell3d->regs; + auto regs = maxwell3d->regs; + + if (device.IsAmd()) { + auto IsFloat = [] (Tegra::Engines::Maxwell3D::Regs::VertexAttribute n) { + return n.type == Tegra::Engines::Maxwell3D::Regs::VertexAttribute::Type::Float; + }; + + bool has_float = + std::any_of(regs.vertex_attrib_format.begin(), regs.vertex_attrib_format.end(), + IsFloat); + regs.logic_op.enable = static_cast(!has_float); + } + if (regs.logic_op.enable) { glEnable(GL_COLOR_LOGIC_OP); glLogicOp(MaxwellToGL::LogicOp(regs.logic_op.op)); diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 8ba50a8344..fac631fb8e 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -952,7 +952,28 @@ void RasterizerVulkan::UpdateDynamicStates() { UpdateDepthBiasEnable(regs); } if (device.IsExtExtendedDynamicState3EnablesSupported()) { - UpdateLogicOpEnable(regs); + const auto old = regs.logic_op.enable; + + if (device.GetDriverID() == VkDriverIdKHR::VK_DRIVER_ID_AMD_OPEN_SOURCE || + device.GetDriverID() == VkDriverIdKHR::VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR) { + struct In { + const Tegra::Engines::Maxwell3D::Regs::VertexAttribute::Type d; + In(Tegra::Engines::Maxwell3D::Regs::VertexAttribute::Type n) : d(n) {} + bool operator()(Tegra::Engines::Maxwell3D::Regs::VertexAttribute n) const { + return n.type == d; + } + }; + + auto has_float = std::any_of( + regs.vertex_attrib_format.begin(), regs.vertex_attrib_format.end(), + In(Tegra::Engines::Maxwell3D::Regs::VertexAttribute::Type::Float)); + + regs.logic_op.enable = static_cast(!has_float); + UpdateLogicOpEnable(regs); + regs.logic_op.enable = old; + } else { + UpdateLogicOpEnable(regs); + } UpdateDepthClampEnable(regs); } }