<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>500019</bug_id>
          
          <creation_ts>2025-02-13 20:24:44 +0000</creation_ts>
          <short_desc>Direct scanout is prevented by black point compensation</short_desc>
          <delta_ts>2026-03-27 13:17:53 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>kwin</product>
          <component>platform-drm</component>
          <version>git master</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Zamundaaa">xaver.hugl</reporter>
          <assigned_to name="KWin default assignee">kwin-bugs-null</assigned_to>
          <cc>bizyaev</cc>
    
    <cc>chermnykh2001</cc>
    
    <cc>kodatarule</cc>
    
    <cc>mpalys7274</cc>
    
    <cc>nate</cc>
    
    <cc>ngoquang2708</cc>
    
    <cc>rropid</cc>
    
    <cc>syed.talha.khalid</cc>
          
          <cf_commitlink>https://invent.kde.org/plasma/kwin/-/commit/b97e1a374aa10e528fe361fd87a5df76b5e2017d</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2397714</commentid>
    <comment_count>0</comment_count>
    <who name="Zamundaaa">xaver.hugl</who>
    <bug_when>2025-02-13 20:24:44 +0000</bug_when>
    <thetext>The legacy KMS matrix is only 3x3, but the way we implemented black point compensation uses a 3x4 matrix, preventing direct scanout.

If we apply BPC with the LUTs instead, then we could apply it just fine without preventing direct scanout too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2400950</commentid>
    <comment_count>1</comment_count>
    <who name="Syntist">syed.talha.khalid</who>
    <bug_when>2025-02-21 04:36:10 +0000</bug_when>
    <thetext>Can confirm direct scannout doesn&apos;t work when Color profile ICC/Built in is selected with prefer efficiency. But setting color profile to none works as it should.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2407483</commentid>
    <comment_count>2</comment_count>
    <who name="">kodatarule</who>
    <bug_when>2025-03-14 07:17:28 +0000</bug_when>
    <thetext>I have noticed that even with color profile set to none the red &quot;Compositing&quot; sign still shows, not triggering direct scanout.
This is a clean install of CachyOS, I was wondering why there was nearly 10fps deficit compared to Gnome for a long time and this seems to be the reason as to why.

Operating System: CachyOS Linux 
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.13.6-2-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800X3D 8-Core Processor
Memory: 31,3 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3090</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2407484</commentid>
    <comment_count>3</comment_count>
    <who name="">kodatarule</who>
    <bug_when>2025-03-14 07:26:07 +0000</bug_when>
    <thetext>In addition, I did some more tests and even on a single monitor the red &quot;Compositing&quot; remains, effectively not letting direct scanout work at all(color profile set to none). 
I am not sure if this is nvidia driver bug or something in KDE, if any logs are needed, please let me know so I can provide.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2407486</commentid>
    <comment_count>4</comment_count>
    <who name="">kodatarule</who>
    <bug_when>2025-03-14 07:35:01 +0000</bug_when>
    <thetext>Apologies for another reply, just wanted to say that I tested on an amd+nvidia laptop and the red &quot;compositing&quot; still stays on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2419458</commentid>
    <comment_count>5</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2025-04-27 22:37:10 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7567</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2420203</commentid>
    <comment_count>6</comment_count>
    <who name="Zamundaaa">xaver.hugl</who>
    <bug_when>2025-04-30 15:53:15 +0000</bug_when>
    <thetext>Git commit faac87b9642c47a2afe0228216c0ef9063c138eb by Xaver Hugl.
Committed on 30/04/2025 at 15:39.
Pushed by zamundaaa into branch &apos;master&apos;.

core/colorpipeline: optimize out black point compensation

M  +14   -0    autotests/test_colorspaces.cpp
M  +28   -0    src/core/colorpipeline.cpp

https://invent.kde.org/plasma/kwin/-/commit/faac87b9642c47a2afe0228216c0ef9063c138eb</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2420209</commentid>
    <comment_count>7</comment_count>
    <who name="Zamundaaa">xaver.hugl</who>
    <bug_when>2025-04-30 16:22:17 +0000</bug_when>
    <thetext>Git commit b97e1a374aa10e528fe361fd87a5df76b5e2017d by Xaver Hugl.
