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
Unmaintained
KDE Workspace
Commits
031d290f
Commit
031d290f
authored
Jul 23, 2013
by
Thomas Lübking
Browse files
prevent yield/swap cpu overhead on nvidia
CCBUG: 322060 REVIEW: 111663
parent
a4aa8fc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
kwin/eglonxbackend.cpp
View file @
031d290f
...
...
@@ -277,6 +277,18 @@ void EglOnXBackend::present()
eglWaitGL
();
if
(
char
result
=
m_swapProfiler
.
end
())
{
gs_tripleBufferUndetected
=
gs_tripleBufferNeedsDetection
=
false
;
if
(
result
==
'd'
&&
GLPlatform
::
instance
()
->
driver
()
==
Driver_NVidia
)
{
// TODO this is a workaround, we should get __GL_YIELD set before libGL checks it
if
(
qstrcmp
(
qgetenv
(
"__GL_YIELD"
),
"USLEEP"
))
{
options
->
setGlPreferBufferSwap
(
0
);
eglSwapInterval
(
dpy
,
0
);
kWarning
(
1212
)
<<
"
\n
It seems you are using the nvidia driver without triple buffering
\n
"
"You must export __GL_YIELD=
\"
USLEEP
\"
to prevent large CPU overhead on synced swaps
\n
"
"Preferably, enable the TripleBuffer Option in the xorg.conf Device
\n
"
"For this reason, the tearing prevention has been disabled.
\n
"
"See https://bugs.kde.org/show_bug.cgi?id=322060
\n
"
;
}
}
setBlocksForRetrace
(
result
==
'd'
);
}
}
...
...
kwin/glxbackend.cpp
View file @
031d290f
...
...
@@ -432,6 +432,18 @@ void GlxBackend::present()
glXWaitGL
();
if
(
char
result
=
m_swapProfiler
.
end
())
{
gs_tripleBufferUndetected
=
gs_tripleBufferNeedsDetection
=
false
;
if
(
result
==
'd'
&&
GLPlatform
::
instance
()
->
driver
()
==
Driver_NVidia
)
{
// TODO this is a workaround, we should get __GL_YIELD set before libGL checks it
if
(
qstrcmp
(
qgetenv
(
"__GL_YIELD"
),
"USLEEP"
))
{
options
->
setGlPreferBufferSwap
(
0
);
setSwapInterval
(
0
);
kWarning
(
1212
)
<<
"
\n
It seems you are using the nvidia driver without triple buffering
\n
"
"You must export __GL_YIELD=
\"
USLEEP
\"
to prevent large CPU overhead on synced swaps
\n
"
"Preferably, enable the TripleBuffer Option in the xorg.conf Device
\n
"
"For this reason, the tearing prevention has been disabled.
\n
"
"See https://bugs.kde.org/show_bug.cgi?id=322060
\n
"
;
}
}
setBlocksForRetrace
(
result
==
'd'
);
}
}
...
...
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