Skip to content

drm/compositor: test complete state on format test #1708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cmeissl
Copy link
Collaborator

@cmeissl cmeissl commented Apr 11, 2025

include all planes when testing a format, we only set the primary plane so test with all other planes disabled

include all planes when testing a format, we only set the primary plane so
test with all other planes disabled
@nferhat
Copy link
Contributor

nferhat commented Apr 14, 2025

Just tried this, doesn't seem to fix it :/

@cmeissl
Copy link
Collaborator Author

cmeissl commented Apr 14, 2025

Can you please add both logs, debug log from the compositor and a drm debug log? I am not sure why it does not work, the format test should not differ from direct DrmCompositor usage.

@nferhat
Copy link
Contributor

nferhat commented May 13, 2025

Can you please add both logs, debug log from the compositor and a drm debug log? I am not sure why it does not work, the format test should not differ from direct DrmCompositor usage.

Hello, sorry for being this late. Here's the DRM debug log and compositor log gathered using this script

#!/usr/bin/env bash

echo 0x19F | sudo tee /sys/module/drm/parameters/debug  # enables verbose drm logging
sudo dmesg -C                                           # clears kernel debug logs
sudo dmesg -w > ~/dmesg.log &                           # writes kernel logs in the background to a file at ~/dmesg.log
RUST_LOG=trace fht-compositor > ~/fht-comopsitor.log    # write compositor log

fg # after this, use CTRL+C to stop writing the logs
echo 0 | sudo tee /sys/module/drm/parameters/debug # disables drm logging, don't forget this to avoid slowdowns

fht-comopsitor.log
dmesg.log

@cmeissl
Copy link
Collaborator Author

cmeissl commented May 18, 2025

From the dmesg log it looks like you request a mode that exceeds the supported bandwidth.

You can see a lot of messages like:

[  281.606022] [drm:sdma_v6_0_ring_set_wptr [amdgpu]] Using doorbell -- wptr_offs == 0x000001b8 lower_32_bits(ring->wptr) << 2 == 0x0023ef40 upper_32_bits(ring->wptr) << 2 == 0x00000000
[  281.606074] [drm:create_validate_stream_for_sink [amdgpu]] Mode 2560x1440 (clk 1037750) pixel_encoding:RGB color_depth:10-bpc failed validation -- No DP link bandwidth
[  281.606109] [drm:amdgpu_ih_process [amdgpu]] amdgpu_ih_process: rptr 170400, wptr 170464
[  281.606111] [drm:sdma_v6_0_ring_set_wptr [amdgpu]] calling WDOORBELL64(0x00000214, 0x000000000023ef40)
[  281.606197] [drm:sdma_v6_0_process_trap_irq [amdgpu]] IH: SDMA trap
[  281.606194] [drm:update_stream_scaling_settings [amdgpu]] Destination Rectangle x:0  y:0  width:2560  height:1440
[  281.606288] [drm:amdgpu_irq_dispatch [amdgpu]] Unregistered interrupt src_id: 51 of client_id:10
[  281.606290] [drm:sdma_v6_0_ring_set_wptr [amdgpu]] Using doorbell -- wptr_offs == 0x000001b8 lower_32_bits(ring->wptr) << 2 == 0x0023efc0 upper_32_bits(ring->wptr) << 2 == 0x00000000
[  281.606294] [drm:create_validate_stream_for_sink [amdgpu]] Mode 2560x1440 (clk 1037750) pixel_encoding:RGB color_depth:10-bpc failed validation -- No DP link bandwidth
[  281.606376] [drm:amdgpu_ih_process [amdgpu]] amdgpu_ih_process: rptr 170464, wptr 170528
[  281.606380] [drm:sdma_v6_0_ring_set_wptr [amdgpu]] calling WDOORBELL64(0x00000214, 0x000000000023efc0)
[  281.606395] [drm:update_stream_scaling_settings [amdgpu]] Destination Rectangle x:0  y:0  width:2560  height:1440
[  281.606464] [drm:sdma_v6_0_process_trap_irq [amdgpu]] IH: SDMA trap
[  281.606470] [drm:sdma_v6_0_ring_set_wptr [amdgpu]] Using doorbell -- wptr_offs == 0x000001b8 lower_32_bits(ring->wptr) << 2 == 0x0023f040 upper_32_bits(ring->wptr) << 2 == 0x00000000
[  281.606488] [drm:create_validate_stream_for_sink [amdgpu]] Mode 2560x1440 (clk 1037750) pixel_encoding:RGB color_depth:10-bpc failed validation -- No DP link bandwidth
[  281.606555] [drm:amdgpu_irq_dispatch [amdgpu]] Unregistered interrupt src_id: 51 of client_id:10
[  281.606577] [drm:sdma_v6_0_ring_set_wptr [amdgpu]] calling WDOORBELL64(0x00000214, 0x000000000023f040)
[  281.606600] [drm:update_stream_scaling_settings [amdgpu]] Destination Rectangle x:0  y:0  width:2560  height:1440
[  281.606643] [drm:amdgpu_ih_process [amdgpu]] amdgpu_ih_process: rptr 170528, wptr 170592
[  281.606691] [drm:create_validate_stream_for_sink [amdgpu]] Mode 2560x1440 (clk 1037750) pixel_encoding:RGB color_depth:10-bpc failed validation -- No DP link bandwidth
[  281.606731] [drm:sdma_v6_0_process_trap_irq [amdgpu]] IH: SDMA trap
[  281.606787] [drm:update_stream_scaling_settings [amdgpu]] Destination Rectangle x:0  y:0  width:2560  height:1440
[  281.606822] [drm:amdgpu_irq_dispatch [amdgpu]] Unregistered interrupt src_id: 51 of client_id:10
[  281.606892] [drm:create_validate_stream_for_sink [amdgpu]] Mode 2560x1440 (clk 1037750) pixel_encoding:RGB color_depth:8-bpc failed validation -- No DP link bandwidth

