drm_pending_state_apply_atomic: plane_add_prop() calls break amdgpu atomic modesetting
I need this patch to run Weston on my desktop (AMD POLARIS10, FreeBSD -CURRENT, drm/kms 4.16, libdrm 2.4.96, mesa git) with AMDGPU.DC enabled (⇒ atomic modesetting supported):
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -2681,8 +2681,8 @@ drm_pending_state_apply_atomic(struct drm_pending_state *pending_state,
wl_list_for_each(plane, &b->plane_list, link) {
drm_debug(b, "\t\t[atomic] starting with plane %lu disabled\n",
(unsigned long) plane->plane_id);
- plane_add_prop(req, plane, WDRM_PLANE_CRTC_ID, 0);
- plane_add_prop(req, plane, WDRM_PLANE_FB_ID, 0);
+ //plane_add_prop(req, plane, WDRM_PLANE_CRTC_ID, 0);
+ //plane_add_prop(req, plane, WDRM_PLANE_FB_ID, 0);
}
flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
Without these changes, it's a blank screen and weston says this:
[00:44:19.683] atomic: couldn't commit new state: Invalid argument
while the driver says:
WARNING state->crtc && !state->fb failed at …/kms-drm/drivers/gpu/drm/drm_atomic.c:874
This is NOT necessary with i915 (on a Haswell laptop).