This commit is contained in:
Vaxry 2024-10-13 01:13:30 +01:00
parent bb05b4ebcd
commit 24d5c614e2
2 changed files with 13 additions and 4 deletions

View file

@ -168,6 +168,7 @@ namespace Aquamarine {
Hyprutils::Memory::CSharedPointer<SDRMPlane> primary; Hyprutils::Memory::CSharedPointer<SDRMPlane> primary;
Hyprutils::Memory::CSharedPointer<SDRMPlane> cursor; Hyprutils::Memory::CSharedPointer<SDRMPlane> cursor;
std::vector<Hyprutils::Memory::CSharedPointer<SDRMPlane>> planes; // other planes go here
Hyprutils::Memory::CWeakPointer<CDRMBackend> backend; Hyprutils::Memory::CWeakPointer<CDRMBackend> backend;
Hyprutils::Memory::CSharedPointer<CDRMFB> pendingCursor; Hyprutils::Memory::CSharedPointer<CDRMFB> pendingCursor;

View file

@ -1023,11 +1023,19 @@ bool Aquamarine::SDRMPlane::init(drmModePlane* plane) {
auto CRTC = backend->crtcs.at(i); auto CRTC = backend->crtcs.at(i);
if (type == DRM_PLANE_TYPE_PRIMARY && !CRTC->primary) { if (type == DRM_PLANE_TYPE_PRIMARY && !CRTC->primary) {
CRTC->primary = self.lock(); CRTC->primary = self.lock();
TRACE(backend->backend->log(AQ_LOG_TRACE, std::format("drm: CRTC {} gets assigned plane {} as primary", CRTC->id, id)));
break; break;
} }
if (type == DRM_PLANE_TYPE_CURSOR && !CRTC->cursor) { if (type == DRM_PLANE_TYPE_CURSOR && !CRTC->cursor) {
CRTC->cursor = self.lock(); 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; break;
} }
} }