Bug 491411

Summary: Forcing a custom EDID, heck even overriding it with itself makes "adaptive sync" option disappear (wayland)
Product: [Plasma] kwin Reporter: Adolfo Rodrigues <adolfotregosa>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: adolfotregosa, chermnykh2001, nate, xaver.hugl
Priority: NOR Keywords: wayland-only
Version First Reported In: 6.1.4   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: before and after edid override
EDID I'm using to override.
mismatch information
stock edid
override edid

Description Adolfo Rodrigues 2024-08-07 22:32:38 UTC
Created attachment 172381 [details]
before and after edid override

SUMMARY
Forcing a custom EDID, heck even overriding it with itself makes adaptive sync option disappear. Under X11 vrr does not stop working with a custom EDID. Under wayland I override EDID on startup using a service and it works, my single custom modeline  is available and working but the option "adaptive sync" sisappears making VRR not kick in games under wayland. Nvidia driver 560.31.02

STEPS TO REPRODUCE
1. override edid using any method . 

OBSERVED RESULT
Adaptive sync option is gone. 

EXPECTED RESULT
Adaptive sync option to not disappear. Without it, VRR is not working. TV detects VRR signal but it's not working.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 6.9.12-2-MANJARO (64-bit)
KDE Plasma Version:  6.1.4
KDE Frameworks Version:  6.4.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
NVIDIA GPU using driver 560.31.02
Comment 1 Adolfo Rodrigues 2024-08-07 22:33:43 UTC
Created attachment 172382 [details]
EDID I'm using to override.
Comment 2 Adolfo Rodrigues 2024-08-07 22:42:09 UTC
Created attachment 172383 [details]
mismatch information

TV clearly shows it's receiving a VRR signal but kscreen-doctor thinks it's vrr incapable.
Comment 3 Zamundaaa 2024-08-09 13:25:42 UTC
Please attach the output of drm_info with the stock edid and the override. KWin gets told by the kernel if vrr is possible, most likely it's just disabled by the driver while an edid override is set
Comment 4 Adolfo Rodrigues 2024-08-09 13:40:48 UTC
Created attachment 172440 [details]
stock edid
Comment 5 Adolfo Rodrigues 2024-08-09 13:41:06 UTC
Created attachment 172441 [details]
override edid
Comment 6 Adolfo Rodrigues 2024-08-09 13:44:39 UTC
While using X11 all is perfect although I override edid using the following:

/etc/X11/xorg.conf.d/00-nvidia.conf

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-2"
    Option         "metamodes" "3840x2160_120 +0+0 {AllowGSYNCCompatible=On}"
    Option         "SLI" "Off"
    Option         "CustomEDID" "HDMI-0:/usr/lib/firmware/lg.bin"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Device"
        Identifier      "3090"
        Driver          "nvidia"
        Option          "ModeValidation" "AllowNonEdidModes"
EndSection

----------------------------------------------------------------------------------

Yeap, you are correct. drm_info shows vrr_capable 0 with override. 

This is my service.

[Unit]
Description=EDID Override Service
Before=sddm.service
RequiresMountsFor=/usr/lib/firmware/edid/lg.bin

[Service]
Type=oneshot
ExecStart=/bin/sh -c 'for edid_path in /sys/kernel/debug/dri/*/HDMI-A-1/edid_override; do if [ -f "$edid_path" ]; then cat /usr/lib/firmware/edid/lg.bin > "$edid_path"; fi; done'
RemainAfterExit=true

[Install]
WantedBy=multi-user.target

-------------------------------------

Any suggestions on how to fix this for wayland ? edid override on X11 works ok. I presume open a bug report on nvidia forums would be where to start.
Comment 7 Adolfo Rodrigues 2024-08-09 14:07:57 UTC
If Kwin is working correctly, I'll close the bug report.
Comment 8 Zamundaaa 2024-08-10 13:45:39 UTC
Yeah, this is a driver bug, it reports that the display can't do vrr. Please report it at https://forums.developer.nvidia.com/c/gpu-graphics/linux
Comment 9 Adolfo Rodrigues 2024-08-10 14:03:49 UTC
(In reply to Zamundaaa from comment #8)
> Yeah, this is a driver bug, it reports that the display can't do vrr. Please
> report it at https://forums.developer.nvidia.com/c/gpu-graphics/linux

https://forums.developer.nvidia.com/t/overriding-edid-makes-vrr-stop-working-under-wayland-vrr-capable-immutable-range-0-1-0/302929