stuff for aq alloc split

This commit is contained in:
Vaxry 2024-07-09 14:11:07 +02:00
parent 8b40a45be0
commit 40fed3a72d
7 changed files with 34 additions and 24 deletions

View File

@ -553,7 +553,7 @@ CConfigManager::CConfigManager() {
m_pConfig->addConfigValue("group:groupbar:col.inactive", Hyprlang::CConfigCustomValueType{&configHandleGradientSet, configHandleGradientDestroy, "0x66777700"});
m_pConfig->addConfigValue("group:groupbar:col.locked_active", Hyprlang::CConfigCustomValueType{&configHandleGradientSet, configHandleGradientDestroy, "0x66ff5500"});
m_pConfig->addConfigValue("group:groupbar:col.locked_inactive", Hyprlang::CConfigCustomValueType{&configHandleGradientSet, configHandleGradientDestroy, "0x66775500"});
m_pConfig->addConfigValue("experimental:explicit_sync", Hyprlang::INT{0});
// devices

View File

@ -811,9 +811,10 @@ bool CMonitorState::updateSwapchain() {
const auto& MODE = STATE.mode ? STATE.mode : STATE.customMode;
if (!MODE)
return true;
options.format = STATE.drmFormat;
options.scanout = true;
options.length = 2;
options.size = MODE->pixelSize;
options.format = STATE.drmFormat;
options.scanout = true;
options.length = 2;
options.size = MODE->pixelSize;
options.multigpu = m_pOwner->output->swapchain->getAllocator()->drmFD() != g_pCompositor->m_iDRMFD;
return m_pOwner->output->swapchain->reconfigure(options);
}

View File

@ -367,13 +367,14 @@ SP<Aquamarine::IBuffer> CPointerManager::renderHWCursorBuffer(SP<CPointerManager
if (!state->monitor->cursorSwapchain || maxSize != state->monitor->cursorSwapchain->currentOptions().size) {
if (!state->monitor->cursorSwapchain)
state->monitor->cursorSwapchain = Aquamarine::CSwapchain::create(g_pCompositor->m_pAqBackend->allocator, state->monitor->output->getBackend());
state->monitor->cursorSwapchain = Aquamarine::CSwapchain::create(state->monitor->output->getBackend()->preferredAllocator(), state->monitor->output->getBackend());
auto options = state->monitor->cursorSwapchain->currentOptions();
options.size = maxSize;
options.length = 2;
options.scanout = true;
options.cursor = true;
auto options = state->monitor->cursorSwapchain->currentOptions();
options.size = maxSize;
options.length = 2;
options.scanout = true;
options.cursor = true;
options.multigpu = state->monitor->output->getBackend()->preferredAllocator()->drmFD() != g_pCompositor->m_iDRMFD;
// We do not set the format. If it's unset (DRM_FORMAT_INVALID) then the swapchain will pick for us,
// but if it's set, we don't wanna change it.
@ -455,7 +456,8 @@ void CPointerManager::renderSoftwareCursorsFor(SP<CMonitor> pMonitor, timespec*
Vector2D CPointerManager::getCursorPosForMonitor(SP<CMonitor> pMonitor) {
return CBox{pointerPos - pMonitor->vecPosition, {0, 0}}
.transform(wlTransformToHyprutils(invertTransform(pMonitor->transform)), pMonitor->vecTransformedSize.x / pMonitor->scale, pMonitor->vecTransformedSize.y / pMonitor->scale)
.transform(wlTransformToHyprutils(invertTransform(pMonitor->transform)), pMonitor->vecTransformedSize.x / pMonitor->scale,
pMonitor->vecTransformedSize.y / pMonitor->scale)
.pos() *
pMonitor->scale;
}

View File

@ -48,7 +48,7 @@ class CEventLoopManager {
int timerfd = -1;
} m_sTimers;
SIdleData m_sIdle;
SIdleData m_sIdle;
std::vector<SP<Aquamarine::SPollFD>> aqPollFDs;
friend class CSyncTimeline;

View File

@ -21,7 +21,7 @@ class CViewportResource {
SP<CWpViewport> resource;
struct {
CHyprSignalListener surfacePrecommit;
CHyprSignalListener surfacePrecommit;
} listeners;
};

View File

@ -521,7 +521,8 @@ GLuint CHyprOpenGLImpl::compileShader(const GLuint& type, std::string src, bool
}
bool CHyprOpenGLImpl::passRequiresIntrospection(CMonitor* pMonitor) {
// passes requiring introspection are the ones that need to render blur.
// passes requiring introspection are the ones that need to render blur,
// or when we are rendering to a multigpu target
static auto PBLUR = CConfigValue<Hyprlang::INT>("decoration:blur:enabled");
static auto PXRAY = CConfigValue<Hyprlang::INT>("decoration:blur:xray");
@ -529,6 +530,12 @@ bool CHyprOpenGLImpl::passRequiresIntrospection(CMonitor* pMonitor) {
static auto PBLURSPECIAL = CConfigValue<Hyprlang::INT>("decoration:blur:special");
static auto PBLURPOPUPS = CConfigValue<Hyprlang::INT>("decoration:blur:popups");
// multigpu destination
if (pMonitor->output->swapchain->getAllocator()->drmFD() != g_pCompositor->m_iDRMFD) {
Debug::log(TRACE, "passRequiresIntrospection: multigpu target, forcing");
return true;
}
if (m_RenderData.mouseZoomFactor != 1.0 || g_pHyprRenderer->m_bCrashingInProgress)
return true;
@ -2752,7 +2759,7 @@ SP<CEGLSync> CHyprOpenGLImpl::createEGLSync(int fenceFD) {
return nullptr;
}
auto eglsync = SP<CEGLSync>(new CEGLSync);
auto eglsync = SP<CEGLSync>(new CEGLSync);
eglsync->sync = sync;
return eglsync;
}

View File

@ -88,16 +88,16 @@ class CHyprRenderer {
DAMAGETRACKINGMODES
damageTrackingModeFromStr(const std::string&);
bool attemptDirectScanout(CMonitor*);
void setSurfaceScanoutMode(SP<CWLSurfaceResource> surface, SP<CMonitor> monitor); // nullptr monitor resets
void initiateManualCrash();
bool attemptDirectScanout(CMonitor*);
void setSurfaceScanoutMode(SP<CWLSurfaceResource> surface, SP<CMonitor> monitor); // nullptr monitor resets
void initiateManualCrash();
bool m_bCrashingInProgress = false;
float m_fCrashingDistort = 0.5f;
wl_event_source* m_pCrashingLoop = nullptr;
wl_event_source* m_pCursorTicker = nullptr;
bool m_bCrashingInProgress = false;
float m_fCrashingDistort = 0.5f;
wl_event_source* m_pCrashingLoop = nullptr;
wl_event_source* m_pCursorTicker = nullptr;
CTimer m_tRenderTimer;
CTimer m_tRenderTimer;
std::vector<SP<CWLSurfaceResource>> explicitPresented;