summaryrefslogtreecommitdiff
path: root/lib/igt_kms.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-07-06 07:47:47 +0200
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-07-10 09:06:01 +0200
commit4258cc8ea26208a7e9537977df5e4b8c9dcf0e74 (patch)
treef28ae958876da296c0c57f45d75e8e400a6df06e /lib/igt_kms.c
parent1fd51add8fbfc2974a2d0a2a20ae83cd76f0a2de (diff)
igt/kms: Do not wait for fence completion during commit
This will make the IGT tests that use fences more useful, since they can perform the waiting themselves when required. To celebrate, also add plane-use-after-nonblocking-unbind-fencing, the fence version of plane-use-after-nonblocking-unbind. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Diffstat (limited to 'lib/igt_kms.c')
-rw-r--r--lib/igt_kms.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 8bf56faf..6390229f 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1698,6 +1698,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)
pipe->plane_cursor = -1;
pipe->plane_primary = -1;
pipe->planes = NULL;
+ pipe->out_fence_fd = -1;
get_crtc_property(display->drm_fd, pipe->crtc_id,
"background_color",
@@ -1913,6 +1914,9 @@ static void igt_pipe_fini(igt_pipe_t *pipe)
free(pipe->planes);
pipe->planes = NULL;
+
+ if (pipe->out_fence_fd != -1)
+ close(pipe->out_fence_fd);
}
static void igt_output_fini(igt_output_t *output)
@@ -2502,7 +2506,11 @@ static void igt_atomic_prepare_crtc_commit(igt_pipe_t *pipe_obj, drmModeAtomicRe
igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_ACTIVE, !!output);
}
- pipe_obj->out_fence_fd = -1;
+ if (pipe_obj->out_fence_fd != -1) {
+ close(pipe_obj->out_fence_fd);
+ pipe_obj->out_fence_fd = -1;
+ }
+
if (pipe_obj->out_fence_requested)
{
igt_atomic_populate_crtc_req(req, pipe_obj, IGT_CRTC_OUT_FENCE_PTR,
@@ -2607,16 +2615,9 @@ 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) {
+ if (s == COMMIT_ATOMIC && pipe_obj->out_fence_requested) {
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) {