From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: gustavo.padovan@collabora.co.uk
Subject: [PATCH i-g-t 2/5] lib/kms: Handle fence interaction correctly WRT TEST_ONLY.
Date: Thu, 6 Jul 2017 09:11:44 +0200 [thread overview]
Message-ID: <20170706071147.15414-3-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20170706071147.15414-1-maarten.lankhorst@linux.intel.com>
All other atomic properties are reset in display_commit_changed,
which is the right place because TEST_ONLY commits don't need to
be reset.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
lib/igt_kms.c | 38 ++++++++++++++++----------------------
1 file changed, 16 insertions(+), 22 deletions(-)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index faf9df2fcedf..8bf56faf41e9 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2505,7 +2505,6 @@ static void igt_atomic_prepare_crtc_commit(igt_pipe_t *pipe_obj, drmModeAtomicRe
pipe_obj->out_fence_fd = -1;
if (pipe_obj->out_fence_requested)
{
- pipe_obj->out_fence_requested = false;
igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_OUT_FENCE_PTR,
(uint64_t)(uintptr_t) &pipe_obj->out_fence_fd);
}
@@ -2586,27 +2585,6 @@ static int igt_atomic_commit(igt_display_t *display, uint32_t flags, void *user_
}
ret = drmModeAtomicCommit(display->drm_fd, req, flags, user_data);
- if (!ret) {
-
- for_each_pipe(display, pipe) {
- igt_pipe_t *pipe_obj = &display->pipes[pipe];
- igt_plane_t *plane;
-
- /* reset fence_fd to prevent it from being set for the next commit */
- for_each_plane_on_pipe(display, pipe, plane) {
- igt_plane_set_fence_fd(plane, -1);
- }
-
- if (pipe_obj->out_fence_fd == -1)
- continue;
-
- igt_assert(pipe_obj->out_fence_fd >= 0);
- ret = sync_fence_wait(pipe_obj->out_fence_fd, 1000);
- igt_assert(ret == 0);
- close(pipe_obj->out_fence_fd);
- pipe_obj->out_fence_fd = -1;
- }
- }
drmModeAtomicFree(req);
return ret;
@@ -2629,6 +2607,18 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s)
if (s != COMMIT_UNIVERSAL)
pipe_obj->mode_changed = false;
+ if (s == COMMIT_ATOMIC) {
+ pipe_obj->out_fence_requested = false;
+
+ if (pipe_obj->out_fence_fd == -1)
+ continue;
+
+ igt_assert(pipe_obj->out_fence_fd >= 0);
+ igt_assert_eq(sync_fence_wait(pipe_obj->out_fence_fd, 1000), 0);
+ close(pipe_obj->out_fence_fd);
+ pipe_obj->out_fence_fd = -1;
+ }
+
for_each_plane_on_pipe(display, pipe, plane) {
plane->fb_changed = false;
plane->position_changed = false;
@@ -2638,6 +2628,10 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s)
!(plane->type == DRM_PLANE_TYPE_PRIMARY ||
plane->type == DRM_PLANE_TYPE_CURSOR))
plane->rotation_changed = false;
+
+ if (s == COMMIT_ATOMIC)
+ /* reset fence_fd to prevent it from being set for the next commit */
+ igt_plane_set_fence_fd(plane, -1);
}
}
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-07-06 7:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-06 7:11 [PATCH i-g-t 0/5] igt/kms: Make fence waiting explicit Maarten Lankhorst
2017-07-06 7:11 ` [PATCH i-g-t 1/5] tests/kms_atomic_transition: Add test for plane completion ordering Maarten Lankhorst
2017-07-06 7:11 ` Maarten Lankhorst [this message]
2017-07-06 7:11 ` [PATCH i-g-t 3/5] tests/kms_atomic_transition: Only request fence on enabled pipes Maarten Lankhorst
2017-07-06 7:11 ` [PATCH i-g-t 4/5] tests/kms_atomic_transition: Do not clear in-fences after atomic commit Maarten Lankhorst
2017-07-06 7:11 ` [PATCH i-g-t 5/5] igt/kms: Do not wait for fence completion during commit Maarten Lankhorst
2017-07-07 0:15 ` [PATCH i-g-t 0/5] igt/kms: Make fence waiting explicit Gustavo Padovan
2017-07-10 7:06 ` Maarten Lankhorst
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170706071147.15414-3-maarten.lankhorst@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=gustavo.padovan@collabora.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).