Re: [PATCH i-g-t v5 07/13] tests/sw_sync: Add subtest test_sync_merge

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 15, 2016 at 08:27:15PM -0400, Robert Foss wrote:
> 
> 
> On 2016-09-15 04:41 PM, Chris Wilson wrote:
> >On Thu, Sep 15, 2016 at 02:40:12PM -0400, robert.foss@xxxxxxxxxxxxx wrote:
> >>From: Robert Foss <robert.foss@xxxxxxxxxxxxx>
> >>
> >>Add subtest test_sync_merge that tests merging fences and the validity of the
> >>resulting merged fence.
> >>
> >>Signed-off-by: Robert Foss <robert.foss@xxxxxxxxxxxxx>
> >>Reviewed-by: Eric Engestrom <eric@xxxxxxxxxxxx>
> >>---
> >> tests/sw_sync.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >> 1 file changed, 67 insertions(+)
> >>
> >>diff --git a/tests/sw_sync.c b/tests/sw_sync.c
> >>index 3061279..26226bd 100644
> >>--- a/tests/sw_sync.c
> >>+++ b/tests/sw_sync.c
> >>@@ -116,6 +116,70 @@ static void test_sync_wait(void)
> >> 	close(timeline);
> >> }
> >>
> >>+static void test_sync_merge(void)
> >>+{
> >>+	int in_fence[3];
> >>+	int fence_merge;
> >>+	int timeline;
> >>+	int active, signaled;
> >>+
> >>+	timeline = sw_sync_timeline_create();
> >>+	in_fence[0] = sw_sync_fence_create(timeline, 1);
> >>+	in_fence[1] = sw_sync_fence_create(timeline, 2);
> >>+	in_fence[2] = sw_sync_fence_create(timeline, 3);
> >>+
> >>+	fence_merge = sw_sync_merge(in_fence[0], in_fence[1]);
> >>+	fence_merge = sw_sync_merge(in_fence[2], fence_merge);
> >
> >sw_sync_merge() really does need the negative tests:
> >
> >invalid fd (-1),
> >device fd (/dev/dri/card0),
> >file fd.
> 
> Open other descriptors sounds like a good idea, but for device and

fd = drm_open_driver(DRIVER_ANY)

tmppath[] = "/tmp/igt-XXXXXX";
fd = mkstemp(tmppath);
if (fd != -1) {
	unlink(tmppath);
	test_with_invalid_fd(fd);
	close(fd);
}
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux