aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/managers/ProtocolManager.cpp
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-07-21 13:09:54 +0200
committerGitHub <[email protected]>2024-07-21 13:09:54 +0200
commit016da234d0e852de3ef20eb2e89ac58d2a85f6e7 (patch)
tree496085987176551b0794fffc069877d44943e2f1 /src/managers/ProtocolManager.cpp
parentf642fb97df5c69267a03452533de383ff8023570 (diff)
downloadHyprland-016da234d0e852de3ef20eb2e89ac58d2a85f6e7.tar.gz
Hyprland-016da234d0e852de3ef20eb2e89ac58d2a85f6e7.zip
Core: Move to aquamarine (#6608)
Moves Hyprland from wlroots to aquamarine for the backend. --------- Signed-off-by: Vaxry <[email protected]> Co-authored-by: Mihai Fufezan <[email protected]> Co-authored-by: Jan Beich <[email protected]> Co-authored-by: vaxerski <[email protected]> Co-authored-by: UjinT34 <[email protected]> Co-authored-by: Tom Englund <[email protected]> Co-authored-by: Ikalco <[email protected]> Co-authored-by: diniamo <[email protected]>
Diffstat (limited to 'src/managers/ProtocolManager.cpp')
-rw-r--r--src/managers/ProtocolManager.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/managers/ProtocolManager.cpp b/src/managers/ProtocolManager.cpp
index 74cebd0c..387cac8f 100644
--- a/src/managers/ProtocolManager.cpp
+++ b/src/managers/ProtocolManager.cpp
@@ -1,5 +1,7 @@
#include "ProtocolManager.hpp"
+#include "../config/ConfigValue.hpp"
+
#include "../protocols/TearingControl.hpp"
#include "../protocols/FractionalScale.hpp"
#include "../protocols/XDGOutput.hpp"
@@ -35,6 +37,8 @@
#include "../protocols/Viewporter.hpp"
#include "../protocols/MesaDRM.hpp"
#include "../protocols/LinuxDMABUF.hpp"
+#include "../protocols/DRMLease.hpp"
+#include "../protocols/DRMSyncobj.hpp"
#include "../protocols/core/Seat.hpp"
#include "../protocols/core/DataDevice.hpp"
@@ -45,6 +49,10 @@
#include "../helpers/Monitor.hpp"
#include "../render/Renderer.hpp"
+#include "../Compositor.hpp"
+
+#include <aquamarine/buffer/Buffer.hpp>
+#include <aquamarine/backend/Backend.hpp>
void CProtocolManager::onMonitorModeChange(CMonitor* pMonitor) {
const bool ISMIRROR = pMonitor->isMirror();
@@ -65,6 +73,8 @@ void CProtocolManager::onMonitorModeChange(CMonitor* pMonitor) {
CProtocolManager::CProtocolManager() {
+ static const auto PENABLEEXPLICIT = CConfigValue<Hyprlang::INT>("experimental:explicit_sync");
+
// Outputs are a bit dumb, we have to agree.
static auto P = g_pHookSystem->hookDynamic("monitorAdded", [this](void* self, SCallbackInfo& info, std::any param) {
auto M = std::any_cast<CMonitor*>(param);
@@ -131,6 +141,16 @@ CProtocolManager::CProtocolManager() {
PROTO::primarySelection = std::make_unique<CPrimarySelectionProtocol>(&zwp_primary_selection_device_manager_v1_interface, 1, "PrimarySelection");
PROTO::xwaylandShell = std::make_unique<CXWaylandShellProtocol>(&xwayland_shell_v1_interface, 1, "XWaylandShell");
+ for (auto& b : g_pCompositor->m_pAqBackend->getImplementations()) {
+ if (b->type() != Aquamarine::AQ_BACKEND_DRM)
+ continue;
+
+ PROTO::lease = std::make_unique<CDRMLeaseProtocol>(&wp_drm_lease_device_v1_interface, 1, "DRMLease");
+ if (*PENABLEEXPLICIT)
+ PROTO::sync = std::make_unique<CDRMSyncobjProtocol>(&wp_linux_drm_syncobj_manager_v1_interface, 1, "DRMSyncobj");
+ break;
+ }
+
if (g_pHyprOpenGL->getDRMFormats().size() > 0) {
PROTO::mesaDRM = std::make_unique<CMesaDRMProtocol>(&wl_drm_interface, 2, "MesaDRM");
PROTO::linuxDma = std::make_unique<CLinuxDMABufV1Protocol>(&zwp_linux_dmabuf_v1_interface, 5, "LinuxDMABUF");