Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
4462ecf6
Commit
4462ecf6
authored
Oct 25, 2020
by
Xaver Hugl
Committed by
Vlad Zahorodnii
Oct 25, 2020
Browse files
Detect some DrmConnector properties and ignore non-desktop displays
BUG: 419032
parent
9cbac6fe
Changes
5
Hide whitespace changes
Inline
Side-by-side
plugins/platforms/drm/drm_gpu.cpp
View file @
4462ecf6
...
...
@@ -135,6 +135,10 @@ bool DrmGpu::updateOutputs()
delete
c
;
continue
;
}
if
(
c
->
isNonDesktop
())
{
delete
c
;
continue
;
}
m_connectors
<<
c
;
}
else
{
oldConnectors
.
removeOne
(
*
it
);
...
...
plugins/platforms/drm/drm_object.cpp
View file @
4462ecf6
...
...
@@ -47,7 +47,7 @@ void DrmObject::initProp(int n, drmModeObjectProperties *properties, QVector<QBy
}
if
(
prop
->
name
==
m_propsNames
[
n
])
{
qCDebug
(
KWIN_DRM
).
nospace
()
<<
m_id
<<
": "
<<
prop
->
name
<<
"' (id "
<<
prop
->
prop_id
qCDebug
(
KWIN_DRM
).
nospace
()
<<
m_id
<<
":
'
"
<<
prop
->
name
<<
"' (id "
<<
prop
->
prop_id
<<
"): "
<<
properties
->
prop_values
[
i
];
m_props
[
n
]
=
new
Property
(
prop
.
data
(),
properties
->
prop_values
[
i
],
enumNames
);
return
;
...
...
@@ -67,7 +67,7 @@ bool DrmObject::doAtomicPopulate(drmModeAtomicReq *req, int firstProperty) const
for
(
int
i
=
firstProperty
;
i
<
m_props
.
size
();
i
++
)
{
auto
property
=
m_props
.
at
(
i
);
if
(
!
property
)
{
if
(
!
property
||
property
->
isImmutable
()
)
{
continue
;
}
ret
&=
atomicAddProperty
(
req
,
property
);
...
...
@@ -113,6 +113,7 @@ DrmObject::Property::Property(drmModePropertyRes *prop, uint64_t val, QVector<QB
:
m_propId
(
prop
->
prop_id
)
,
m_propName
(
prop
->
name
)
,
m_value
(
val
)
,
m_immutable
(
prop
->
flags
&
DRM_MODE_PROP_IMMUTABLE
)
{
if
(
!
enumNames
.
isEmpty
())
{
qCDebug
(
KWIN_DRM
)
<<
m_propName
<<
" can have enums:"
<<
enumNames
;
...
...
plugins/platforms/drm/drm_object.h
View file @
4462ecf6
...
...
@@ -122,6 +122,9 @@ protected:
const
QByteArray
&
name
()
const
{
return
m_propName
;
}
bool
isImmutable
()
const
{
return
m_immutable
;
}
private:
uint32_t
m_propId
=
0
;
...
...
@@ -130,6 +133,7 @@ protected:
uint64_t
m_value
=
0
;
QVector
<
uint64_t
>
m_enumMap
;
QVector
<
QByteArray
>
m_enumNames
;
bool
m_immutable
=
false
;
};
private:
...
...
plugins/platforms/drm/drm_object_connector.cpp
View file @
4462ecf6
...
...
@@ -41,6 +41,7 @@ bool DrmConnector::initProps()
{
setPropertyNames
(
{
QByteArrayLiteral
(
"CRTC_ID"
),
QByteArrayLiteral
(
"non-desktop"
)
});
DrmScopedPointer
<
drmModeObjectProperties
>
properties
(
...
...
plugins/platforms/drm/drm_object_connector.h
View file @
4462ecf6
...
...
@@ -25,6 +25,7 @@ public:
enum
class
PropertyIndex
{
CrtcId
=
0
,
NonDesktop
=
1
,
Count
};
...
...
@@ -34,8 +35,10 @@ public:
bool
initProps
()
override
;
bool
isConnected
();
bool
isNonDesktop
()
const
{
return
m_props
.
at
(
static_cast
<
int
>
(
PropertyIndex
::
NonDesktop
))
->
value
();
}
private:
QVector
<
uint32_t
>
m_encoders
;
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment