drm output disable fails with dsi panel
Created by: agx
For a LCD panel connected via dsi (nwl dsi host controller + (mxsfb of dcss display controller)) a
wlr_output_enable (output->wlr_output, false);
fails like
Oct 30 17:02:19 pureos phoc[390]: [subprojects/wlroots/backend/drm/atomic.c:55] DSI-1: Atomic commit failed (modeset): Invalid argument
this with drm.debug=0x3f
[ 258.912733] [drm:drm_ioctl] pid=1175, dev=0xe201, auth=1, DRM_IOCTL_MODE_ATOMIC
[ 258.912759] [drm:drm_atomic_state_init] Allocated atomic state 00000000d3edbb8c
[ 258.912783] [drm:drm_mode_object_get] OBJ ID: 37 (2)
[ 258.912797] [drm:drm_atomic_get_crtc_state] Added [CRTC:32:crtc-0] 00000000963a1f74 state to 00000000d3edbb8c
[ 258.912809] [drm:drm_mode_object_put.part.3] OBJ ID: 37 (3)
[ 258.912824] [drm:drm_atomic_set_mode_prop_for_crtc] Set [NOMODE] for [CRTC:32:crtc-0] state 00000000963a1f74
[ 258.912843] [drm:drm_mode_object_get] OBJ ID: 34 (4)
[ 258.912852] [drm:drm_mode_object_get] OBJ ID: 34 (5)
[ 258.912864] [drm:drm_atomic_get_connector_state] Added [CONNECTOR:34:DSI-1] 00000000c425d48f state to 00000000d3edbb8c
[ 258.912875] [drm:drm_mode_object_put.part.3] OBJ ID: 34 (6)
[ 258.912888] [drm:drm_atomic_set_crtc_for_connector] Link [CONNECTOR:34:DSI-1] state 00000000c425d48f to [NOCRTC]
[ 258.912897] [drm:drm_mode_object_put.part.3] OBJ ID: 34 (5)
[ 258.912909] [drm:drm_atomic_check_only] checking 00000000d3edbb8c
[ 258.912927] [drm:drm_atomic_helper_check_modeset] [CRTC:32:crtc-0] mode changed
[ 258.912937] [drm:drm_atomic_helper_check_modeset] [CRTC:32:crtc-0] enable changed
[ 258.912947] [drm:drm_atomic_helper_check_modeset] [CRTC:32:crtc-0] active changed
[ 258.912959] [drm:drm_atomic_helper_check_modeset] Updating routing for [CONNECTOR:34:DSI-1]
[ 258.912969] [drm:drm_atomic_helper_check_modeset] Disabling [CONNECTOR:34:DSI-1]
[ 258.912981] [drm:drm_atomic_helper_check_modeset] [CRTC:32:crtc-0] needs all connectors, enable: n, active: n
[ 258.912994] [drm:drm_atomic_add_affected_connectors] Adding all current connectors for [CRTC:32:crtc-0] to 00000000d3edbb8c
[ 258.913011] [drm:drm_atomic_add_affected_planes] Adding all current planes for [CRTC:32:crtc-0] to 00000000d3edbb8c
[ 258.913023] [drm:drm_mode_object_get] OBJ ID: 36 (2)
[ 258.913035] [drm:drm_atomic_get_plane_state] Added [PLANE:31:plane-0] 000000008aa73efe state to 00000000d3edbb8c
[ 258.913055] [drm:drm_atomic_helper_check_planes] [CRTC:32:crtc-0] atomic driver check failed
[ 258.913066] [drm:drm_atomic_check_only] atomic driver check for 00000000d3edbb8c failed: -22
[ 258.913079] [drm:drm_atomic_state_default_clear] Clearing atomic state 00000000d3edbb8c
[ 258.913090] [drm:drm_mode_object_put.part.3] OBJ ID: 34 (4)
[ 258.913101] [drm:drm_mode_object_put.part.3] OBJ ID: 36 (3)
[ 258.913112] [drm:__drm_atomic_state_free] Freeing atomic state 00000000d3edbb8c
[ 258.913125] [drm:drm_ioctl] pid=1175, ret = -22
so drm_atomic_helper_check_planes
fails. If i disable the crtc and mode property change like:
diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c
index c9fb1f45..4e259949 100644
--- a/backend/drm/atomic.c
+++ b/backend/drm/atomic.c
@@ -145,8 +145,10 @@ static bool atomic_conn_enable(struct wlr_drm_backend *drm,
atomic_add(&atom, conn->id, conn->props.crtc_id, crtc->id);
atomic_add(&atom, crtc->id, crtc->props.mode_id, crtc->mode_id);
} else {
+#if 0
atomic_add(&atom, conn->id, conn->props.crtc_id, 0);
atomic_add(&atom, crtc->id, crtc->props.mode_id, 0);
+#endif
}
return atomic_commit(drm->fd, &atom, conn, DRM_MODE_ATOMIC_ALLOW_MODESET,
true);
disabling and enabling works as expected:
disable:
off
Oct 30 17:37:09 pureos phoc[7757]: [subprojects/wlroots/backend/drm/drm.c:906] Reallocating CRTCs
Oct 30 17:37:09 pureos phoc[7757]: [subprojects/wlroots/backend/drm/drm.c:918] State before reallocation:
Oct 30 17:37:09 pureos phoc[7757]: [subprojects/wlroots/backend/drm/drm.c:928] 'DSI-1' crtc=0 state=3 desired_enabled=0
Oct 30 17:37:09 pureos phoc[7757]: [subprojects/wlroots/backend/drm/drm.c:989] State after reallocation:
Oct 30 17:37:09 pureos phoc[7757]: [subprojects/wlroots/backend/drm/drm.c:994] 'DSI-1' crtc=0 state=3 desired_enabled=0
Oct 30 17:37:09 pureos phoc[7757]: [subprojects/wlroots/backend/drm/drm.c:464] Reallocating planes
enable:
Oct 30 17:37:31 pureos phoc[7757]: [subprojects/wlroots/backend/drm/drm.c:376] Starting renderer on output 'DSI-1'
Oct 30 17:37:31 pureos phoc[7757]: [subprojects/wlroots/backend/drm/drm.c:809] Skipping pageflip on output 'DSI-1'
Looking at weston it seems to do the same things so i wonder what to do?
this is the drm_info
output:
node: /dev/dri/card1
├───Driver: mxsfb-drm (MXSFB Controller DRM) version 1.0.0 (20160824)
│ ├───DRM_CLIENT_CAP_STEREO_3D supported
│ ├───DRM_CLIENT_CAP_UNIVERSAL_PLANES supported
│ ├───DRM_CLIENT_CAP_ATOMIC supported
│ ├───DRM_CLIENT_CAP_ASPECT_RATIO supported
│ ├───DRM_CLIENT_CAP_WRITEBACK_CONNECTORS supported
│ ├───DRM_CAP_DUMB_BUFFER = 1
│ ├───DRM_CAP_VBLANK_HIGH_CRTC = 1
│ ├───DRM_CAP_DUMB_PREFERRED_DEPTH = 0
│ ├───DRM_CAP_DUMB_PREFER_SHADOW = 0
│ ├───DRM_CAP_PRIME = 3
│ ├───DRM_CAP_TIMESTAMP_MONOTONIC = 1
│ ├───DRM_CAP_ASYNC_PAGE_FLIP = 0
│ ├───DRM_CAP_CURSOR_WIDTH = 64
│ ├───DRM_CAP_CURSOR_HEIGHT = 64
│ ├───DRM_CAP_ADDFB2_MODIFIERS = 0
│ ├───DRM_CAP_PAGE_FLIP_TARGET = 0
│ ├───DRM_CAP_CRTC_IN_VBLANK_EVENT = 1
│ ├───DRM_CAP_SYNCOBJ = 0
│ └───DRM_CAP_SYNCOBJ_TIMELINE = 0
├───Device: platform fsl,imx8mq-lcdif fsl,imx28-lcdif
├───Framebuffer size
│ ├───Width: [120, 65535]
│ └───Height: [120, 65535]
├───Connectors
│ └───Connector 0
│ ├───Object ID: 34
│ ├───Type: DSI
│ ├───Status: connected
│ ├───Physical size: 65x130 mm
│ ├───Subpixel: unknown
│ ├───Encoders: {0}
│ ├───Modes
│ │ └───720x1440@60.00 preferred driver nhsync nvsync
│ └───Properties
│ ├───"EDID" (immutable): blob = 0
│ ├───"DPMS": enum {On, Standby, Suspend, Off} = On
│ ├───"link-status": enum {Good, Bad} = Good
│ ├───"non-desktop" (immutable): range [0, 1] = 0
│ ├───"TILE" (immutable): blob = 0
│ └───"CRTC_ID" (atomic): object CRTC = 32
├───Encoders
│ └───Encoder 0
│ ├───Object ID: 33
│ ├───Type: none
│ ├───CRTCS: {0}
│ └───Clones: {}
├───CRTCs
│ └───CRTC 0
│ ├───Object ID: 32
│ ├───Mode: 720x1440@60.00 preferred driver nhsync nvsync
│ └───Properties
│ ├───"ACTIVE" (atomic): range [0, 1] = 1
│ ├───"MODE_ID" (atomic): blob = 37
│ │ └───720x1440@60.00 preferred driver nhsync nvsync
│ ├───"OUT_FENCE_PTR" (atomic): range [0, UINT64_MAX] = 0
│ └───"VRR_ENABLED": range [0, 1] = 0
└───Planes
└───Plane 0
├───Object ID: 31
├───CRTCs: {0}
├───Formats:
│ ├───XRGB8888 (0x34325258)
│ └───RGB565 (0x36314752)
└───Properties
├───"type" (immutable): enum {Overlay, Primary, Cursor} = Primary
├───"FB_ID" (atomic): object framebuffer = 36
├───"IN_FENCE_FD" (atomic): srange [-1, INT32_MAX] = -1
├───"CRTC_ID" (atomic): object CRTC = 32
├───"CRTC_X" (atomic): srange [INT32_MIN, INT32_MAX] = 0
├───"CRTC_Y" (atomic): srange [INT32_MIN, INT32_MAX] = 0
├───"CRTC_W" (atomic): range [0, INT32_MAX] = 720
├───"CRTC_H" (atomic): range [0, INT32_MAX] = 1440
├───"SRC_X" (atomic): range [0, UINT32_MAX] = 0
├───"SRC_Y" (atomic): range [0, UINT32_MAX] = 0
├───"SRC_W" (atomic): range [0, UINT32_MAX] = 720
└───"SRC_H" (atomic): range [0, UINT32_MAX] = 1440