public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_plane_multiple: Commit state before remove_fb calls
@ 2019-08-02 17:27 Nicholas Kazlauskas
  2019-08-02 18:14 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nicholas Kazlauskas @ 2019-08-02 17:27 UTC (permalink / raw)
  To: igt-dev

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@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@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

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-19 14:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-02 17:27 [igt-dev] [PATCH i-g-t] tests/kms_plane_multiple: Commit state before remove_fb calls Nicholas Kazlauskas
2019-08-02 18:14 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-08-04 12:02 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-08-19 14:14 ` [igt-dev] [PATCH i-g-t] " Li, Sun peng (Leo)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox