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

            Bug ID: 477451
           Summary: Outputs freeze on multi-screen when hardware cursors
                    are not supported
    Classification: Plasma
           Product: kwin
           Version: 5.27.9
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: platform-drm
          Assignee: kwin-bugs-n...@kde.org
          Reporter: l...@asahilina.net
  Target Milestone: ---

SUMMARY

When using multiple screens with the DRM backend on a machine that does not
support hardware cursors, sometimes all rendering freezes when the cursor icon
is about to change.

`KWIN_FORCE_SW_CURSOR=1` works around the issue, so it's not a problem with
software cursors themselves. The problem seems to be that failed hardware
cursor updates inadvertently revert the pipeline state.

This hack works around the issue:

```
diff --git a/src/backends/drm/drm_pipeline.cpp
b/src/backends/drm/drm_pipeline.cpp
index e0e0b2f01958..083b810f79fe 100644
--- a/src/backends/drm/drm_pipeline.cpp
+++ b/src/backends/drm/drm_pipeline.cpp
@@ -461,7 +461,7 @@ bool DrmPipeline::setCursor(const QPoint &hotspot)
     if (result) {
         m_next = m_pending;
     } else {
-        m_pending = m_next;
+        //m_pending = m_next;
     }
     return result;
 }
@@ -481,7 +481,7 @@ bool DrmPipeline::moveCursor()
             m_output->renderLoop()->scheduleRepaint();
         }
     } else {
-        m_pending = m_next;
+        //m_pending = m_next;
     }
     return result;
 }
```

I don't know why the steps to reproduce this are so specific. It doesn't seem
to happen when an external secondary screen is first connected, only if you
them trigger a mode change or a powerdown/powerup (and a re-hotplug clears the
issue). Maybe there is some other underlying weirdness here...

STEPS TO REPRODUCE
1. Run kwin_wayland on a machine with multiple outputs, and no legacy hardware
cursor nor cursor plane support.
2. Connect a secondary output
3. In System Settings, change the resolution or refresh rate of the secondary
output
4. Move the mouse cursor around, hovering over text items or window edges
(where it would change)

OBSERVED RESULT
The entire screen freezes until the mouse is moved to the other screen (some
other events/apps running can also unjam it)

EXPECTED RESULT
No freezes

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux Asahi Remix 39
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11
Kernel Version: 6.6.0-asahi-00861-g9b58b16aa50d (64-bit)
Graphics Platform: Wayland
Processors: 12
Memory: 54.5 GiB of RAM
Graphics Processor: Apple M2 Max
Product Name: Apple MacBook Pro (16-inch, M2 Max, 2023)

ADDITIONAL INFORMATION

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

Reply via email to