Skip to content
GitLab
Menu
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
bd4a8be3
Commit
bd4a8be3
authored
May 04, 2021
by
Xaver Hugl
Browse files
platforms/drm: fix DrmOutput::updateMode
parent
073b6efc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/platforms/drm/drm_output.cpp
View file @
bd4a8be3
...
...
@@ -523,14 +523,14 @@ void DrmOutput::updateTransform(Transform transform)
void
DrmOutput
::
updateMode
(
uint32_t
width
,
uint32_t
height
,
uint32_t
refreshRate
)
{
if
(
m_mode
.
hdisplay
==
width
&&
m_mode
.
vdisplay
==
height
&&
m_mode
.
vrefresh
==
refreshRate
)
{
if
(
m_mode
.
hdisplay
==
width
&&
m_mode
.
vdisplay
==
height
&&
refreshRateForMode
(
&
m_mode
)
==
refreshRate
)
{
return
;
}
// try to find a fitting mode
DrmScopedPointer
<
drmModeConnector
>
connector
(
drmModeGetConnectorCurrent
(
m_gpu
->
fd
(),
m_conn
->
id
()));
for
(
int
i
=
0
;
i
<
connector
->
count_modes
;
i
++
)
{
auto
mode
=
connector
->
modes
[
i
];
if
(
mode
.
hdisplay
==
width
&&
mode
.
vdisplay
==
height
&&
mode
.
v
refresh
==
refreshRate
)
{
if
(
mode
.
hdisplay
==
width
&&
mode
.
vdisplay
==
height
&&
refresh
RateForMode
(
&
mode
)
==
refreshRate
)
{
updateMode
(
i
);
return
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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