D0023R / linux_kernel_15khz

15kHz video support with additional features for Linux
GNU General Public License v3.0
52 stars 4 forks source link

No outputs detected when starting X #7

Closed cameronhimself closed 1 year ago

cameronhimself commented 1 year ago

Hardware

AMD PRO A6-8500B CPU with integrated Radeon R5 graphics. Codename "Carrizo", based on this dmesg line:

[    8.807969] [drm] initializing kernel modesetting (CARRIZO 0x1002:0x9874 0x103C:0x805B 0xC5).

I have a VGA cable going from the computer to this VGA->component converter. From there I've been alternating testing through a RetroTINK 2X Pro into a modern flat screen monitor via HDMI, and also a real CRT television with component inputs.

Software

Arch Linux using kernel 6.2x. All provided patches have been applied to the kernel (01 through 05).

I'm using the AMDGPU driver, which I'm pretty certain is correct based on this table ("Carrizo" == GCN 3) and the Arch documentation (GCN 3 and later == AMDGPU), however I've also tried the "ATI" driver, as well as neither driver, with the same results.

Issue

I'm able to boot into 240p through KMS, however when running X it fails to detect any outputs and defaults to 1024x768, which results in no output. Additionally, after exiting X it seems that DRM no longer detects the VGA output at all, although I still have video like usual.

Before starting X:

[cameron@crt ~]$ lspci -v | grep -A1 -e VGA -e 3D
00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Wani [Radeon R5/R6/R7 Graphics] (rev c5) (prog-if 00 VGA controller])
    DeviceName: Onboard IGD
[cameron@crt ~]$ cat /sys/class/drm/card0-DP-3/{enabled,status,modes}
enabled
connected
640x480
320x240

Attempt to start X. Relevant lines excerpted from full attached Xorg log:

[   192.028] (II) AMDGPU(0): Output DisplayPort-0 has no monitor section
[   192.028] (II) AMDGPU(0): Output DisplayPort-1 has no monitor section
[   192.028] (II) AMDGPU(0): Output DisplayPort-2 has no monitor section
[   192.028] (II) AMDGPU(0): EDID for output DisplayPort-0
[   192.028] (II) AMDGPU(0): EDID for output DisplayPort-1
[   192.028] (II) AMDGPU(0): EDID for output DisplayPort-2
[   192.028] (II) AMDGPU(0): Output DisplayPort-0 disconnected
[   192.028] (II) AMDGPU(0): Output DisplayPort-1 disconnected
[   192.028] (II) AMDGPU(0): Output DisplayPort-2 disconnected
[   192.028] (WW) AMDGPU(0): No outputs definitely connected, trying again...
[   192.028] (II) AMDGPU(0): Output DisplayPort-0 disconnected
[   192.029] (II) AMDGPU(0): Output DisplayPort-1 disconnected
[   192.029] (II) AMDGPU(0): Output DisplayPort-2 disconnected
[   192.029] (WW) AMDGPU(0): Unable to find connected outputs - setting 1024x768 initial framebuffer

I am certain that DisplayPort-2 is the VGA output since I tested connecting the VGA cable directly to my monitor and saw the relevant successful Xorg logs.

I'm going xorg.conf-less for this. I've also tried writing custom xorg.conf but it made no difference: it still saw all outputs as being disconnected.

Even though I couldn't see anything I was able to execute xrandr blind in xterm. Here's the output:

Screen 0: minimum 320 x 200, current 1024 x 768, maximum 16384 x 16384
DisplayPort-0 disconnected primary (normal left inverted right x axis y axis)
DisplayPort-1 disconnected (normal left inverted right x axis y axis)
DisplayPort-2 disconnected (normal left inverted right x axis y axis)

After exiting X:

[cameron@crt ~]$ cat /sys/class/drm/card0-DP-3/{enabled,status,modes}
enabled
disconnected

It no longer seems to think I have a display connected, but I still have 240p video output.

Other thoughts

Thanks for taking the time to read all this, and thanks so much for writing and maintaining these patches. It's vital and important work for supporting a small and dedicated enthusiast community; work that takes a rare skill set, and I greatly appreciate it.

Full logs

dmesg.out.log Xorg.amdgpu.log

cameronhimself commented 1 year ago

I just saw your commit for kernel 6.2.11 from a few days ago. I'm using 6.2.11 and I compiled it before those changes. I'm guessing that might be at least part of the problem.

I'll recompile the kernel with those changes and update this issue after I do. Probably best not to spend any time on this until then.

cameronhimself commented 1 year ago

I've updated the kernel and it it didn't change anything.

D0023R commented 1 year ago

Hi Cameronhimself,

Thank you for your report and investigation.

For the time being, the 15 kHz patch is only tested on DCN1 and DCN2. With DCNx having mitigated results under amdgpu driver (eg. non working interlaced resolution). I understand that you have proper 15 kHz output under the console but Xorg goes black screen. Normally, without a xorg.conf, Xorg should take the kms resolution (in your case 240p). But ... Your Xorg does not find a valid EDID to activate the screen. You can provide it on the kernel command line (video=DisplayPort-2:320x240ieS drm.edid_firmware=DisplayPort-2:edid/320x240.bin) and check if Xorg is overriding the connector EDID with it. The file must be placed inside the /lib/firmware/edid/ folder. The mentioned edid is now available on the git.

An alternative solution is to use the radeon driver instead, the APU is based on the Radeon R5, it should work better that way.

Good luck and let me know about your progress.

cameronhimself commented 1 year ago

Hey, Doozer, thanks so much for your reply. So, having mucked around with this a good deal more I've been able to start X in 240p. The key pieces were:

As it happens I didn't end up needing to force the EDID with the file you provided--it seems that I just needed to target both DP-3 and DisplayPort-2 and everything else gradually fell into place.

However, as mentioned above, I am not able to get 480i to work at all, even in KMS. Based on what you said about problems with this model of GPU and interlacing, is that something I can assume just isn't going to work? Is it even worth opening another issue about?

D0023R commented 1 year ago

Hey, Happy to hear that you managed to find a solution.

The video connector output name change is indeed something that can happened. It is less a kernel drmkms issue as per say but related to the way the amdgpu is chaining the name. It can indeed create inconsistency and alter the names or order. This is normally causing by adding/removing graphical outputs (card). The kernel is daisy chaining the output names (simplified explanation).

For the interlaced resolution, it depends on the DCN path. I have a 5600G which is working nicely with interlaced resolutions, but the 2400G seems not. To be honest it was not expected so. For the time being, not much investigation happened on that side to find a correct patch (sync pulse inversion for odd/even frames, amd internal register/logic missing). Unfortunately, I will have to answer that you have to survive with progressive modelines for the time being.

cameronhimself commented 1 year ago

Gotcha. Well, I'd be happy to be a guinea pig or even provide the hardware if it's something you'd be interested in working on, but I of course understand if not. In any case, I'll go ahead and close this issue since it's resolved. Thanks again for your time.

cameronhimself commented 1 year ago

One more small question: you already mentioned the 5600G, but do you have a list of other AMD APUs (or any CPUs with integrated graphics) that are known to work with interlacing?