So the drivers tries to lower the bpc, but still fails to select a supported mode. My guess is that the pixel clock exceeds what is supported by your hardware.

The driver seems to return an out of memory error for this case (not something in smithay):

[  281.607453] amdgpu 0000:03:00.0: [drm:drm_atomic_check_only] atomic driver check for 000000007a70e816 failed: -12

The log indicates that the highest supported mode is 2560x1440@180, but only with a lower pixel clock at 714810 and with a maximum of 8bpc. The pixel clock 1037750 looks like you try to use a standard CVT mode, maybe reduced blanking is able to lower the pixel clock enough. Something like Modeline "2560x1440_179.96" 768.5 2560 2608 2640 2720 1440 1443 1448 1570 +HSync -VSync might work.

Logind seems to use a pixel clock of 714810 for 2560x1440@180, which aligns with the probed modes:

[  281.602466] amdgpu 0000:03:00.0: [drm:drm_helper_probe_single_connector_modes] Probed mode: "2560x1440": 180 714810 2560 2608 2640 2720 1440 1443 1448 1460 0x40 0x9

@nferhat
Copy link
Contributor

nferhat commented May 18, 2025

I suppose using a lower bpc value (IE. using 8-bit colors instead of 10-bit ones) would allow for plane creation, but this doesn't seem to change anything? At least from the DRM logs, the compositor is still requesting 10bpc even when using [Fourcc::Abgr8888, Fourcc::Argb8888] as requested formats for DrmOutputManager

@cmeissl
Copy link
Collaborator Author

cmeissl commented May 18, 2025

I suppose using a lower bpc value (IE. using 8-bit colors instead of 10-bit ones) would allow for plane creation, but this doesn't seem to change anything? At least from the DRM logs, the compositor is still requesting 10bpc even when using [Fourcc::Abgr8888, Fourcc::Argb8888] as requested formats for DrmOutputManager

Afaict from the amdgpu driver source and the dmesg log it already tries to reduce bpc, starting from the max_bpc specified. But that does not address the pixel clock I mentioned, did you try with the timings I provided or with reduced blanking?

@nferhat
Copy link
Contributor

nferhat commented May 18, 2025

I suppose using a lower bpc value (IE. using 8-bit colors instead of 10-bit ones) would allow for plane creation, but this doesn't seem to change anything? At least from the DRM logs, the compositor is still requesting 10bpc even when using [Fourcc::Abgr8888, Fourcc::Argb8888] as requested formats for DrmOutputManager

