summaryrefslogtreecommitdiff
path: root/src/managers/ProtocolManager.cpp
diff options
context:
space:
mode:
authorJoel-Valenciano <12839406+Joel-Valenciano@users.noreply.github.com>2025-06-13 08:17:32 -0500
committerGitHub <noreply@github.com>2025-06-13 15:17:32 +0200
commitad85406220d88c3de9ceba32f17a25caf101bb45 (patch)
tree217258fcecf142658bed4be36135c37a95477e1f /src/managers/ProtocolManager.cpp
parentd14f81e6ac3debd57f8e3e70ead5bb52606a8c90 (diff)
drm-lease: Add Multi-GPU Support (#10099)
Diffstat (limited to 'src/managers/ProtocolManager.cpp')
-rw-r--r--src/managers/ProtocolManager.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/managers/ProtocolManager.cpp b/src/managers/ProtocolManager.cpp
index 4748debf..f0268720 100644
--- a/src/managers/ProtocolManager.cpp
+++ b/src/managers/ProtocolManager.cpp
@@ -203,10 +203,14 @@ CProtocolManager::CProtocolManager() {
if (b->type() != Aquamarine::AQ_BACKEND_DRM)
continue;
- PROTO::lease = makeUnique<CDRMLeaseProtocol>(&wp_drm_lease_device_v1_interface, 1, "DRMLease");
- if (*PENABLEEXPLICIT)
+ auto lease = makeShared<CDRMLeaseProtocol>(&wp_drm_lease_device_v1_interface, 1, "DRMLease", b);
+ if (lease->good())
+ PROTO::lease.emplace(lease->getDeviceName(), lease);
+ else
+ lease.reset();
+
+ if (*PENABLEEXPLICIT && !PROTO::sync)
PROTO::sync = makeUnique<CDRMSyncobjProtocol>(&wp_linux_drm_syncobj_manager_v1_interface, 1, "DRMSyncobj");
- break;
}
if (!g_pHyprOpenGL->getDRMFormats().empty()) {
@@ -281,7 +285,9 @@ CProtocolManager::~CProtocolManager() {
PROTO::xdgTag.reset();
PROTO::xdgBell.reset();
- PROTO::lease.reset();
+ for (auto& [_, lease] : PROTO::lease) {
+ lease.reset();
+ }
PROTO::sync.reset();
PROTO::mesaDRM.reset();
PROTO::linuxDma.reset();