<?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>491452</bug_id>
          
          <creation_ts>2024-08-08 20:26:50 +0000</creation_ts>
          <short_desc>Color correction (built-in) performance issues</short_desc>
          <delta_ts>2024-09-14 07:32:08 +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>wayland-generic</component>
          <version>6.1.4</version>
          <rep_platform>Arch Linux</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>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Bruno Filipe">bmilreu</reporter>
          <assigned_to name="KWin default assignee">kwin-bugs-null</assigned_to>
          <cc>alisson.bwt</cc>
    
    <cc>nate</cc>
    
    <cc>xaver.hugl</cc>
          
          <cf_commitlink>https://invent.kde.org/plasma/kwin/-/commit/6bd07ad6b30e34f43652934630d30234ad65ac7c</cf_commitlink>
          <cf_versionfixedin>6.2.0</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2344211</commentid>
    <comment_count>0</comment_count>
    <who name="Bruno Filipe">bmilreu</who>
    <bug_when>2024-08-08 20:26:50 +0000</bug_when>
    <thetext>SUMMARY

When built-in color correction is enabled I see the following performance issues on two systems:
1. At 1440p 180hz running glxgears/vkcube, system with 7950x AMD iGPU get&apos;s like +30-50% usage compared to color correction off. 
2. At 1440p 240hz running glxgears/vkcube, system with NVIDIA RTX 3090 gets constant periodic usage spikes (+30%) and stutters (going from P2 to P5), compared to smooth 240hz at P2 with color correction off.

ADDITIONAL INFORMATION

I&apos;m thankful this got implemented, just reporting this as a minor issue as it deserves to get optimized further. There are a few too many wide gamut panels without any form of sRGB emulation, or handicapped ones.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2344384</commentid>
    <comment_count>1</comment_count>
    <who name="Zamundaaa">xaver.hugl</who>
    <bug_when>2024-08-09 13:32:03 +0000</bug_when>
    <thetext>Git commit 6bd07ad6b30e34f43652934630d30234ad65ac7c by Xaver Hugl.
Committed on 09/08/2024 at 13:18.
Pushed by zamundaaa into branch &apos;master&apos;.

backends/drm: remove the shadow buffer when possible, and reduce it to 10bpc when not

Using the custom values for min. and max. luminance in transfer functions, we can reduce the
ranges of values in the shadow buffer to be limited to [0, 1], and with that we can switch
from a floating point buffer back to a normalized format. As gamma 2.2 encoding is much more
efficient at storing color values, this also drops the buffer from 16bpc down to 10bpc.

Furthermore, this offloads the gamma 2.2 -&gt; PQ conversion to KMS when possible, and then uses
the scanout buffer with gamma 2.2 encoding directly. This way the shadow buffer gets completely
skipped and performance and efficiency get improved a lot.
Related: bug 477223

M  +7    -7    autotests/test_colorspaces.cpp
M  +7    -10   src/backends/drm/drm_egl_layer.cpp
M  +34   -26   src/backends/drm/drm_egl_layer_surface.cpp
M  +2    -2    src/backends/drm/drm_egl_layer_surface.h
M  +45   -28   src/backends/drm/drm_output.cpp
M  +11   -3    src/backends/drm/drm_output.h
M  +4    -10   src/backends/drm/drm_pipeline.cpp
M  +2    -2    src/backends/x11/standalone/x11_standalone_output.cpp
M  +1    -1    src/compositor_wayland.cpp
M  +3    -3    src/core/colorpipeline.cpp
M  +1    -1    src/core/colorpipeline.h
M  +16   -2    src/core/colorspace.cpp
M  +3    -1    src/core/colorspace.h
M  +2    -2    src/wayland/frog_colormanagement_v1.cpp
M  +1    -1    src/wayland/frog_colormanagement_v1.h
M  +3    -3    src/wayland/xx_colormanagement_v4.cpp

https://invent.kde.org/plasma/kwin/-/commit/6bd07ad6b30e34f43652934630d30234ad65ac7c</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2353715</commentid>
    <comment_count>2</comment_count>
    <who name="cwo">cwo.kde</who>
    <bug_when>2024-09-14 07:32:08 +0000</bug_when>
    <thetext>*** Bug 492839 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>