Merge commit '01d9c403f2' into torzu-merging

pull/237/head
marius david 11 months ago
commit ad61f5f432

@ -54,6 +54,7 @@ constexpr u32 GetRevisionNum(u32 user_revision) {
user_revision -= Common::MakeMagic('R', 'E', 'V', '0'); user_revision -= Common::MakeMagic('R', 'E', 'V', '0');
user_revision >>= 24; user_revision >>= 24;
} }
return user_revision; return user_revision;
}; };

@ -24,6 +24,7 @@ enum class ErrorModule : u32 {
HTCS = 4, HTCS = 4,
NCM = 5, NCM = 5,
DD = 6, DD = 6,
OSDBG = 7,
LR = 8, LR = 8,
Loader = 9, Loader = 9,
CMIF = 10, CMIF = 10,
@ -51,6 +52,7 @@ enum class ErrorModule : u32 {
Util = 33, Util = 33,
TIPC = 35, TIPC = 35,
ANIF = 37, ANIF = 37,
CRT = 39,
ETHC = 100, ETHC = 100,
I2C = 101, I2C = 101,
GPIO = 102, GPIO = 102,
@ -106,6 +108,7 @@ enum class ErrorModule : u32 {
Audio = 153, Audio = 153,
NPNS = 154, NPNS = 154,
NPNSHTTPSTREAM = 155, NPNSHTTPSTREAM = 155,
IDLE = 156,
ARP = 157, ARP = 157,
SWKBD = 158, SWKBD = 158,
BOOT = 159, BOOT = 159,
@ -115,6 +118,7 @@ enum class ErrorModule : u32 {
Fatal = 163, Fatal = 163,
NIMShop = 164, NIMShop = 164,
SPSM = 165, SPSM = 165,
AOC = 166,
BGTC = 167, BGTC = 167,
UserlandCrash = 168, UserlandCrash = 168,
SASBUS = 169, SASBUS = 169,
@ -176,13 +180,22 @@ enum class ErrorModule : u32 {
DP2HDMI = 244, DP2HDMI = 244,
Cradle = 245, Cradle = 245,
SProfile = 246, SProfile = 246,
Icm42607p = 248,
NDRM = 250, NDRM = 250,
Fst2 = 251,
Nex = 306,
NPLN = 321,
TSPM = 499, TSPM = 499,
DevMenu = 500, DevMenu = 500,
Nverpt = 520,
Am_StuckMonitor = 521,
Pia = 618,
Eagle = 623,
GeneralWebApplet = 800, GeneralWebApplet = 800,
WifiWebAuthApplet = 809, WifiWebAuthApplet = 809,
WhitelistedApplet = 810, WhitelistedApplet = 810,
ShopN = 811, ShopN = 811,
Coral = 815
}; };
/// Encapsulates a Horizon OS error code, allowing it to be separated into its constituent fields. /// Encapsulates a Horizon OS error code, allowing it to be separated into its constituent fields.

@ -9,7 +9,7 @@ namespace Service::AM {
LifecycleManager::LifecycleManager(Core::System& system, KernelHelpers::ServiceContext& context, LifecycleManager::LifecycleManager(Core::System& system, KernelHelpers::ServiceContext& context,
bool is_application) bool is_application)
: m_system_event(context), m_operation_mode_changed_system_event(context), : 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; LifecycleManager::~LifecycleManager() = default;
@ -21,6 +21,10 @@ Event& LifecycleManager::GetOperationModeChangedSystemEvent() {
return m_operation_mode_changed_system_event; return m_operation_mode_changed_system_event;
} }
Event& LifecycleManager::GetHDCPStateChangedEvent() {
return m_hdcp_state_changed_event;
}
void LifecycleManager::PushUnorderedMessage(AppletMessage message) { void LifecycleManager::PushUnorderedMessage(AppletMessage message) {
m_unordered_messages.push_back(message); m_unordered_messages.push_back(message);
this->SignalSystemEventIfNeeded(); this->SignalSystemEventIfNeeded();

@ -42,6 +42,7 @@ public:
public: public:
Event& GetSystemEvent(); Event& GetSystemEvent();
Event& GetOperationModeChangedSystemEvent(); Event& GetOperationModeChangedSystemEvent();
Event& GetHDCPStateChangedEvent();
public: public:
bool IsApplication() { bool IsApplication() {
@ -145,12 +146,14 @@ private:
private: private:
Event m_system_event; Event m_system_event;
Event m_operation_mode_changed_system_event; Event m_operation_mode_changed_system_event;
Event m_hdcp_state_changed_event;
std::list<AppletMessage> m_unordered_messages{}; std::list<AppletMessage> m_unordered_messages{};
bool m_is_application{}; bool m_is_application{};
bool m_focus_state_changed_notification_enabled{true}; bool m_focus_state_changed_notification_enabled{true};
bool m_operation_mode_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_performance_mode_changed_notification_enabled{true};
bool m_resume_notification_enabled{}; bool m_resume_notification_enabled{};

@ -48,8 +48,8 @@ ICommonStateGetter::ICommonStateGetter(Core::System& system_, std::shared_ptr<Ap
{59, nullptr, "SetVrPositionForDebug"}, {59, nullptr, "SetVrPositionForDebug"},
{60, D<&ICommonStateGetter::GetDefaultDisplayResolution>, "GetDefaultDisplayResolution"}, {60, D<&ICommonStateGetter::GetDefaultDisplayResolution>, "GetDefaultDisplayResolution"},
{61, D<&ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent>, "GetDefaultDisplayResolutionChangeEvent"}, {61, D<&ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent>, "GetDefaultDisplayResolutionChangeEvent"},
{62, nullptr, "GetHdcpAuthenticationState"}, {62, D<&ICommonStateGetter::GetHdcpAuthenticationState>, "GetHdcpAuthenticationState"},
{63, nullptr, "GetHdcpAuthenticationStateChangeEvent"}, {63, D<&ICommonStateGetter::GetHdcpAuthenticationStateChangeEvent>, "GetHdcpAuthenticationStateChangeEvent"},
{64, nullptr, "SetTvPowerStateMatchingMode"}, {64, nullptr, "SetTvPowerStateMatchingMode"},
{65, nullptr, "GetApplicationIdByContentActionName"}, {65, nullptr, "GetApplicationIdByContentActionName"},
{66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"}, {66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"},
@ -140,6 +140,19 @@ Result ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent(
R_SUCCEED(); R_SUCCEED();
} }
Result ICommonStateGetter::GetHdcpAuthenticationState(Out<s32> out_state) {
LOG_DEBUG(Service_AM, "called");
*out_state = 1;
R_SUCCEED();
}
Result ICommonStateGetter::GetHdcpAuthenticationStateChangeEvent(
OutCopyHandle<Kernel::KReadableEvent> out_event) {
LOG_DEBUG(Service_AM, "called");
*out_event = m_applet->lifecycle_manager.GetHDCPStateChangedEvent().GetHandle();
R_SUCCEED();
}
Result ICommonStateGetter::GetOperationMode(Out<OperationMode> out_operation_mode) { Result ICommonStateGetter::GetOperationMode(Out<OperationMode> out_operation_mode) {
const bool use_docked_mode{Settings::IsDockedMode()}; const bool use_docked_mode{Settings::IsDockedMode()};
LOG_DEBUG(Service_AM, "called, use_docked_mode={}", use_docked_mode); LOG_DEBUG(Service_AM, "called, use_docked_mode={}", use_docked_mode);

@ -35,6 +35,8 @@ private:
Result GetWriterLockAccessorEx(Out<SharedPointer<ILockAccessor>> out_lock_accessor, Result GetWriterLockAccessorEx(Out<SharedPointer<ILockAccessor>> out_lock_accessor,
u32 button_type); u32 button_type);
Result GetDefaultDisplayResolutionChangeEvent(OutCopyHandle<Kernel::KReadableEvent> out_event); Result GetDefaultDisplayResolutionChangeEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
Result GetHdcpAuthenticationState(Out<s32> out_state);
Result GetHdcpAuthenticationStateChangeEvent(OutCopyHandle<Kernel::KReadableEvent> out_event);
Result GetOperationMode(Out<OperationMode> out_operation_mode); Result GetOperationMode(Out<OperationMode> out_operation_mode);
Result GetPerformanceMode(Out<APM::PerformanceMode> out_performance_mode); Result GetPerformanceMode(Out<APM::PerformanceMode> out_performance_mode);
Result GetBootMode(Out<PM::SystemBootMode> out_boot_mode); Result GetBootMode(Out<PM::SystemBootMode> out_boot_mode);

@ -41,6 +41,7 @@ enum class IoMode : u32 {
enum class OptionType : u32 { enum class OptionType : u32 {
DoNotCloseSocket = 0, DoNotCloseSocket = 0,
GetServerCertChain = 1, GetServerCertChain = 1,
EnableAlpn = 3,
}; };
// This is nn::ssl::sf::SslVersion // This is nn::ssl::sf::SslVersion
@ -96,8 +97,8 @@ public:
{23, nullptr, "GetOption"}, {23, nullptr, "GetOption"},
{24, nullptr, "GetVerifyCertErrors"}, {24, nullptr, "GetVerifyCertErrors"},
{25, nullptr, "GetCipherInfo"}, {25, nullptr, "GetCipherInfo"},
{26, nullptr, "SetNextAlpnProto"}, {26, &ISslConnection::SetNextAlpnProto, "SetNextAlpnProto"},
{27, nullptr, "GetNextAlpnProto"}, {27, &ISslConnection::GetNextAlpnProto, "GetNextAlpnProto"},
{28, nullptr, "SetDtlsSocketDescriptor"}, {28, nullptr, "SetDtlsSocketDescriptor"},
{29, nullptr, "GetDtlsHandshakeTimeout"}, {29, nullptr, "GetDtlsHandshakeTimeout"},
{30, nullptr, "SetPrivateOption"}, {30, nullptr, "SetPrivateOption"},
@ -142,6 +143,7 @@ private:
bool get_server_cert_chain = false; bool get_server_cert_chain = false;
std::shared_ptr<Network::SocketBase> socket; std::shared_ptr<Network::SocketBase> socket;
bool did_handshake = false; bool did_handshake = false;
bool enable_alpn = false;
Result SetSocketDescriptorImpl(s32* out_fd, s32 fd) { Result SetSocketDescriptorImpl(s32* out_fd, s32 fd) {
LOG_DEBUG(Service_SSL, "called, fd={}", fd); LOG_DEBUG(Service_SSL, "called, fd={}", fd);
@ -381,6 +383,10 @@ private:
case OptionType::GetServerCertChain: case OptionType::GetServerCertChain:
get_server_cert_chain = static_cast<bool>(parameters.value); get_server_cert_chain = static_cast<bool>(parameters.value);
break; break;
case OptionType::EnableAlpn:
LOG_ERROR(Service_SSL, "Called with option={}, value={} (STUBBED)", parameters.option, parameters.value);
enable_alpn = static_cast<bool>(parameters.value);
break;
default: default:
LOG_WARNING(Service_SSL, "Unknown option={}, value={}", parameters.option, LOG_WARNING(Service_SSL, "Unknown option={}, value={}", parameters.option,
parameters.value); parameters.value);
@ -389,6 +395,20 @@ private:
IPC::ResponseBuilder rb{ctx, 2}; IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess); 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<ISslContext> { class ISslContext final : public ServiceFramework<ISslContext> {

@ -1204,7 +1204,19 @@ void RasterizerOpenGL::SyncLogicOpState() {
} }
flags[Dirty::LogicOp] = false; 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<u32>(!has_float);
}
if (regs.logic_op.enable) { if (regs.logic_op.enable) {
glEnable(GL_COLOR_LOGIC_OP); glEnable(GL_COLOR_LOGIC_OP);
glLogicOp(MaxwellToGL::LogicOp(regs.logic_op.op)); glLogicOp(MaxwellToGL::LogicOp(regs.logic_op.op));

@ -952,7 +952,28 @@ void RasterizerVulkan::UpdateDynamicStates() {
UpdateDepthBiasEnable(regs); UpdateDepthBiasEnable(regs);
} }
if (device.IsExtExtendedDynamicState3EnablesSupported()) { 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<u32>(!has_float);
UpdateLogicOpEnable(regs);
regs.logic_op.enable = old;
} else {
UpdateLogicOpEnable(regs);
}
UpdateDepthClampEnable(regs); UpdateDepthClampEnable(regs);
} }
} }

Loading…
Cancel
Save