You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rouven Czerwinski
9b7803a9b3
To retrieve the formats, an allocated crtc is required. If there is no currently no crtc available, try to allocate it. This reproducable by having a disabled output and going through a suspend cycle with amdgpu. On start CRTCs look like this: 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1099] Reallocating CRTCs 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1110] State before reallocation: 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DP-1' crtc=0 state=1 desired_enabled=1 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DP-2' crtc=1 state=1 desired_enabled=1 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'HDMI-A-1' crtc=-1 state=0 desired_enabled=0 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'HDMI-A-2' crtc=-1 state=0 desired_enabled=0 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DVI-D-1' crtc=-1 state=0 desired_enabled=0 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1167] State after reallocation: 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DP-1' crtc=0 state=1 desired_enabled=1 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DP-2' crtc=1 state=1 desired_enabled=1 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'HDMI-A-1' crtc=-1 state=0 desired_enabled=0 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'HDMI-A-2' crtc=-1 state=0 desired_enabled=0 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DVI-D-1' crtc=-1 state=0 desired_enabled=0 where DP-1 is than disabled. After suspend/resume, allocation turns into: 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1099] Reallocating CRTCs 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1110] State before reallocation: 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DP-1' crtc=-1 state=1 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DP-2' crtc=1 state=3 desired_enabled=1 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'HDMI-A-1' crtc=-1 state=0 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'HDMI-A-2' crtc=-1 state=0 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DVI-D-1' crtc=-1 state=0 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1167] State after reallocation: 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DP-1' crtc=-1 state=1 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DP-2' crtc=1 state=3 desired_enabled=1 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'HDMI-A-1' crtc=-1 state=0 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'HDMI-A-2' crtc=-1 state=0 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DVI-D-1' crtc=-1 state=0 desired_enabled=0 where the crtc for DP-1 is now NULL. Trying to enable the output results in: 10:43:36.906 [DEBUG] [sway/config/output.c:351] Turning on output DP-1 10:43:36.906 [DEBUG] [sway/config/output.c:360] Set preferred mode 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [sway/config/output.c:366] Preferred mode rejected, falling back to another mode 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [sway/config/output.c:400] Auto-detected output scale: 1.000000 10:43:36.907 [DEBUG] [sway/config/output.c:430] Committing output DP-1 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [ERROR] [sway/config/output.c:435] Failed to commit output DP-1 where the primary format can't be queried since there is no crtc allocated for the connector. Allocating the connector inside drm_connector_get_primary_formats() fixes this issue. This is possible since the only user of get_primary_formats() is the swapchain allocation function, which is only called on output enable. Do the same thing for the cursor formats in case the user queries them before the output is enabled. |
3 years ago | |
---|---|---|
.. | ||
atomic.c | backend/drm: add support for FB_DAMAGE_CLIPS | 3 years ago |
backend.c | backend/drm: add proper error handling to wlr_drm_backend_create | 3 years ago |
cvt.c | backend/drm: add support for custom modes | 5 years ago |
drm.c | backend/drm: try to allocate crtc for formats | 3 years ago |
legacy.c | backend/drm: remove SCANOUT check in drm_connector_test | 3 years ago |
meson.build | backend: make DRM and libinput backends optional | 3 years ago |
properties.c | backend/drm: add support for FB_DAMAGE_CLIPS | 3 years ago |
renderer.c | backend/drm: use addon for wlr_drm_fb | 3 years ago |
util.c | backend/drm: add DRM_MODE_CONNECTOR_USB to conn_get_name | 3 years ago |