Afaict from the amdgpu driver source and the dmesg log it already tries to reduce bpc, starting from the max_bpc specified. But that does not address the pixel clock I mentioned, did you try with the timings I provided or with reduced blanking?

Trying reduced blanking gave me a black screen. With the monitor saying there's no signal.

Trying the modeline, the DRM logs do give that pixel clock, as seen in the logs

[ 5235.986636] amdgpu 0000:03:00.0: [drm:update_display_info.part.0] [CONNECTOR:106:DP-3] Supported Monitor Refresh rate range is 48 Hz - 180 Hz
[ 5235.986639] amdgpu 0000:03:00.0: [drm:update_display_info.part.0] [CONNECTOR:106:DP-3] CEA VCDB 0xc0
[ 5235.986642] amdgpu 0000:03:00.0: [drm:update_display_info.part.0] [CONNECTOR:106:DP-3] DisplayID extension version 0x12, primary use 0x03
[ 5235.986643] amdgpu 0000:03:00.0: [drm:update_display_info.part.0] [CONNECTOR:106:DP-3] Assigning EDID-1.4 digital sink color depth as 10 bpc.
[ 5235.986645] amdgpu 0000:03:00.0: [drm:update_display_info.part.0] [CONNECTOR:106:DP-3] ELD monitor MSI MAG 275QF
[ 5235.986646] amdgpu 0000:03:00.0: [drm:update_display_info.part.0] [CONNECTOR:106:DP-3] ELD size 36, SAD count 1
[ 5235.986649] [drm:sdma_v6_0_process_trap_irq [amdgpu]] IH: SDMA trap
[ 5235.986706] [drm:update_stream_scaling_settings [amdgpu]] Destination Rectangle x:0  y:0  width:2560  height:1440
[ 5235.986756] [drm:amdgpu_irq_dispatch [amdgpu]] Unregistered interrupt src_id: 51 of client_id:10
[ 5235.986863] [drm:amdgpu_ih_process [amdgpu]] amdgpu_ih_process: rptr 67584, wptr 67584
[ 5235.986900] [drm:update_stream_scaling_settings [amdgpu]] Destination Rectangle x:0  y:0  width:2560  height:1440
[ 5235.987026] [drm:create_validate_stream_for_sink [amdgpu]] Mode 2560x1440 (clk 714810) pixel_encoding:RGB color_depth:10-bpc failed validation -- No DP link bandwidth
[ 5235.987152] [drm:update_stream_scaling_settings [amdgpu]] Destination Rectangle x:0  y:0  width:2560  height:1440
[ 5235.987266] [drm:create_validate_stream_for_sink [amdgpu]] Mode 2560x1440 (clk 714810) pixel_encoding:RGB color_depth:10-bpc failed validation -- No DP link bandwidth
[ 5235.987381] [drm:update_stream_scaling_settings [amdgpu]] Destination Rectangle x:0  y:0  width:2560  height:1440
[ 5235.987494] [drm:create_validate_stream_for_sink [amdgpu]] Mode 2560x1440 (clk 714810) pixel_encoding:RGB color_depth:10-bpc failed validation -- No DP link bandwidth
[ 5235.987605] [drm:update_stream_scaling_settings [amdgpu]] Destination Rectangle x:0  y:0  width:2560  height:1440
[ 5235.987716] [drm:create_validate_stream_for_sink [amdgpu]] Mode 2560x1440 (clk 714810) pixel_encoding:RGB color_depth:10-bpc failed validation -- No DP link bandwidth
[ 5235.987818] [drm:update_stream_scaling_settings [amdgpu]] Destination Rectangle x:0  y:0  width:2560  height:1440
[ 5235.987933] [drm:update_stream_scaling_settings [amdgpu]] Destination Rectangle x:0  y:0  width:2560  height:1440
[ 5235.988039] [drm:create_validate_stream_for_sink [amdgpu]] Mode 2560x1440 (clk 699500) pixel_encoding:RGB color_depth:10-bpc failed validation -- No DP link bandwidth
[ 5235.988151] [drm:update_stream_scaling_settings [amdgpu]] Destination Rectangle x:0  y:0  width:2560  height:1440
[ 5235.988259] [drm:create_validate_stream_for_sink [amdgpu]] Mode 2560x1440 (clk 699500) pixel_encoding:RGB color_depth:10-bpc failed validation -- No DP link bandwidth
[ 5235.988362] [drm:update_stream_scaling_settings [amdgpu]] Destination Rectangle x:0  y:0  width:2560  height:1440
[ 5235.988463] [drm:create_validate_stream_for_sink [amdgpu]] Mode 2560x1440 (clk 699500) pixel_encoding:RGB color_depth:10-bpc failed validation -- No DP link bandwidth
[ 5235.988574] [drm:update_stream_scaling_settings [amdgpu]] Destination Rectangle x:0  y:0  width:2560  height:1440
[ 5235.988680] [drm:create_validate_stream_for_sink [amdgpu]] Mode 2560x1440 (clk 699500) pixel_encoding:RGB color_depth:10-bpc failed validation -- No DP link bandwidth