Committed on 30/04/2025 at 16:04.
Pushed by zamundaaa into branch &apos;Plasma/6.3&apos;.

core/colorpipeline: optimize out black point compensation
(cherry picked from commit faac87b9642c47a2afe0228216c0ef9063c138eb)

M  +14   -0    autotests/test_colorspaces.cpp
M  +28   -0    src/core/colorpipeline.cpp

https://invent.kde.org/plasma/kwin/-/commit/b97e1a374aa10e528fe361fd87a5df76b5e2017d</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2420354</commentid>
    <comment_count>8</comment_count>
    <who name="Harald Weissmueller">rropid</who>
    <bug_when>2025-05-01 06:46:59 +0000</bug_when>
    <thetext>(In reply to Zamundaaa from comment #7)
&gt; Git commit b97e1a374aa10e528fe361fd87a5df76b5e2017d by Xaver Hugl.
&gt; Committed on 30/04/2025 at 16:04.
&gt; Pushed by zamundaaa into branch &apos;Plasma/6.3&apos;.
&gt; 
&gt; core/colorpipeline: optimize out black point compensation
&gt; (cherry picked from commit faac87b9642c47a2afe0228216c0ef9063c138eb)
&gt; 
&gt; M  +14   -0    autotests/test_colorspaces.cpp
&gt; M  +28   -0    src/core/colorpipeline.cpp
&gt; 
&gt; https://invent.kde.org/plasma/kwin/-/commit/
&gt; b97e1a374aa10e528fe361fd87a5df76b5e2017d

Is there something else required besides using a kwin with this patch? I tried the Plasma/6.3 branch here and direct scanout doesn&apos;t seem to work with an ICC profile or the &quot;built-in&quot; setting. It only works with color profile set to &quot;none&quot;. I&apos;m using AMD graphics.

Something else I happened to notice because there&apos;s a bug with regards to hardware cursor gamma right now on AMD RDNA 4: kwin seems to switch to a software cursor in fullscreen windows (maybe only with VRR enabled?). The use of a software cursor then also seems to break direct scanout. I tried experimenting with environment variables and setting KWIN_DRM_DONT_FORCE_AMD_SW_CURSOR=1 keeps the hardware cursor enabled for fullscreen.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2420589</commentid>
    <comment_count>9</comment_count>
    <who name="Zamundaaa">xaver.hugl</who>
    <bug_when>2025-05-02 12:47:44 +0000</bug_when>
    <thetext>&gt; Is there something else required besides using a kwin with this patch? I tried the Plasma/6.3 branch here and direct scanout doesn&apos;t seem to work with an ICC profile or the &quot;built-in&quot; setting. It only works with color profile set to &quot;none&quot;.

It depends on your settings. If you have color accuracy set to &quot;prefer accuracy&quot;, that will prevent direct scanout in most situations. Because driver APIs are still quite lacking, having a visible cursor also often prevents it.

&gt; I tried experimenting with environment variables and setting KWIN_DRM_DONT_FORCE_AMD_SW_CURSOR=1 keeps the hardware cursor enabled for fullscreen.
Right, we can probably disable that workaround by default now</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2422068</commentid>
    <comment_count>10</comment_count>
    <who name="">kodatarule</who>
    <bug_when>2025-05-08 13:19:32 +0000</bug_when>
    <thetext>Just updated to plasma 6.3.5 on both PC desktop and laptop, both are still not triggering the direct scanout.
I have also tried to make the color profile to none with no success, as well as single monitor setup which still fails to trigger the direct scanout.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2427676</commentid>
    <comment_count>11</comment_count>
    <who name="Zamundaaa">xaver.hugl</who>
    <bug_when>2025-05-26 15:41:28 +0000</bug_when>
    <thetext>There can still be other things that prevent direct scanout, like active KWin effects or driver bugs</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>