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

            Bug ID: 528186
           Summary: No direct scanout whenever any color transform is
                    active (Night Light, color profile, HDR) on AMD RX
                    9070 XT, despite plane COLOR_PIPELINE with 3D LUT
                    support
    Classification: Plasma
           Product: kwin
      Version First 6.8.2
       Reported In:
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: platform-drm
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

Created attachment 197942
  --> https://bugs.kde.org/attachment.cgi?id=197942&action=edit
Kernel DRM debug logs, drm info and kscreen-doctor outputs

SUMMARY
Direct scanout only works when no color transform is needed. Enabling any one
of Night Light, the built-in color profile, an ICC profile or HDR makes KWin
fall back to compositing for fullscreen windows. The driver exposes the
per-plane color pipeline API, including a 3D LUT stage. A DRM debug log shows
that while Night Light is active, KWin never seems to test-commits the client
buffer and the kernel never rejects anything.

STEPS TO REPRODUCE
1. Load the "showcompositing" effect from the KWin debug console.
2. Disable Night Light, set no color profile, turn HDR off. Color accuracy is
set to "Prefer efficiency".
3. Run vkcube fullscreen on the main display. -> Direct scanout is active: the
compositing indicator disappears, even with the cursor visible.
4. Enable Night Light.
5. Disable Night Light again.

OBSERVED RESULT
- After step 4, the compositing indicator comes back, and direct scanout stays
inactive for as long as Night Light is on.
- After step 5, direct scanout resumes.
- The same loss of direct scanout happens with each of these on its own (Night
Light off): the built-in color profile, an ICC profile, HDR enabled.
- It also happens with only one display enabled (second monitor disabled).

EXPECTED RESULT
Direct scanout should remain active, with the color operations offloaded to
KMS. This should apply at least to Night Light, which could already be
offloaded through the CRTC gamma LUT on AMD before the color pipeline API
existed.

ADDITIONAL INFORMATION
- The driver exposes a full color pipeline, including a 3D LUT. drm_info
reports "DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE supported". Seven planes expose
COLOR_PIPELINE (enum {Bypass, Color Pipeline 51}), each with 8 colorops: 3x 1D
Curve, 2x 1D LUT, 3x4 Matrix, Multiplier and 3D LUT. Full output attached.
- KWin never tries direct scanout while Night Light is on. DRM debug log
attached (drm.debug=0x16), recorded with vkcube fullscreen: direct scanout
active -> Night Light enabled -> Night Light disabled.
  - In the direct-scanout periods (log time ~1522-1528 s and ~1542-1544 s),
KWin test-commits vkcube's buffers as they arrive and commits them at the next
vblank, as expected.
  - While Night Light is active (~1533-1536 s), all ~1,080 test commits on the
primary plane use KWin's own rendered buffers. No client buffer is ever tested.
KWin also allocates a new swapchain at that point.
  - No atomic check fails. The only "failed" messages are -35 (EDEADLK)
lock-contention retries, which the kernel handles internally.
- KWin's debug log (QT_LOGGING_RULES="kwin*.debug=true") has no messages about
the scanout decision.

RELATED BUGS (checked, I believe they are not duplicates)
- Bug 516333: same GPU (RX 9070 XT) and same symptoms, but closed as RESOLVED
UPSTREAM because RDNA4's color pipeline lacked a 3D LUT on kernel 6.19
(drm/amd#5048). On kernel 7.2.13, the 3D LUT is present (see drm_info above),
and KWin still never attempts direct scanout.
- Bug 526201: closed because "Prefer color accuracy" was enabled. My setting is
"Prefer efficiency".
- Bug 526998: the single-plane limitation for color transforms applies to
NVIDIA and Intel. This is AMD, and it fails with the cursor hidden too.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 44
KDE Plasma Version: 6.8.2
KDE Frameworks Version: 6.31.0
Qt Version: 6.11.2
Kernel Version: 7.2.13-200.fc44.x86_64 (64-bit)
Graphics Platform: Wayland
Mesa: mesa-dri-drivers-26.2.5-1.fc44.x86_64
Processors: 16 × AMD Ryzen 7 5700X3D 8-Core Processor
Memory: 32 GiB of RAM (31.3 GiB usable)
Graphics Processor: AMD Radeon RX 9070 XT
Displays:
- AORUS FO27Q3, 2560x1440 @ 360 Hz, DP-2, 10 bpc, DSC, scale 125%
- ViewSonic XG2401, 1920x1080 @ 120 Hz, DP-1

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

Reply via email to