<?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>511101</bug_id>
          
          <creation_ts>2025-10-25 15:58:30 +0000</creation_ts>
          <short_desc>kwin 6.5.0 seems to break gamescope HDR support</short_desc>
          <delta_ts>2025-10-26 13:49:27 +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>colour-management</component>
          <version>6.5.0</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>UPSTREAM</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>0</everconfirmed>
          <reporter name="FK">fk-kde-bugs</reporter>
          <assigned_to name="KWin default assignee">kwin-bugs-null</assigned_to>
          <cc>xaver.hugl</cc>
          
          <cf_commitlink></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>2465022</commentid>
    <comment_count>0</comment_count>
    <who name="FK">fk-kde-bugs</who>
    <bug_when>2025-10-25 15:58:30 +0000</bug_when>
    <thetext>SUMMARY
After the update to 6.5.0 I&apos;m not able to use HDR within gamescope anymore. HDR through mpv / proton-ge (wayland) works as expected.

STEPS TO REPRODUCE
1. Enable HDR
2. start a fullscreen game in gamescope using --hdr-enabled (i.e., gamescope -f -W 1920 -H 1080 --hdr-enabled --hdr-debug-force-output --backend wayland --force-grab-cursor  --adaptive-sync --hdr-itm-target-nits 825 --rt -- %command%)

OBSERVED RESULT
No HDR visible. In-game option for HDR disabled.

Using WAYLAND_DEBUG and grepping for &quot;wp_image_description_creator_params_v1&quot; stays empty

I can see: 
[gamescope] [Info]  xdg_backend: uMaxContentLightLevel: 80
[gamescope] [Info]  xdg_backend: HDR INFO
[gamescope] [Info]  xdg_backend:   cv_hdr_enabled: true
[gamescope] [Info]  xdg_backend:   uTF: GAMMA22
[gamescope] [Info]  xdg_backend:   bExposeHDRSupport: false
[gamescope] [Info]  xdg_backend: uMaxContentLightLevel: 840 (&lt;--- switching HDR on/off)
[gamescope] [Info]  xdg_backend: HDR INFO
[gamescope] [Info]  xdg_backend:   cv_hdr_enabled: true
[gamescope] [Info]  xdg_backend:   uTF: GAMMA22
[gamescope] [Info]  xdg_backend:   bExposeHDRSupport: false

With gamescope option &quot;--hdr-debug-force-output&quot; I get the following output:
  pEngineName: (null)
  engineVersion: 0
  apiVersion: 4198400
[gamescope] [Warn]  xwm: got the same buffer committed twice, ignoring.
[Gamescope WSI] Creating Gamescope surface: xid: 0x200009b
[Gamescope WSI] Atom of T was wrong type. Expected XCB_ATOM_CARDINAL.
[Gamescope WSI] Made gamescope surface for xid: 0x200009b
[Gamescope WSI] Surface state:
  steam app id:                  548430
  window xid:                    0x200009b
  wayland surface res id:        5
  layer client flags:            0x4
  server hdr output enabled:     true
  hdr formats exposed to client: true
[Gamescope WSI] Creating swapchain for xid: 0x200009b - oldSwapchain: (nil) - provided minImageCount: 3 - minImageCount: 3 - format: VK_FORMAT_A2B10G10R10_UNORM_PACK32 - colorspace: VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - flip: true
[Gamescope WSI] Created swapchain for xid: 0x200009b swapchain: 0x7f47d0110180 - imageCount: 3

but still no HDR option in the game.

EXPECTED RESULT
HDR should work

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.5.0
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.17.4-arch2-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 PRO 4750U with Radeon Graphics
Memory: 48 GiB of RAM (46.3 GiB usable)
Graphics Processor: AMD Radeon Graphics

Gamescope version: 3.16.17 and git

ADDITIONAL INFORMATION</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2465118</commentid>
    <comment_count>1</comment_count>
    <who name="Zamundaaa">xaver.hugl</who>
    <bug_when>2025-10-25 21:28:57 +0000</bug_when>
    <thetext>This needs fixing in gamescope, see https://github.com/ValveSoftware/gamescope/pull/1999</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2465219</commentid>
    <comment_count>2</comment_count>
    <who name="FK">fk-kde-bugs</who>
    <bug_when>2025-10-26 10:07:34 +0000</bug_when>
    <thetext>(In reply to Zamundaaa from comment #1)
&gt; This needs fixing in gamescope, see
&gt; https://github.com/ValveSoftware/gamescope/pull/1999

Thanks, this fixes my issue.

Wonder whether a detection of &quot;HDR is enabled&quot; is actually useful there, or should only depend on --hdr-enabled and further whatever the user configures in the app. Then kwin should just take care of HDR to SDR transformation if the setting is off.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2465251</commentid>
    <comment_count>3</comment_count>
    <who name="Zamundaaa">xaver.hugl</who>
    <bug_when>2025-10-26 13:49:27 +0000</bug_when>
    <thetext>Yeah, mirroring whether the compositor supports HDR might be better</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>