mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-05 09:25:58 +01:00
minor fixes for new drm stuff
This commit is contained in:
parent
48bf839230
commit
60d04e196d
2 changed files with 14 additions and 2 deletions
|
@ -257,6 +257,7 @@ void CCompositor::initServer() {
|
||||||
m_bInitialized = true;
|
m_bInitialized = true;
|
||||||
|
|
||||||
m_iDRMFD = m_pAqBackend->drmFD();
|
m_iDRMFD = m_pAqBackend->drmFD();
|
||||||
|
Debug::log(LOG, "Running on DRMFD: {}", m_iDRMFD);
|
||||||
|
|
||||||
initManagers(STAGE_BASICINIT);
|
initManagers(STAGE_BASICINIT);
|
||||||
|
|
||||||
|
@ -2848,6 +2849,8 @@ void CCompositor::onNewMonitor(SP<Aquamarine::IOutput> output) {
|
||||||
if (std::string("HEADLESS-1") == output->name)
|
if (std::string("HEADLESS-1") == output->name)
|
||||||
g_pCompositor->m_pUnsafeOutput = PNEWMONITOR.get();
|
g_pCompositor->m_pUnsafeOutput = PNEWMONITOR.get();
|
||||||
|
|
||||||
|
Debug::log(LOG, "New output with name {}", output->name);
|
||||||
|
|
||||||
PNEWMONITOR->szName = output->name;
|
PNEWMONITOR->szName = output->name;
|
||||||
PNEWMONITOR->output = output;
|
PNEWMONITOR->output = output;
|
||||||
PNEWMONITOR->self = PNEWMONITOR;
|
PNEWMONITOR->self = PNEWMONITOR;
|
||||||
|
|
|
@ -1246,7 +1246,7 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
|
||||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||||
|
|
||||||
// check the damage
|
// check the damage
|
||||||
bool hasChanged = /*pMonitor->output->needs_frame ||*/ pMonitor->damage.hasChanged();
|
bool hasChanged = pMonitor->output->needsFrame || pMonitor->damage.hasChanged();
|
||||||
|
|
||||||
if (!hasChanged && *PDAMAGETRACKINGMODE != DAMAGE_TRACKING_NONE && pMonitor->forceFullFrames == 0 && damageBlinkCleanup == 0)
|
if (!hasChanged && *PDAMAGETRACKINGMODE != DAMAGE_TRACKING_NONE && pMonitor->forceFullFrames == 0 && damageBlinkCleanup == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -2601,6 +2601,15 @@ bool CHyprRenderer::beginRender(CMonitor* pMonitor, CRegion& damage, eRenderMode
|
||||||
int bufferAge = 0;
|
int bufferAge = 0;
|
||||||
|
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
|
Aquamarine::SSwapchainOptions opts = pMonitor->output->swapchain->currentOptions();
|
||||||
|
opts.length = 2;
|
||||||
|
opts.size = pMonitor->currentMode->pixelSize;
|
||||||
|
opts.format = pMonitor->drmFormat;
|
||||||
|
if (!pMonitor->output->swapchain->reconfigure(opts)) {
|
||||||
|
Debug::log(ERR, "Failed to reconfigure swapchain for {}", pMonitor->szName);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
m_pCurrentBuffer = pMonitor->output->swapchain->next(&bufferAge);
|
m_pCurrentBuffer = pMonitor->output->swapchain->next(&bufferAge);
|
||||||
if (!m_pCurrentBuffer) {
|
if (!m_pCurrentBuffer) {
|
||||||
Debug::log(ERR, "Failed to acquire swapchain buffer for {}", pMonitor->szName);
|
Debug::log(ERR, "Failed to acquire swapchain buffer for {}", pMonitor->szName);
|
||||||
|
|
Loading…
Reference in a new issue