On Fri, Oct 28, 2016 at 12:31:28PM +0300, Marius Vlad wrote:
> +     igt_subtest_group {
> +             int fd;
> +
> +             igt_fixture
> +                     fd = __drm_open_driver(DRIVER_INTEL);
> +
> +             igt_subtest_group {
> +                     igt_subtest("basic-gem-info")
> +                             if ((err = gem_info(fd)))
> +                                     igt_fail(err);
> +                     igt_subtest_group
> +                             if ((err = gem_exec_store(fd)))
> +                                     igt_fail(err);

This is a misinterpretation of the existing test. These are not
subtests, but a sanity check that reload() works. A call to
gem_exec_store() can just whither away, it doesn't reveal much about the
general sanity of the driver, but a quick call to an ioctl such as
gem_info() is enough to be sure the driver is there (i.e. the module load
worked as adverticed) and not hung upon load.

One more thing about gem_info(), to be used in process it needs to be
something like:

/* Check the driver load completed by seeing if it responds to an ioctl
 * correctly. We pick an ioctl that calls i915_mutex_interruptible()
 * first (before failing on the invalid arg) so that we can inspect its
 * driver error detection (-EIO if already wedged, or -EINTR if stuck).
 */
void i915_gem_sanitycheck(void)
{
        struct set_cacheing arg = {};
        int fd, err;

        fd = __drm_driver_open(DRIVER_INTEL);
        igt_set_timeout(1, "module reload failed");

        err = 0;
        if (ioctl(fd, SET_CACHEING, &arg))
                err = -errno;

        igt_set_timeout(0, NULL);
        close(fd);

        igt_assert_eq(err, -ENOENT);

}
-Chris

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

Reply via email to