Commit 71a58231 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

backends/drm: Make DrmOutput::queueChanges() not touch active status

The DrmOutput synchronizes the enabled state with the active state,
which makes sense on one hand, but on the other hand, that's not good.
The drm backend makes a decision that should be ideally made by either
kscreen (turn on outputs before applying an output config), user, or
kwin itself.

This would also allow kwin to control the allocation of crtcs for
non-desktop outputs, which is a minor thing, but it might be useful in
the future.
parent 0fc4bf7f
Pipeline #209284 passed with stage
in 30 minutes and 7 seconds
......@@ -726,7 +726,7 @@ bool DrmGpu::maybeModeset()
}
}
bool presentPendingForAll = std::all_of(pipelines.constBegin(), pipelines.constEnd(), [](const auto &pipeline) {
return pipeline->modesetPresentPending() || !pipeline->active();
return pipeline->modesetPresentPending() || !pipeline->activePending();
});
if (!presentPendingForAll) {
// commit only once all pipelines are ready for presentation
......
......@@ -397,7 +397,6 @@ bool DrmOutput::queueChanges(const OutputConfiguration &config)
static int envOnlySoftwareRotations = qEnvironmentVariableIntValue("KWIN_DRM_SW_ROTATIONS_ONLY", &valid) == 1 || !valid;
const auto props = config.constChangeSet(this);
m_pipeline->setActive(props->enabled);
const auto modelist = m_connector->modes();
const auto it = std::find_if(modelist.begin(), modelist.end(), [&props](const auto &mode) {
return mode->size() == props->modeSize && mode->refreshRate() == props->refreshRate;
......
......@@ -371,9 +371,6 @@ bool DrmPipeline::moveCursor()
void DrmPipeline::applyPendingChanges()
{
if (!m_pending.crtc) {
m_pending.active = false;
}
m_next = m_pending;
}
......
......@@ -103,6 +103,7 @@ public:
DrmCrtc *crtc() const;
std::shared_ptr<DrmConnectorMode> mode() const;
bool active() const;
bool activePending() const;
bool enabled() const;
DrmPipelineLayer *primaryLayer() const;
DrmOverlayLayer *cursorLayer() const;
......@@ -133,7 +134,6 @@ public:
static Error commitPipelines(const QVector<DrmPipeline *> &pipelines, CommitMode mode, const QVector<DrmObject *> &unusedObjects = {});
private:
bool activePending() const;
bool isBufferForDirectScanout() const;
uint32_t calculateUnderscan();
static Error errnoToError();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment