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
031924b4
Commit
031924b4
authored
Jan 26, 2021
by
Xaver Hugl
Browse files
Also initialize properties when not using AMS
BUG: 431981
(cherry picked from commit
9f4a1433
)
parent
823eb4a5
Changes
9
Hide whitespace changes
Inline
Side-by-side
autotests/drm/objecttest.cpp
View file @
031924b4
...
...
@@ -18,7 +18,7 @@ public:
{
}
~
MockDrmObject
()
override
{}
bool
atomicI
nit
()
override
;
bool
i
nit
()
override
;
bool
initProps
()
override
;
void
setProperties
(
uint32_t
count
,
uint32_t
*
props
,
uint64_t
*
values
)
{
...
...
@@ -49,7 +49,7 @@ private:
uint64_t
*
m_values
=
nullptr
;
};
bool
MockDrmObject
::
atomicI
nit
()
bool
MockDrmObject
::
i
nit
()
{
return
initProps
();
}
...
...
@@ -186,7 +186,7 @@ void ObjectTest::testInitProperties()
}
});
object
.
atomicI
nit
();
object
.
i
nit
();
// verify the names
QCOMPARE
(
object
.
name
(
0
),
QByteArrayLiteral
(
"foo"
));
...
...
plugins/platforms/drm/drm_gpu.cpp
View file @
031924b4
...
...
@@ -101,7 +101,7 @@ void DrmGpu::tryAMS()
for
(
unsigned
int
i
=
0
;
i
<
planeResources
->
count_planes
;
++
i
)
{
DrmScopedPointer
<
drmModePlane
>
kplane
(
drmModeGetPlane
(
m_fd
,
planeResources
->
planes
[
i
]));
DrmPlane
*
p
=
new
DrmPlane
(
kplane
->
plane_id
,
m_fd
);
if
(
p
->
atomicI
nit
())
{
if
(
p
->
i
nit
())
{
planes
<<
p
;
if
(
p
->
type
()
==
DrmPlane
::
TypeIndex
::
Overlay
)
{
overlayPlanes
<<
p
;
...
...
@@ -146,15 +146,13 @@ bool DrmGpu::updateOutputs()
auto
it
=
std
::
find_if
(
m_connectors
.
constBegin
(),
m_connectors
.
constEnd
(),
[
currentConnector
]
(
DrmConnector
*
c
)
{
return
c
->
id
()
==
currentConnector
;
});
if
(
it
==
m_connectors
.
constEnd
())
{
auto
c
=
new
DrmConnector
(
currentConnector
,
m_fd
);
if
(
m_atomicModeSetting
)
{
if
(
!
c
->
atomicInit
())
{
delete
c
;
continue
;
}
if
(
c
->
isNonDesktop
())
{
delete
c
;
continue
;
}
if
(
!
c
->
init
())
{
delete
c
;
continue
;
}
if
(
c
->
isNonDesktop
())
{
delete
c
;
continue
;
}
m_connectors
<<
c
;
}
else
{
...
...
@@ -167,7 +165,7 @@ bool DrmGpu::updateOutputs()
auto
it
=
std
::
find_if
(
m_crtcs
.
constBegin
(),
m_crtcs
.
constEnd
(),
[
currentCrtc
]
(
DrmCrtc
*
c
)
{
return
c
->
id
()
==
currentCrtc
;
});
if
(
it
==
m_crtcs
.
constEnd
())
{
auto
c
=
new
DrmCrtc
(
currentCrtc
,
m_backend
,
this
,
i
);
if
(
m_atomicModeSetting
&&
!
c
->
atomicI
nit
())
{
if
(
!
c
->
i
nit
())
{
delete
c
;
continue
;
}
...
...
plugins/platforms/drm/drm_object.h
View file @
031924b4
...
...
@@ -36,7 +36,7 @@ public:
* Must be called to query necessary data directly after creation.
* @return true when initializing was successful
*/
virtual
bool
atomicI
nit
()
=
0
;
virtual
bool
i
nit
()
=
0
;
uint32_t
id
()
const
{
return
m_id
;
...
...
plugins/platforms/drm/drm_object_connector.cpp
View file @
031924b4
...
...
@@ -27,7 +27,7 @@ DrmConnector::DrmConnector(uint32_t connector_id, int fd)
DrmConnector
::~
DrmConnector
()
=
default
;
bool
DrmConnector
::
atomicI
nit
()
bool
DrmConnector
::
i
nit
()
{
qCDebug
(
KWIN_DRM
)
<<
"Creating connector"
<<
m_id
;
...
...
plugins/platforms/drm/drm_object_connector.h
View file @
031924b4
...
...
@@ -21,7 +21,7 @@ public:
~
DrmConnector
()
override
;
bool
atomicI
nit
()
override
;
bool
i
nit
()
override
;
enum
class
PropertyIndex
{
CrtcId
=
0
,
...
...
plugins/platforms/drm/drm_object_crtc.cpp
View file @
031924b4
...
...
@@ -33,9 +33,9 @@ DrmCrtc::~DrmCrtc()
{
}
bool
DrmCrtc
::
atomicI
nit
()
bool
DrmCrtc
::
i
nit
()
{
qCDebug
(
KWIN_DRM
)
<<
"
Atomic i
nit for CRTC:"
<<
resIndex
()
<<
"id:"
<<
m_id
;
qCDebug
(
KWIN_DRM
)
<<
"
I
nit for CRTC:"
<<
resIndex
()
<<
"id:"
<<
m_id
;
if
(
!
initProps
())
{
return
false
;
...
...
plugins/platforms/drm/drm_object_crtc.h
View file @
031924b4
...
...
@@ -27,7 +27,7 @@ public:
~
DrmCrtc
()
override
;
bool
atomicI
nit
()
override
;
bool
i
nit
()
override
;
enum
class
PropertyIndex
{
ModeId
=
0
,
...
...
plugins/platforms/drm/drm_object_plane.cpp
View file @
031924b4
...
...
@@ -25,7 +25,7 @@ DrmPlane::~DrmPlane()
delete
m_next
;
}
bool
DrmPlane
::
atomicI
nit
()
bool
DrmPlane
::
i
nit
()
{
qCDebug
(
KWIN_DRM
)
<<
"Atomic init for plane:"
<<
m_id
;
DrmScopedPointer
<
drmModePlane
>
p
(
drmModeGetPlane
(
fd
(),
m_id
));
...
...
plugins/platforms/drm/drm_object_plane.h
View file @
031924b4
...
...
@@ -62,7 +62,7 @@ public:
Q_ENUM
(
Transformation
)
Q_DECLARE_FLAGS
(
Transformations
,
Transformation
);
bool
atomicI
nit
()
override
;
bool
i
nit
()
override
;
bool
initProps
()
override
;
TypeIndex
type
();
...
...
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