Skip to content

Commit

Permalink
stuf
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Oct 13, 2024
1 parent bb05b4e commit 24d5c61
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 5 additions & 4 deletions include/aquamarine/backend/DRM.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,11 @@ namespace Aquamarine {
uint32_t ctm = 0;
} atomic;

Hyprutils::Memory::CSharedPointer<SDRMPlane> primary;
Hyprutils::Memory::CSharedPointer<SDRMPlane> cursor;
Hyprutils::Memory::CWeakPointer<CDRMBackend> backend;
Hyprutils::Memory::CSharedPointer<CDRMFB> pendingCursor;
Hyprutils::Memory::CSharedPointer<SDRMPlane> primary;
Hyprutils::Memory::CSharedPointer<SDRMPlane> cursor;
std::vector<Hyprutils::Memory::CSharedPointer<SDRMPlane>> planes; // other planes go here
Hyprutils::Memory::CWeakPointer<CDRMBackend> backend;
Hyprutils::Memory::CSharedPointer<CDRMFB> pendingCursor;

union UDRMCRTCProps {
struct {
Expand Down
8 changes: 8 additions & 0 deletions src/backend/drm/DRM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 24d5c61

Please sign in to comment.