[kwin] [Bug 524279] New: Night Light temperature transitions cause transient scanout corruption

"Sean Brar" <[email protected]>
Newsgroups gmane.comp.kde.devel.bugs
Message-ID <[email protected]/>
https://bugs.kde.org/show_bug.cgi?id=524279

            Bug ID: 524279
           Summary: Night Light temperature transitions cause transient
                    scanout corruption
    Classification: Plasma
           Product: kwin
      Version First 6.6.4
       Reported In:
          Platform: Bazzite
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: wayland-generic
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

**Environment:**

* **KWin / Plasma:** 6.6.4 (Wayland)
* **GPU:** AMD RX 6800 (Navi 21)
* **Driver / Mesa:** amdgpu, Mesa 26.0.4
* **Kernel:** 6.17.7-ba29.fc43.x86_64
* **OS:** Fedora 43 (bazzite-deck)
* **Monitors:** Three DisplayPort outputs available; reproduces with any two
connected (including two native DP links).

**Description**

While KWin's Night Light color temperature is *changing*, the displays show
brief graphical corruption (flickering blocks of incorrect pixels). The
corruption stops immediately as soon as the temperature settles.

The corruption is **never present in a screen recording**, indicating it is
introduced during scanout rather than in the composited image.

It is far more frequent with two or more outputs enabled, but does still occur
- rarely and faintly - with a single output.

**Steps to reproduce**

1. Connect two monitors. Any two outputs reproduce this; 1920x1080@60 at scale
1.0, SDR, sRGB, no ICC profile is simply the most minimal configuration I
confirmed it on.
2. Ensure the cursor remains perfectly still to avoid introducing plane
changes.
3. Run the following DBus script to sweep color temperatures:

```bash
for t in 6500 6000 5500 5000 4500 4000 3500 3000 2500 2000 1500 1000 \
         1500 2000 2500 3000 3500 4000 4500 5000 5500 6000 6500; do
  qdbus6 org.kde.KWin /org/kde/KWin/NightLight org.kde.KWin.NightLight.preview
$t
  sleep 0.4
done
qdbus6 org.kde.KWin /org/kde/KWin/NightLight
org.kde.KWin.NightLight.stopPreview
```

**Expected Results:**
The color temperature changes smoothly with no visual artifacts.

**Actual Results:**
Transient corruption appears on the monitors throughout the transition,
generally manifesting within ~2 seconds of the script starting.

**Technical Investigation & CRC Verification**

The corruption is strictly tied to the color temperature transition, not the
application of a static transform. I verified this via CRTC CRC capture
(`/sys/kernel/debug/dri/*/crtc-*/crc`, source `auto`):

| Condition | Frames | Distinct CRCs |
| --- | --- | --- |
| Idle, no transform (6500K) | 3600 | 1 |
| Static transform held at 3000K | 600 | 1 |
| Static transform held at 3000K (repeat) | 480 | 1 |

There were zero dropped frames and the counters were fully consecutive. A
settled color transform produces a bit-identical image indefinitely.

**Variables Ruled Out**

* **Display bandwidth / prefetch headroom:** Reproduces with `min_ttu_vblank`
at 414.9 µs - clear of the ~414 µs `dram_clk_change` requirement, and roughly
7.5× the margin of the configuration where I first noticed the problem.
* **Refresh-rate mismatch:** Reproduces with both outputs at exactly 60 Hz.
* **Resolution / Scaling:** Reproduces at 1920x1080, scale 1.0.
* **GPU load:** `gpu_busy_percent` reads only 5–9% during the corruption.
* **Logs:** No underflows, no `flip_done` timeouts, and no DC errors are logged
during the event.

**Additional Context (Main Loop Stalls)**

`NightLight.preview()` is synchronous. With one output, the DBus round trip is
0.4 ms median / 0.6 ms max. With two outputs, I observed occasional excursions
to 13–31 ms. While testing a 3-output configuration, `Libinput: … event
processing lagging behind by 42ms` was repeatedly logged. Note: corruption
still occurs on setups with a 0.6 ms max round trip, so the main loop stall is
not a strict requirement for the visual artifact, but may be related.

I have `amdgpu_dm_dtn_log` captures and CRTC CRC traces from these
reproductions if they would be useful.

-- 
You are receiving this mail because:
You are watching all bug changes.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.