Bug 2054188

Summary: modesetting/amdgpu: screen connected to discrete GPU updates very slowly (1fps) when no screen is connected to the integrated GPU
Product: [Fedora] Fedora Reporter: Dominik 'Rathann' Mierzejewski <dominik>
Component: xorg-x11-serverAssignee: Adam Jackson <ajax>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: ajax, bskeggs, caillon+fedoraproject, jglisse, ofourdan, rhughes, rstrode, sandmann, xgl-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: xorg-x11-server-1.20.14-6.fc36 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-10 01:14:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1949144    
Bug Blocks:    

Description Dominik 'Rathann' Mierzejewski 2022-02-14 11:49:21 UTC
Description of problem:
I have two GPUs: one is integrated into the Intel CPU (iGPU) and another is inserted into the mainboard (dGPU):

$ lspci |grep 'Display\|VGA'
00:02.0 Display controller: Intel Corporation IvyBridge GT2 [HD Graphics 4000] (rev 09)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Tahiti PRO [Radeon HD 7950/8950 OEM / R9 280]
I have one monitor with HDMI and DisplayPort inputs. The iGPU is connected to
the monitor via HDMI and the dGPU is connected via DP.

When the iGPU is listed as the first in xorg.conf and no screen is connected
to any of its outputs, I get the slow screen update issue on the dGPU screen:

Section "Device"
        Identifier "Integrated Graphics"
        Driver     "modesetting"
        Option     "Monitor-HDMI-2" "Desktop 34in HDMI"
        BusID      "0:2:0:0"
EndSection

Section "Device"
	Identifier "Discrete Graphics"
	Driver     "amdgpu"
	Option     "Monitor-DisplayPort-1-2" "Desktop 34in DP"
	Option     "TearFree" "on"
	BusID      "1:0:0:0"
EndSection

If I reverse the device order, then disconnecting the screen from iGPU has no
ill effects, but I'm unable to use the iGPU for VA-API accelerated video
playback:

DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]

The idea is to use the iGPU for video playback and general display and the dGPU
only for demanding 3D applications because its fans are quite loud when they
spin up. However, I want to use the dGPU to drive the display as it's capable
of 100Hz refresh rate while the iGPU (IvyBridge HD 4000 GPU) is pixclock-limited
to ~43Hz on the HDMI port and has no DP port.

Version-Release number of selected component (if applicable):
xorg-x11-server-Xorg-1.20.14-3.fc35.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. On a system with iGPU (e.g. Intel) and dGPU (e.g. AMD), connect screens to one iGPU port and one dGPU port.
2. Configure xorg.conf with iGPU first, as above.
3. Start an Xorg session (e.g. MATE)
4. Disconnect the screen from iGPU

Actual results:
Extremely slow screen update rate (1fps).

Expected results:
Configured screen update rate (100Hz in my case).

Additional info:
There seems to be a work around added upstream in https://gitlab.freedesktop.org/xorg/xserver/-/commit/16571b8926a5a7ba5a1885b36a16857addbe8f41 , but it's not present in 1.20.14. Please either backport or update the Xorg server.

Comment 1 Dominik 'Rathann' Mierzejewski 2022-02-15 10:21:31 UTC
FWIW backporting that commit to 1.20.14 and specifying -fakescreenfps 100 in Xserver command line in lightdm works fine for me. Please backport to F35.

Comment 2 Dominik 'Rathann' Mierzejewski 2022-04-17 12:02:29 UTC
https://src.fedoraproject.org/rpms/xorg-x11-server/pull-request/10 submitted.

Comment 3 Dominik 'Rathann' Mierzejewski 2022-05-01 20:07:16 UTC
Still an issue in F36.

Comment 4 Fedora Update System 2022-06-07 20:51:31 UTC
FEDORA-2022-1596828c2c has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-1596828c2c

Comment 5 Fedora Update System 2022-06-08 01:14:18 UTC
FEDORA-2022-1596828c2c has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-1596828c2c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-1596828c2c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2022-06-10 01:14:42 UTC
FEDORA-2022-1596828c2c has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.