mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-13 08:05:58 +01:00
swapchain test stuff
This commit is contained in:
parent
805a054389
commit
1fcb8cc162
1 changed files with 11 additions and 1 deletions
|
@ -802,6 +802,14 @@ bool CMonitorState::commit() {
|
||||||
bool CMonitorState::test() {
|
bool CMonitorState::test() {
|
||||||
if (!updateSwapchain())
|
if (!updateSwapchain())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// if it has no buffer, attach one from the swapchain to test it
|
||||||
|
if (!m_pOwner->output->state->state().buffer) {
|
||||||
|
Debug::log(LOG, "CMonitorState::test: no buffer, attaching one from the swapchain for modeset being possible");
|
||||||
|
m_pOwner->output->state->setBuffer(m_pOwner->output->swapchain->next(nullptr));
|
||||||
|
m_pOwner->output->swapchain->rollback(); // restore the counter, don't advance the swapchain
|
||||||
|
}
|
||||||
|
|
||||||
return m_pOwner->output->test();
|
return m_pOwner->output->test();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -809,8 +817,10 @@ bool CMonitorState::updateSwapchain() {
|
||||||
auto options = m_pOwner->output->swapchain->currentOptions();
|
auto options = m_pOwner->output->swapchain->currentOptions();
|
||||||
const auto& STATE = m_pOwner->output->state->state();
|
const auto& STATE = m_pOwner->output->state->state();
|
||||||
const auto& MODE = STATE.mode ? STATE.mode : STATE.customMode;
|
const auto& MODE = STATE.mode ? STATE.mode : STATE.customMode;
|
||||||
if (!MODE)
|
if (!MODE) {
|
||||||
|
Debug::log(WARN, "updateSwapchain: No mode?");
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
options.format = STATE.drmFormat;
|
options.format = STATE.drmFormat;
|
||||||
options.scanout = true;
|
options.scanout = true;
|
||||||
options.length = 2;
|
options.length = 2;
|
||||||
|
|
Loading…
Reference in a new issue