But I still get a black screen, with the monitor saying there's no signal. If you can any additional cues from the log, here is it.
dmesg.log

@nferhat
Copy link
Contributor

nferhat commented May 18, 2025

@cmeissl So it seems, whatever I do, it always has too much bandwidth for the link, and if it finds a mode that fits, it seems that the compositor does not do anything? Maybe its then something from my side.

@cmeissl
Copy link
Collaborator Author

cmeissl commented May 18, 2025

@cmeissl So it seems, whatever I do, it always has too much bandwidth for the link, and if it finds a mode that fits, it seems that the compositor does not do anything? Maybe its then something from my side.

The mode from logind, which I guess works?, should be something like this: Modeline "2560x1440_179.96" 714.810 2560 2608 2640 2720 1440 1443 1448 1460 +HSync -VSync
I can only guess, but maybe you either have a mode that hits a bandwith limit or which is unsupported by the monitor.

@nferhat
Copy link
Contributor

nferhat commented May 18, 2025

What's confusing me the most is that this only happens when I try to start the compositor with that mode. If I start the compositor with the default mode (2560x1440@60) then tell the compositor to switch to 2560x1440@180, it switches without complaining.

@cmeissl
Copy link
Collaborator Author

cmeissl commented May 18, 2025

What's confusing me the most is that this only happens when I try to start the compositor with that mode. If I start the compositor with the default mode (2560x1440@60) then tell the compositor to switch to 2560x1440@180, it switches without complaining.

That's strange, yeah. Hm, do you disable all connectors on startup prior to initializing the outputs?

Can you also take a log of the working switch (smithay and drm)?

@nferhat
Copy link
Contributor

nferhat commented May 18, 2025

What's confusing me the most is that this only happens when I try to start the compositor with that mode. If I start the compositor with the default mode (2560x1440@60) then tell the compositor to switch to 2560x1440@180, it switches without complaining.

That's strange, yeah. Hm, do you disable all connectors on startup prior to initializing the outputs?

I do not do that? At least I don't think I am. I do DrmScanner::scan_connectors then for each DrmScanEvent::Connected I add the connector.

Can you also take a log of the working switch (smithay and drm)?

Sure
dmesg.log
fht-comopsitor.log

@cmeissl
Copy link
Collaborator Author

cmeissl commented May 18, 2025

What's confusing me the most is that this only happens when I try to start the compositor with that mode. If I start the compositor with the default mode (2560x1440@60) then tell the compositor to switch to 2560x1440@180, it switches without complaining.

That's strange, yeah. Hm, do you disable all connectors on startup prior to initializing the outputs?

I do not do that? At least I don't think I am. I do DrmScanner::scan_connectors then for each DrmScanEvent::Connected I add the connector.

You can disable all connectors when initializing the DrmDevice by passing true for disable_connectors.

@nferhat
Copy link
Contributor

nferhat commented May 18, 2025

What's confusing me the most is that this only happens when I try to start the compositor with that mode. If I start the compositor with the default mode (2560x1440@60) then tell the compositor to switch to 2560x1440@180, it switches without complaining.

That's strange, yeah. Hm, do you disable all connectors on startup prior to initializing the outputs?

I do not do that? At least I don't think I am. I do DrmScanner::scan_connectors then for each DrmScanEvent::Connected I add the connector.

You can disable all connectors when initializing the DrmDevice by passing true for disable_connectors.

Yep, I am already doing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants