Bug 442408 - Compositor is disabled after screen dim
Summary: Compositor is disabled after screen dim
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (other bugs)
Version First Reported In: 5.22.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-09-14 01:52 UTC by n.parkanyi
Modified: 2022-09-08 16:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description n.parkanyi 2021-09-14 01:52:46 UTC
SUMMARY
Occasionally, when returning from a screen dim on X11, the compositor ends up disabled. Seems to reproduce more easily when another application is using openGL. Seems to be an integer overflow problem.

STEPS TO REPRODUCE
For me, leaving a firefox tab at https://webglsamples.org/aquarium/aquarium.html and letting the screen dim reliably triggers it.

OBSERVED RESULT
Compositor is disabled.

EXPECTED RESULT
Compositor should remain enabled.

I built a custom package with some printf debugging, and found that in SceneOpenGL::viewportLimitsMatched(), from time to time the call to glGetIntegerv(GL_MAX_VIEWPORT_DIMS, limit) is returning a very large value for width, overflowing the GLint. Based on https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glViewport.xhtml it seems these dimensions are supposed to be GLsizei, and indeed I cannot reproduce the issue if I change the GLint to GLsizei in that function.

This might be the same as Bug 394890.

SOFTWARE/OS VERSIONS
(available in About System)
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2-arch1-2

ADDITIONAL INFORMATION

Radeon RX 570
Comment 1 n.parkanyi 2021-09-14 02:22:58 UTC
Maybe Bug 431858 as well.
Comment 2 Nate Graham 2021-09-16 17:29:03 UTC
Cannot reproduce with those steps, but because you can, would you be interested in submitting a merge request to fix it at https://invent.kde.org/plasma/kwin/-/merge_requests/? Thanks!
Comment 3 n.parkanyi 2021-09-17 00:36:47 UTC
I checked out git master, but haven't been able to reproduce it there. Seems to be due to https://invent.kde.org/plasma/kwin/-/merge_requests/1199. So in the same scenario as before, SceneOpenGL::viewportLimitsMatched() is not hit anymore. Nonetheless, I think the use of GLint is still wrong.
Comment 4 Nate Graham 2021-09-17 17:58:29 UTC
Nice, thanks for digging into the code. Feel free to leave a comment there, or even submit a merge request with a proposed change.
Comment 5 Nate Graham 2022-09-08 16:02:35 UTC
Sounds like this isn't happening anymore.

Code improvements can still be submitted via merge request.