https://bugs.kde.org/show_bug.cgi?id=525454

            Bug ID: 525454
           Summary: High CPU usage due to pixel clock overflow
    Classification: Plasma
           Product: kwin
      Version First unspecified
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: X11 Integration
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

On X11, `kwin_x11` can peg one core at 100% when a 3840x2160 @ 240 Hz display
is connected. `kwin_x11 --replace` helps only temporarily.

STEPS TO REPRODUCE
1. Use an XRandR mode with `dot_clock=2332000000`, `htotal=4000`,
`vtotal=2429`.
2. Trigger off-screen rendering of a window thumbnail.
3. Inspect DBus `/KWin supportInformation` and KWin CPU usage.

OBSERVED RESULT
The output refresh rate is `4 294 765 262` mHz and KWin's main thread spins at
100% CPU.

EXPECTED RESULT
The refresh rate is about `240 000` mHz and KWin remains idle.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 6.7.4
KDE Frameworks Version: 6.29.0
Qt Version: 6.11.2
Kernel Version: 7.1.9-arch1-2 (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 7840HS w/ Radeon 780M Graphics
Memory: 96 GiB of RAM (92.0 GiB usable)
Graphics Processor: AMD Radeon 780M Graphics

ADDITIONAL INFORMATION
I plan to submit a merge request that fixes this as it's due to a simple
integer overflow. `doUpdateOutputs()` converts XCB's unsigned 32-bit
`dot_clock` to `int`, changing `2332000000` to `-1962967296`. The resulting
refresh rate wraps to `4294765262` mHz. Then `1000000 /
output()->refreshRate()` creates a 0 ms off-screen frame-callback timer.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to