[igt-dev] [PATCH i-g-t] tests/kms_plane_multiple: Commit state before remove_fb calls

Nicholas Kazlauskas nicholas.kazlauskas at amd.com
Fri Aug 2 17:27:05 UTC 2019


The kms_plane_multiple@* tests fail on amdgpu with a dmesg-warn due to

"atomic remove_fb failed with -22"
"WARNING: CPU: 6 PID: 183 at drivers/gpu/drm/drm_framebuffer.c:986"

The call to drmModeRmFB essentially creates an atomic commit internally
when we drop the last reference to the FB in IGT. This commit disables
the plane associated with framebuffer.

Since the planes are iterated by increasing index in IGT the last
plane to have its framebuffer removed is the cursor plane on AMDGPU.

On AMDGPU we can't enable the cursor plane without any active hardware
planes (primary, overlay) since there is no dedicated cursor plane.

The commits to release the overlay plane fail since it's the last
remaining plane and the cursor plane is still active.

The fix to the test is to just perform a commit that disables all 3
planes at the same time before calling remove_fb.

This improves performance enables support for drivers that don't
support cursor planes being enabled without a primary or overlay.

Cc: Leo Li <sunpeng.li at amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
---
 tests/kms_plane_multiple.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
index 81ed45dd..255cd34a 100644
--- a/tests/kms_plane_multiple.c
+++ b/tests/kms_plane_multiple.c
@@ -317,6 +317,8 @@ test_plane_position_with_output(data_t *data, enum pipe pipe,
 		for_each_plane_on_pipe(&data->display, pipe, plane)
 			igt_plane_set_fb(plane, NULL);
 
+		igt_display_commit2(&data->display, COMMIT_ATOMIC);
+
 		for (int x = 0; x < c; x++)
 			igt_remove_fb(data->drm_fd, &data->fb[x]);
 	} while (!err && c < n_planes);
@@ -340,6 +342,8 @@ test_plane_position_with_output(data_t *data, enum pipe pipe,
 		for_each_plane_on_pipe(&data->display, pipe, plane)
 			igt_plane_set_fb(plane, NULL);
 
+		igt_display_commit2(&data->display, COMMIT_ATOMIC);
+
 		for (int x = 0; x < c; x++)
 			igt_remove_fb(data->drm_fd, &data->fb[x]);
 
-- 
2.17.1



More information about the igt-dev mailing list