From 589346162f82f3e6ffa8adff4cdef8a496e59811 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Thu, 15 Aug 2024 16:54:05 +0100 Subject: [PATCH] DRM: Allow checking no-crtc connectors (#49) --- include/aquamarine/backend/DRM.hpp | 2 +- src/backend/drm/DRM.cpp | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/include/aquamarine/backend/DRM.hpp b/include/aquamarine/backend/DRM.hpp index 7bb441d..8e8c677 100644 --- a/include/aquamarine/backend/DRM.hpp +++ b/include/aquamarine/backend/DRM.hpp @@ -152,7 +152,7 @@ namespace Aquamarine { struct SDRMCRTC { uint32_t id = 0; std::vector layers; - int32_t refresh = 0; + int32_t refresh = 0; // unused struct { int gammaSize = 0; diff --git a/src/backend/drm/DRM.cpp b/src/backend/drm/DRM.cpp index 67827c9..8ec9c30 100644 --- a/src/backend/drm/DRM.cpp +++ b/src/backend/drm/DRM.cpp @@ -713,10 +713,10 @@ void Aquamarine::CDRMBackend::scanConnectors() { conn->status = drmConn->connection; - if (!conn->crtc) { - backend->log(AQ_LOG_DEBUG, std::format("drm: Ignoring connector {} because it has no CRTC", connectorID)); - continue; - } + // if (!conn->crtc) { + // backend->log(AQ_LOG_DEBUG, std::format("drm: Ignoring connector {} because it has no CRTC", connectorID)); + // continue; + // } backend->log(AQ_LOG_DEBUG, std::format("drm: Connector {} connection state: {}", connectorID, (int)drmConn->connection)); @@ -1163,7 +1163,7 @@ void Aquamarine::SDRMConnector::connect(drmModeConnector* connector) { return; } - backend->backend->log(AQ_LOG_DEBUG, std::format("drm: Connecting connector {}, CRTC ID {}", szName, crtc ? crtc->id : -1)); + backend->backend->log(AQ_LOG_DEBUG, std::format("drm: Connecting connector {}, {}", szName, crtc ? std::format("CRTC ID {}", crtc->id) : "no CRTC")); output = SP(new CDRMOutput(szName, backend, self.lock())); output->self = output; @@ -1197,8 +1197,6 @@ void Aquamarine::SDRMConnector::connect(drmModeConnector* connector) { //uint64_t modeID = 0; // getDRMProp(backend->gpu->fd, crtc->id, crtc->props.mode_id, &modeID); - - crtc->refresh = calculateRefresh(drmMode); } backend->backend->log(AQ_LOG_DEBUG, @@ -1206,10 +1204,8 @@ void Aquamarine::SDRMConnector::connect(drmModeConnector* connector) { aqMode->preferred ? " (preferred)" : "")); } - if (!currentModeInfo && fallbackMode) { + if (!currentModeInfo && fallbackMode) output->state->setMode(fallbackMode); - crtc->refresh = calculateRefresh(fallbackMode->modeInfo.value()); - } output->physicalSize = {(double)connector->mmWidth, (double)connector->mmHeight};