platforms/drm: Rename DrmCrtc::resIndex()

The value that the DrmCrtc::resIndex() function returns is better known
as "pipe index." This change renames the method to match the terminology
used by kernel developers and other compositor developers.
This commit is contained in:
Vlad Zahorodnii 2021-04-01 14:28:18 +03:00
parent 53796aacb2
commit dd9a1e5320
4 changed files with 11 additions and 12 deletions

View file

@ -235,7 +235,7 @@ bool DrmGpu::updateOutputs()
continue;
}
for (DrmCrtc *crtc : qAsConst(m_crtcs)) {
if (!(encoder->possible_crtcs & (1 << crtc->resIndex()))) {
if (!(encoder->possible_crtcs & (1 << crtc->pipeIndex()))) {
continue;
}
@ -321,7 +321,7 @@ DrmPlane *DrmGpu::getCompatiblePlane(DrmPlane::TypeIndex typeIndex, DrmCrtc *crt
if (plane->type() != typeIndex) {
continue;
}
if (plane->isCrtcSupported(crtc->resIndex())) {
if (plane->isCrtcSupported(crtc->pipeIndex())) {
m_unusedPlanes.removeOne(plane);
return plane;
}

View file

@ -17,10 +17,10 @@
namespace KWin
{
DrmCrtc::DrmCrtc(DrmGpu *gpu, uint32_t crtcId, int resIndex)
DrmCrtc::DrmCrtc(DrmGpu *gpu, uint32_t crtcId, int pipeIndex)
: DrmObject(gpu, crtcId)
, m_crtc(drmModeGetCrtc(gpu->fd(), crtcId))
, m_resIndex(resIndex)
, m_pipeIndex(pipeIndex)
{
}
@ -29,7 +29,7 @@ bool DrmCrtc::init()
if (!m_crtc) {
return false;
}
qCDebug(KWIN_DRM) << "Init for CRTC:" << resIndex() << "id:" << id();
qCDebug(KWIN_DRM) << "Init for CRTC:" << pipeIndex() << "id:" << id();
return initProps({
PropertyDefinition(QByteArrayLiteral("MODE_ID")),
PropertyDefinition(QByteArrayLiteral("ACTIVE")),

View file

@ -25,7 +25,7 @@ class DrmGpu;
class DrmCrtc : public DrmObject
{
public:
DrmCrtc(DrmGpu *gpu, uint32_t crtcId, int resIndex);
DrmCrtc(DrmGpu *gpu, uint32_t crtcId, int pipeIndex);
bool init() override;
@ -35,8 +35,8 @@ public:
Count
};
int resIndex() const {
return m_resIndex;
int pipeIndex() const {
return m_pipeIndex;
}
QSharedPointer<DrmBuffer> current() {
@ -59,11 +59,10 @@ public:
private:
DrmScopedPointer<drmModeCrtc> m_crtc;
int m_resIndex;
QSharedPointer<DrmBuffer> m_currentBuffer;
QSharedPointer<DrmBuffer> m_nextBuffer;
DrmDumbBuffer *m_blackBuffer = nullptr;
int m_pipeIndex;
};
}

View file

@ -64,8 +64,8 @@ public:
bool init() override;
TypeIndex type();
bool isCrtcSupported(int resIndex) const {
return (m_possibleCrtcs & (1 << resIndex));
bool isCrtcSupported(int pipeIndex) const {
return (m_possibleCrtcs & (1 << pipeIndex));
}
QVector<uint32_t> formats() const {
return m_formats;