From 24d5c614e256a2bf0a48c42f51c898cbdc8490ea Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 13 Oct 2024 01:13:30 +0100 Subject: [PATCH] stuf --- include/aquamarine/backend/DRM.hpp | 9 +++++---- src/backend/drm/DRM.cpp | 8 ++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/aquamarine/backend/DRM.hpp b/include/aquamarine/backend/DRM.hpp index 40ea97a..213312b 100644 --- a/include/aquamarine/backend/DRM.hpp +++ b/include/aquamarine/backend/DRM.hpp @@ -166,10 +166,11 @@ namespace Aquamarine { uint32_t ctm = 0; } atomic; - Hyprutils::Memory::CSharedPointer primary; - Hyprutils::Memory::CSharedPointer cursor; - Hyprutils::Memory::CWeakPointer backend; - Hyprutils::Memory::CSharedPointer pendingCursor; + Hyprutils::Memory::CSharedPointer primary; + Hyprutils::Memory::CSharedPointer cursor; + std::vector> planes; // other planes go here + Hyprutils::Memory::CWeakPointer backend; + Hyprutils::Memory::CSharedPointer pendingCursor; union UDRMCRTCProps { struct { diff --git a/src/backend/drm/DRM.cpp b/src/backend/drm/DRM.cpp index 4176083..d62c516 100644 --- a/src/backend/drm/DRM.cpp +++ b/src/backend/drm/DRM.cpp @@ -1023,11 +1023,19 @@ bool Aquamarine::SDRMPlane::init(drmModePlane* plane) { auto CRTC = backend->crtcs.at(i); if (type == DRM_PLANE_TYPE_PRIMARY && !CRTC->primary) { CRTC->primary = self.lock(); + TRACE(backend->backend->log(AQ_LOG_TRACE, std::format("drm: CRTC {} gets assigned plane {} as primary", CRTC->id, id))); break; } if (type == DRM_PLANE_TYPE_CURSOR && !CRTC->cursor) { CRTC->cursor = self.lock(); + TRACE(backend->backend->log(AQ_LOG_TRACE, std::format("drm: CRTC {} gets assigned plane {} as cursor", CRTC->id, id))); + break; + } + + if (std::find(CRTC->planes.begin(), CRTC->planes.end(), self) == CRTC->planes.end()) { + CRTC->planes.emplace_back(self.lock()); + TRACE(backend->backend->log(AQ_LOG_TRACE, std::format("drm: CRTC {} gets added plane {} as general-purpose misc", CRTC->id, id))); break; } }