debug: move to hyprutils' logger (#12673)
This commit is contained in:
parent
f88deb928a
commit
6175ecd4c4
147 changed files with 1696 additions and 1709 deletions
|
|
@ -33,7 +33,7 @@
|
|||
#include "../desktop/view/LayerSurface.hpp"
|
||||
#include "../desktop/state/FocusState.hpp"
|
||||
#include <aquamarine/output/Output.hpp>
|
||||
#include "debug/Log.hpp"
|
||||
#include "debug/log/Logger.hpp"
|
||||
#include "debug/HyprNotificationOverlay.hpp"
|
||||
#include "MonitorFrameScheduler.hpp"
|
||||
#include <hyprutils/string/String.hpp>
|
||||
|
|
@ -146,14 +146,14 @@ void CMonitor::onConnect(bool noRule) {
|
|||
});
|
||||
|
||||
m_listeners.destroy = m_output->events.destroy.listen([this] {
|
||||
Debug::log(LOG, "Destroy called for monitor {}", m_name);
|
||||
Log::logger->log(Log::DEBUG, "Destroy called for monitor {}", m_name);
|
||||
|
||||
onDisconnect(true);
|
||||
|
||||
m_output = nullptr;
|
||||
m_renderingInitPassed = false;
|
||||
|
||||
Debug::log(LOG, "Removing monitor {} from realMonitors", m_name);
|
||||
Log::logger->log(Log::DEBUG, "Removing monitor {} from realMonitors", m_name);
|
||||
|
||||
std::erase_if(g_pCompositor->m_realMonitors, [&](PHLMONITOR& el) { return el.get() == this; });
|
||||
});
|
||||
|
|
@ -165,7 +165,7 @@ void CMonitor::onConnect(bool noRule) {
|
|||
if (m_createdByUser)
|
||||
return;
|
||||
|
||||
Debug::log(LOG, "Reapplying monitor rule for {} from a state request", m_name);
|
||||
Log::logger->log(Log::DEBUG, "Reapplying monitor rule for {} from a state request", m_name);
|
||||
applyMonitorRule(&m_activeMonitorRule, true);
|
||||
return;
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ void CMonitor::onConnect(bool noRule) {
|
|||
m_output->state->setEnabled(false);
|
||||
|
||||
if (!m_state.commit())
|
||||
Debug::log(ERR, "Couldn't commit disabled state on output {}", m_output->name);
|
||||
Log::logger->log(Log::ERR, "Couldn't commit disabled state on output {}", m_output->name);
|
||||
|
||||
m_enabled = false;
|
||||
|
||||
|
|
@ -233,7 +233,7 @@ void CMonitor::onConnect(bool noRule) {
|
|||
}
|
||||
|
||||
if (m_output->nonDesktop) {
|
||||
Debug::log(LOG, "Not configuring non-desktop output");
|
||||
Log::logger->log(Log::DEBUG, "Not configuring non-desktop output");
|
||||
|
||||
for (auto& [name, lease] : PROTO::lease) {
|
||||
if (!lease || m_output->getBackend() != lease->getBackend())
|
||||
|
|
@ -270,11 +270,11 @@ void CMonitor::onConnect(bool noRule) {
|
|||
applyMonitorRule(&monitorRule, true);
|
||||
|
||||
if (!m_state.commit())
|
||||
Debug::log(WARN, "state.commit() failed in CMonitor::onCommit");
|
||||
Log::logger->log(Log::WARN, "state.commit() failed in CMonitor::onCommit");
|
||||
|
||||
m_damage.setSize(m_transformedSize);
|
||||
|
||||
Debug::log(LOG, "Added new monitor with name {} at {:j0} with size {:j0}, pointer {:x}", m_output->name, m_position, m_pixelSize, rc<uintptr_t>(m_output.get()));
|
||||
Log::logger->log(Log::DEBUG, "Added new monitor with name {} at {:j0} with size {:j0}, pointer {:x}", m_output->name, m_position, m_pixelSize, rc<uintptr_t>(m_output.get()));
|
||||
|
||||
setupDefaultWS(monitorRule);
|
||||
|
||||
|
|
@ -317,18 +317,18 @@ void CMonitor::onConnect(bool noRule) {
|
|||
}
|
||||
}
|
||||
|
||||
Debug::log(LOG, "checking if we have seen this monitor before: {}", m_name);
|
||||
Log::logger->log(Log::DEBUG, "checking if we have seen this monitor before: {}", m_name);
|
||||
// if we saw this monitor before, set it to the workspace it was on
|
||||
if (g_pCompositor->m_seenMonitorWorkspaceMap.contains(m_name)) {
|
||||
auto workspaceID = g_pCompositor->m_seenMonitorWorkspaceMap[m_name];
|
||||
Debug::log(LOG, "Monitor {} was on workspace {}, setting it to that", m_name, workspaceID);
|
||||
Log::logger->log(Log::DEBUG, "Monitor {} was on workspace {}, setting it to that", m_name, workspaceID);
|
||||
auto ws = g_pCompositor->getWorkspaceByID(workspaceID);
|
||||
if (ws) {
|
||||
g_pCompositor->moveWorkspaceToMonitor(ws, m_self.lock());
|
||||
changeWorkspace(ws, true, false, false);
|
||||
}
|
||||
} else
|
||||
Debug::log(LOG, "Monitor {} was not on any workspace", m_name);
|
||||
Log::logger->log(Log::DEBUG, "Monitor {} was not on any workspace", m_name);
|
||||
|
||||
if (!found)
|
||||
Desktop::focusState()->rawMonitorFocus(m_self.lock());
|
||||
|
|
@ -360,7 +360,7 @@ void CMonitor::onDisconnect(bool destroy) {
|
|||
if (!m_enabled || g_pCompositor->m_isShuttingDown)
|
||||
return;
|
||||
|
||||
Debug::log(LOG, "onDisconnect called for {}", m_output->name);
|
||||
Log::logger->log(Log::DEBUG, "onDisconnect called for {}", m_output->name);
|
||||
|
||||
m_events.disconnect.emit();
|
||||
if (g_pHyprOpenGL)
|
||||
|
|
@ -368,7 +368,7 @@ void CMonitor::onDisconnect(bool destroy) {
|
|||
|
||||
// record what workspace this monitor was on
|
||||
if (m_activeWorkspace) {
|
||||
Debug::log(LOG, "Disconnecting Monitor {} was on workspace {}", m_name, m_activeWorkspace->m_id);
|
||||
Log::logger->log(Log::DEBUG, "Disconnecting Monitor {} was on workspace {}", m_name, m_activeWorkspace->m_id);
|
||||
g_pCompositor->m_seenMonitorWorkspaceMap[m_name] = m_activeWorkspace->m_id;
|
||||
}
|
||||
|
||||
|
|
@ -412,10 +412,10 @@ void CMonitor::onDisconnect(bool destroy) {
|
|||
}
|
||||
|
||||
std::erase_if(g_pCompositor->m_monitors, [&](PHLMONITOR& el) { return el.get() == this; });
|
||||
Debug::log(LOG, "Removed monitor {}!", m_name);
|
||||
Log::logger->log(Log::DEBUG, "Removed monitor {}!", m_name);
|
||||
|
||||
if (!BACKUPMON) {
|
||||
Debug::log(WARN, "Unplugged last monitor, entering an unsafe state. Good luck my friend.");
|
||||
Log::logger->log(Log::WARN, "Unplugged last monitor, entering an unsafe state. Good luck my friend.");
|
||||
g_pCompositor->enterUnsafeState();
|
||||
}
|
||||
|
||||
|
|
@ -453,7 +453,7 @@ void CMonitor::onDisconnect(bool destroy) {
|
|||
m_output->state->setEnabled(false);
|
||||
|
||||
if (!m_state.commit())
|
||||
Debug::log(WARN, "state.commit() failed in CMonitor::onDisconnect");
|
||||
Log::logger->log(Log::WARN, "state.commit() failed in CMonitor::onDisconnect");
|
||||
|
||||
if (Desktop::focusState()->monitor() == m_self)
|
||||
Desktop::focusState()->rawMonitorFocus(BACKUPMON ? BACKUPMON : g_pCompositor->m_unsafeOutput.lock());
|
||||
|
|
@ -560,7 +560,7 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
|
||||
static auto PDISABLESCALECHECKS = CConfigValue<Hyprlang::INT>("debug:disable_scale_checks");
|
||||
|
||||
Debug::log(LOG, "Applying monitor rule for {}", m_name);
|
||||
Log::logger->log(Log::DEBUG, "Applying monitor rule for {}", m_name);
|
||||
|
||||
m_activeMonitorRule = *pMonitorRule;
|
||||
|
||||
|
|
@ -585,7 +585,7 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
|
||||
if (!m_enabled) {
|
||||
onConnect(true); // enable it.
|
||||
Debug::log(LOG, "Monitor {} is disabled but is requested to be enabled", m_name);
|
||||
Log::logger->log(Log::DEBUG, "Monitor {} is disabled but is requested to be enabled", m_name);
|
||||
force = true;
|
||||
}
|
||||
|
||||
|
|
@ -605,7 +605,7 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
RULE->supportsWideColor == m_supportsWideColor && RULE->supportsHDR == m_supportsHDR && RULE->minLuminance == m_minLuminance && RULE->maxLuminance == m_maxLuminance &&
|
||||
RULE->maxAvgLuminance == m_maxAvgLuminance && !std::memcmp(&m_customDrmMode, &RULE->drmMode, sizeof(m_customDrmMode)) && m_reservedArea == RULE->reservedArea) {
|
||||
|
||||
Debug::log(LOG, "Not applying a new rule to {} because it's already applied!", m_name);
|
||||
Log::logger->log(Log::DEBUG, "Not applying a new rule to {} because it's already applied!", m_name);
|
||||
|
||||
setMirror(RULE->mirrorOf);
|
||||
|
||||
|
|
@ -642,7 +642,7 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
|
||||
// last fallback is always preferred mode
|
||||
if (!m_output->preferredMode())
|
||||
Debug::log(ERR, "Monitor {} has NO PREFERRED MODE", m_output->name);
|
||||
Log::logger->log(Log::ERR, "Monitor {} has NO PREFERRED MODE", m_output->name);
|
||||
else
|
||||
requestedModes.push_back(m_output->preferredMode());
|
||||
|
||||
|
|
@ -717,7 +717,7 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
// then if requested is custom, try custom mode first
|
||||
if (RULE->drmMode.type == DRM_MODE_TYPE_USERDEF) {
|
||||
if (m_output->getBackend()->type() != Aquamarine::eBackendType::AQ_BACKEND_DRM)
|
||||
Debug::log(ERR, "Tried to set custom modeline on non-DRM output");
|
||||
Log::logger->log(Log::ERR, "Tried to set custom modeline on non-DRM output");
|
||||
else
|
||||
requestedModes.push_back(makeShared<Aquamarine::SOutputMode>(
|
||||
Aquamarine::SOutputMode{.pixelSize = {RULE->drmMode.hdisplay, RULE->drmMode.vdisplay}, .refreshRate = RULE->drmMode.vrefresh, .modeInfo = RULE->drmMode}));
|
||||
|
|
@ -737,13 +737,13 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
m_drmFormat = DRM_FORMAT_XRGB8888;
|
||||
m_output->state->resetExplicitFences();
|
||||
|
||||
if (Debug::m_trace) {
|
||||
Debug::log(TRACE, "Monitor {} requested modes:", m_name);
|
||||
if (Env::isTrace()) {
|
||||
Log::logger->log(Log::TRACE, "Monitor {} requested modes:", m_name);
|
||||
if (requestedModes.empty())
|
||||
Debug::log(TRACE, "| None");
|
||||
Log::logger->log(Log::TRACE, "| None");
|
||||
else {
|
||||
for (auto const& mode : requestedModes | std::views::reverse) {
|
||||
Debug::log(TRACE, "| {:X0}@{:.2f}Hz", mode->pixelSize, mode->refreshRate / 1000.f);
|
||||
Log::logger->log(Log::TRACE, "| {:X0}@{:.2f}Hz", mode->pixelSize, mode->refreshRate / 1000.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -755,7 +755,7 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
m_output->state->setCustomMode(mode);
|
||||
|
||||
if (!m_state.test()) {
|
||||
Debug::log(ERR, "Monitor {}: REJECTED custom mode {}!", m_name, modeStr);
|
||||
Log::logger->log(Log::ERR, "Monitor {}: REJECTED custom mode {}!", m_name, modeStr);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -764,9 +764,9 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
m_output->state->setMode(mode);
|
||||
|
||||
if (!m_state.test()) {
|
||||
Debug::log(ERR, "Monitor {}: REJECTED available mode {}!", m_name, modeStr);
|
||||
Log::logger->log(Log::ERR, "Monitor {}: REJECTED available mode {}!", m_name, modeStr);
|
||||
if (mode->preferred)
|
||||
Debug::log(ERR, "Monitor {}: REJECTED preferred mode!!!", m_name);
|
||||
Log::logger->log(Log::ERR, "Monitor {}: REJECTED preferred mode!!!", m_name);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -780,11 +780,11 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
success = true;
|
||||
|
||||
if (mode->preferred)
|
||||
Debug::log(LOG, "Monitor {}: requested {}, using preferred mode {}", m_name, requestedStr, modeStr);
|
||||
Log::logger->log(Log::DEBUG, "Monitor {}: requested {}, using preferred mode {}", m_name, requestedStr, modeStr);
|
||||
else if (mode->modeInfo.has_value() && mode->modeInfo->type == DRM_MODE_TYPE_USERDEF)
|
||||
Debug::log(LOG, "Monitor {}: requested {}, using custom mode {}", m_name, requestedStr, modeStr);
|
||||
Log::logger->log(Log::DEBUG, "Monitor {}: requested {}, using custom mode {}", m_name, requestedStr, modeStr);
|
||||
else
|
||||
Debug::log(LOG, "Monitor {}: requested {}, using available mode {}", m_name, requestedStr, modeStr);
|
||||
Log::logger->log(Log::DEBUG, "Monitor {}: requested {}, using available mode {}", m_name, requestedStr, modeStr);
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -798,7 +798,7 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
m_output->state->setCustomMode(mode);
|
||||
|
||||
if (m_state.test()) {
|
||||
Debug::log(LOG, "Monitor {}: requested {}, using custom mode {}", m_name, requestedStr, modeStr);
|
||||
Log::logger->log(Log::DEBUG, "Monitor {}: requested {}, using custom mode {}", m_name, requestedStr, modeStr);
|
||||
|
||||
refreshRate = mode->refreshRate / 1000.f;
|
||||
m_size = mode->pixelSize;
|
||||
|
|
@ -807,7 +807,7 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
|
||||
success = true;
|
||||
} else
|
||||
Debug::log(ERR, "Monitor {}: REJECTED custom mode {}!", m_name, modeStr);
|
||||
Log::logger->log(Log::ERR, "Monitor {}: REJECTED custom mode {}!", m_name, modeStr);
|
||||
}
|
||||
|
||||
// try any of the modes if none of the above work
|
||||
|
|
@ -820,7 +820,7 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
|
||||
auto errorMessage = I18n::i18nEngine()->localize(I18n::TXT_KEY_NOTIF_MONITOR_MODE_FAIL,
|
||||
{{"name", m_name}, {"mode", std::format("{:X0}@{:.2f}Hz", mode->pixelSize, mode->refreshRate / 1000.f)}});
|
||||
Debug::log(WARN, errorMessage);
|
||||
Log::logger->log(Log::WARN, errorMessage);
|
||||
g_pHyprNotificationOverlay->addNotification(errorMessage, CHyprColor(0xff0000ff), 5000, ICON_WARNING);
|
||||
|
||||
m_refreshRate = mode->refreshRate / 1000.f;
|
||||
|
|
@ -835,7 +835,7 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
}
|
||||
|
||||
if (!success) {
|
||||
Debug::log(ERR, "Monitor {} has NO FALLBACK MODES, and an INVALID one was requested: {:X0}@{:.2f}Hz", m_name, RULE->resolution, RULE->refreshRate);
|
||||
Log::logger->log(Log::ERR, "Monitor {} has NO FALLBACK MODES, and an INVALID one was requested: {:X0}@{:.2f}Hz", m_name, RULE->resolution, RULE->refreshRate);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -863,9 +863,9 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
m_drmFormat = fmt.second;
|
||||
|
||||
if (!m_state.test()) {
|
||||
Debug::log(ERR, "output {} failed basic test on format {}", m_name, fmt.first);
|
||||
Log::logger->log(Log::ERR, "output {} failed basic test on format {}", m_name, fmt.first);
|
||||
} else {
|
||||
Debug::log(LOG, "output {} succeeded basic test on format {}", m_name, fmt.first);
|
||||
Log::logger->log(Log::DEBUG, "output {} succeeded basic test on format {}", m_name, fmt.first);
|
||||
if (RULE->enable10bit && fmt.first.contains("101010"))
|
||||
set10bit = true;
|
||||
break;
|
||||
|
|
@ -937,13 +937,13 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
if (autoScale)
|
||||
m_scale = std::round(scaleZero);
|
||||
else {
|
||||
Debug::log(ERR, "Invalid scale passed to monitor, {} failed to find a clean divisor", m_scale);
|
||||
Log::logger->log(Log::ERR, "Invalid scale passed to monitor, {} failed to find a clean divisor", m_scale);
|
||||
g_pConfigManager->addParseError("Invalid scale passed to monitor " + m_name + ", failed to find a clean divisor");
|
||||
m_scale = getDefaultScale();
|
||||
}
|
||||
} else {
|
||||
if (!autoScale) {
|
||||
Debug::log(ERR, "Invalid scale passed to monitor, {} found suggestion {}", m_scale, searchScale);
|
||||
Log::logger->log(Log::ERR, "Invalid scale passed to monitor, {} found suggestion {}", m_scale, searchScale);
|
||||
static auto PDISABLENOTIFICATION = CConfigValue<Hyprlang::INT>("misc:disable_scale_notification");
|
||||
if (!*PDISABLENOTIFICATION)
|
||||
g_pHyprNotificationOverlay->addNotification(
|
||||
|
|
@ -959,7 +959,7 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
m_output->scheduleFrame();
|
||||
|
||||
if (!m_state.commit())
|
||||
Debug::log(ERR, "Couldn't commit output named {}", m_output->name);
|
||||
Log::logger->log(Log::ERR, "Couldn't commit output named {}", m_output->name);
|
||||
|
||||
Vector2D xfmd = m_transform % 2 == 1 ? Vector2D{m_pixelSize.y, m_pixelSize.x} : m_pixelSize;
|
||||
m_size = (xfmd / m_scale).round();
|
||||
|
|
@ -994,8 +994,8 @@ bool CMonitor::applyMonitorRule(SMonitorRule* pMonitorRule, bool force) {
|
|||
// reload to fix mirrors
|
||||
g_pConfigManager->m_wantsMonitorReload = true;
|
||||
|
||||
Debug::log(LOG, "Monitor {} data dump: res {:X}@{:.2f}Hz, scale {:.2f}, transform {}, pos {:X}, 10b {}", m_name, m_pixelSize, m_refreshRate, m_scale, sc<int>(m_transform),
|
||||
m_position, sc<int>(m_enabled10bit));
|
||||
Log::logger->log(Log::DEBUG, "Monitor {} data dump: res {:X}@{:.2f}Hz, scale {:.2f}, transform {}, pos {:X}, 10b {}", m_name, m_pixelSize, m_refreshRate, m_scale,
|
||||
sc<int>(m_transform), m_position, sc<int>(m_enabled10bit));
|
||||
|
||||
EMIT_HOOK_EVENT("monitorLayoutChanged", nullptr);
|
||||
|
||||
|
|
@ -1090,12 +1090,12 @@ void CMonitor::setupDefaultWS(const SMonitorRule& monitorRule) {
|
|||
wsID = std::ranges::distance(g_pCompositor->getWorkspaces()) + 1;
|
||||
newDefaultWorkspaceName = std::to_string(wsID);
|
||||
|
||||
Debug::log(LOG, "Invalid workspace= directive name in monitor parsing, workspace name \"{}\" is invalid.", g_pConfigManager->getDefaultWorkspaceFor(m_name));
|
||||
Log::logger->log(Log::DEBUG, "Invalid workspace= directive name in monitor parsing, workspace name \"{}\" is invalid.", g_pConfigManager->getDefaultWorkspaceFor(m_name));
|
||||
}
|
||||
|
||||
auto PNEWWORKSPACE = g_pCompositor->getWorkspaceByID(wsID);
|
||||
|
||||
Debug::log(LOG, "New monitor: WORKSPACEID {}, exists: {}", wsID, sc<int>(PNEWWORKSPACE != nullptr));
|
||||
Log::logger->log(Log::DEBUG, "New monitor: WORKSPACEID {}, exists: {}", wsID, sc<int>(PNEWWORKSPACE != nullptr));
|
||||
|
||||
if (PNEWWORKSPACE) {
|
||||
// workspace exists, move it to the newly connected monitor
|
||||
|
|
@ -1124,12 +1124,12 @@ void CMonitor::setMirror(const std::string& mirrorOf) {
|
|||
return;
|
||||
|
||||
if (PMIRRORMON && PMIRRORMON->isMirror()) {
|
||||
Debug::log(ERR, "Cannot mirror a mirror!");
|
||||
Log::logger->log(Log::ERR, "Cannot mirror a mirror!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (PMIRRORMON == m_self) {
|
||||
Debug::log(ERR, "Cannot mirror self!");
|
||||
Log::logger->log(Log::ERR, "Cannot mirror self!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1257,7 +1257,7 @@ void CMonitor::changeWorkspace(const PHLWORKSPACE& pWorkspace, bool internal, bo
|
|||
|
||||
if (pWorkspace->m_isSpecialWorkspace) {
|
||||
if (m_activeSpecialWorkspace != pWorkspace) {
|
||||
Debug::log(LOG, "changeworkspace on special, togglespecialworkspace to id {}", pWorkspace->m_id);
|
||||
Log::logger->log(Log::DEBUG, "changeworkspace on special, togglespecialworkspace to id {}", pWorkspace->m_id);
|
||||
setSpecialWorkspace(pWorkspace);
|
||||
}
|
||||
return;
|
||||
|
|
@ -1693,7 +1693,7 @@ uint8_t CMonitor::isTearingBlocked(bool full) {
|
|||
if (!*PTEARINGENABLED) {
|
||||
reasons |= TC_USER;
|
||||
if (!full) {
|
||||
Debug::log(WARN, "Tearing commit requested but the master switch general:allow_tearing is off, ignoring");
|
||||
Log::logger->log(Log::WARN, "Tearing commit requested but the master switch general:allow_tearing is off, ignoring");
|
||||
return reasons;
|
||||
}
|
||||
}
|
||||
|
|
@ -1701,7 +1701,7 @@ uint8_t CMonitor::isTearingBlocked(bool full) {
|
|||
if (g_pHyprOpenGL->m_renderData.mouseZoomFactor != 1.0) {
|
||||
reasons |= TC_ZOOM;
|
||||
if (!full) {
|
||||
Debug::log(WARN, "Tearing commit requested but scale factor is not 1, ignoring");
|
||||
Log::logger->log(Log::WARN, "Tearing commit requested but scale factor is not 1, ignoring");
|
||||
return reasons;
|
||||
}
|
||||
}
|
||||
|
|
@ -1709,7 +1709,7 @@ uint8_t CMonitor::isTearingBlocked(bool full) {
|
|||
if (!m_tearingState.canTear) {
|
||||
reasons |= TC_SUPPORT;
|
||||
if (!full) {
|
||||
Debug::log(WARN, "Tearing commit requested but monitor doesn't support it, ignoring");
|
||||
Log::logger->log(Log::WARN, "Tearing commit requested but monitor doesn't support it, ignoring");
|
||||
return reasons;
|
||||
}
|
||||
}
|
||||
|
|
@ -1821,8 +1821,8 @@ bool CMonitor::attemptDirectScanout() {
|
|||
const auto PSURFACE = PCANDIDATE->getSolitaryResource();
|
||||
const auto params = PSURFACE->m_current.buffer->dmabuf();
|
||||
|
||||
Debug::log(TRACE, "attemptDirectScanout: surface {:x} passed, will attempt, buffer {} fmt: {} -> {} (mod {})", rc<uintptr_t>(PSURFACE.get()),
|
||||
rc<uintptr_t>(PSURFACE->m_current.buffer.m_buffer.get()), m_drmFormat, params.format, params.modifier);
|
||||
Log::logger->log(Log::TRACE, "attemptDirectScanout: surface {:x} passed, will attempt, buffer {} fmt: {} -> {} (mod {})", rc<uintptr_t>(PSURFACE.get()),
|
||||
rc<uintptr_t>(PSURFACE->m_current.buffer.m_buffer.get()), m_drmFormat, params.format, params.modifier);
|
||||
|
||||
auto PBUFFER = PSURFACE->m_current.buffer.m_buffer;
|
||||
|
||||
|
|
@ -1832,12 +1832,12 @@ bool CMonitor::attemptDirectScanout() {
|
|||
|
||||
if (m_scanoutNeedsCursorUpdate) {
|
||||
if (!m_state.test()) {
|
||||
Debug::log(TRACE, "attemptDirectScanout: failed basic test on cursor update");
|
||||
Log::logger->log(Log::TRACE, "attemptDirectScanout: failed basic test on cursor update");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_output->commit()) {
|
||||
Debug::log(TRACE, "attemptDirectScanout: failed to commit cursor update");
|
||||
Log::logger->log(Log::TRACE, "attemptDirectScanout: failed to commit cursor update");
|
||||
m_lastScanout.reset();
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1865,12 +1865,12 @@ bool CMonitor::attemptDirectScanout() {
|
|||
}
|
||||
|
||||
m_output->state->setBuffer(PBUFFER);
|
||||
Debug::log(TRACE, "attemptDirectScanout: setting presentation mode");
|
||||
Log::logger->log(Log::TRACE, "attemptDirectScanout: setting presentation mode");
|
||||
m_output->state->setPresentationMode(m_tearingState.activelyTearing ? Aquamarine::eOutputPresentationMode::AQ_OUTPUT_PRESENTATION_IMMEDIATE :
|
||||
Aquamarine::eOutputPresentationMode::AQ_OUTPUT_PRESENTATION_VSYNC);
|
||||
|
||||
if (!m_state.test()) {
|
||||
Debug::log(TRACE, "attemptDirectScanout: failed basic test");
|
||||
Log::logger->log(Log::TRACE, "attemptDirectScanout: failed basic test");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1884,14 +1884,14 @@ bool CMonitor::attemptDirectScanout() {
|
|||
bool ok = m_output->commit();
|
||||
|
||||
if (!ok) {
|
||||
Debug::log(TRACE, "attemptDirectScanout: failed to scanout surface");
|
||||
Log::logger->log(Log::TRACE, "attemptDirectScanout: failed to scanout surface");
|
||||
m_lastScanout.reset();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_lastScanout.expired()) {
|
||||
m_lastScanout = PCANDIDATE;
|
||||
Debug::log(LOG, "Entered a direct scanout to {:x}: \"{}\"", rc<uintptr_t>(PCANDIDATE.get()), PCANDIDATE->m_title);
|
||||
Log::logger->log(Log::DEBUG, "Entered a direct scanout to {:x}: \"{}\"", rc<uintptr_t>(PCANDIDATE.get()), PCANDIDATE->m_title);
|
||||
}
|
||||
|
||||
m_scanoutNeedsCursorUpdate = false;
|
||||
|
|
@ -1947,7 +1947,7 @@ void CMonitor::commitDPMSState(bool state) {
|
|||
m_output->state->setEnabled(state);
|
||||
|
||||
if (!m_state.commit()) {
|
||||
Debug::log(ERR, "Couldn't commit output {} for DPMS = {}, will retry.", m_name, state);
|
||||
Log::logger->log(Log::ERR, "Couldn't commit output {} for DPMS = {}, will retry.", m_name, state);
|
||||
|
||||
// retry in 2 frames. This could happen when the DRM backend rejects our commit
|
||||
// because disable + enable were sent almost instantly
|
||||
|
|
@ -1961,7 +1961,7 @@ void CMonitor::commitDPMSState(bool state) {
|
|||
m_output->state->resetExplicitFences();
|
||||
m_output->state->setEnabled(m_dpmsStatus);
|
||||
if (!m_state.commit()) {
|
||||
Debug::log(ERR, "Couldn't retry committing output {} for DPMS = {}", m_name, m_dpmsStatus);
|
||||
Log::logger->log(Log::ERR, "Couldn't retry committing output {} for DPMS = {}", m_name, m_dpmsStatus);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1978,8 +1978,8 @@ void CMonitor::commitDPMSState(bool state) {
|
|||
}
|
||||
|
||||
void CMonitor::debugLastPresentation(const std::string& message) {
|
||||
Debug::log(TRACE, "{} (last presentation {} - {} fps)", message, m_lastPresentationTimer.getMillis(),
|
||||
m_lastPresentationTimer.getMillis() > 0 ? 1000.0f / m_lastPresentationTimer.getMillis() : 0.0f);
|
||||
Log::logger->log(Log::TRACE, "{} (last presentation {} - {} fps)", message, m_lastPresentationTimer.getMillis(),
|
||||
m_lastPresentationTimer.getMillis() > 0 ? 1000.0f / m_lastPresentationTimer.getMillis() : 0.0f);
|
||||
}
|
||||
|
||||
void CMonitor::onCursorMovedOnMonitor() {
|
||||
|
|
@ -1991,7 +1991,7 @@ void CMonitor::onCursorMovedOnMonitor() {
|
|||
// output->state->addDamage(CRegion{});
|
||||
// output->state->setPresentationMode(Aquamarine::eOutputPresentationMode::AQ_OUTPUT_PRESENTATION_IMMEDIATE);
|
||||
// if (!output->commit())
|
||||
// Debug::log(ERR, "onCursorMovedOnMonitor: tearing and wanted to update cursor, failed.");
|
||||
// Log::logger->log(Log::ERR, "onCursorMovedOnMonitor: tearing and wanted to update cursor, failed.");
|
||||
|
||||
// FIXME: try to do the above. We currently can't just render because drm is a fucking bitch
|
||||
// and throws a "nO pRoP cAn Be ChAnGeD dUrInG AsYnC fLiP" on crtc_x
|
||||
|
|
@ -2094,7 +2094,7 @@ CMonitorState::CMonitorState(CMonitor* owner) : m_owner(owner) {
|
|||
void CMonitorState::ensureBufferPresent() {
|
||||
const auto STATE = m_owner->m_output->state->state();
|
||||
if (!STATE.enabled) {
|
||||
Debug::log(TRACE, "CMonitorState::ensureBufferPresent: Ignoring, monitor is not enabled");
|
||||
Log::logger->log(Log::TRACE, "CMonitorState::ensureBufferPresent: Ignoring, monitor is not enabled");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2105,7 +2105,7 @@ void CMonitorState::ensureBufferPresent() {
|
|||
|
||||
// this is required for modesetting being possible and might be missing in case of first tests in the renderer
|
||||
// where we test modes and buffers
|
||||
Debug::log(LOG, "CMonitorState::ensureBufferPresent: no buffer or mismatched format, attaching one from the swapchain for modeset being possible");
|
||||
Log::logger->log(Log::DEBUG, "CMonitorState::ensureBufferPresent: no buffer or mismatched format, attaching one from the swapchain for modeset being possible");
|
||||
m_owner->m_output->state->setBuffer(m_owner->m_output->swapchain->next(nullptr));
|
||||
m_owner->m_output->swapchain->rollback(); // restore the counter, don't advance the swapchain
|
||||
}
|
||||
|
|
@ -2136,7 +2136,7 @@ bool CMonitorState::updateSwapchain() {
|
|||
const auto& STATE = m_owner->m_output->state->state();
|
||||
const auto& MODE = STATE.mode ? STATE.mode : STATE.customMode;
|
||||
if (!MODE) {
|
||||
Debug::log(WARN, "updateSwapchain: No mode?");
|
||||
Log::logger->log(Log::WARN, "updateSwapchain: No mode?");
|
||||
return true;
|
||||
}
|
||||
options.format = m_owner->m_drmFormat;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue