public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi@etezian.org>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH i-g-t 3/5] i915: Exercise preemption timeout controls in sysfs
Date: Sat, 29 Feb 2020 01:27:04 +0200	[thread overview]
Message-ID: <20200228232704.GD11891@jack.zhora.eu> (raw)
In-Reply-To: <20200228104340.2895082-3-chris@chris-wilson.co.uk>

Hi Chris,

> +static int create_ext_ioctl(int i915,
> +			    struct drm_i915_gem_context_create_ext *arg)
> +{
> +	int err;
> +
> +	err = 0;
> +	if (igt_ioctl(i915, DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT, arg)) {
> +		err = -errno;
> +		igt_assume(err);
> +	}
> +
> +	errno = 0;
> +	return err;
> +}
> +
>  /**
>   * gem_has_contexts:
>   * @fd: open i915 drm file descriptor
> @@ -324,17 +339,14 @@ __gem_context_clone(int i915,
>  		.flags = flags | I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS,
>  		.extensions = to_user_pointer(&clone),
>  	};
> -	int err = 0;
> +	int err;
>  
> -	if (igt_ioctl(i915, DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT, &arg)) {
> -		err = -errno;
> -		igt_assume(err);
> -	}
> +	err = create_ext_ioctl(i915, &arg);
> +	if (err)
> +		return err;
>  
>  	*out = arg.ctx_id;
> -
> -	errno = 0;
> -	return err;
> +	return 0;
>  }
>  
>  static bool __gem_context_has(int i915, uint32_t share, unsigned int flags)
> @@ -382,16 +394,8 @@ bool gem_has_context_clone(int i915)
>  		.flags = I915_CONTEXT_CREATE_FLAGS_USE_EXTENSIONS,
>  		.extensions = to_user_pointer(&ext),
>  	};
> -	int err;
> -
> -	err = 0;
> -	if (igt_ioctl(i915, DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT, &create)) {
> -		err = -errno;
> -		igt_assume(err);
> -	}
> -	errno = 0;
>  
> -	return err == -ENOENT;
> +	return create_ext_ioctl(i915, &create) == -ENOENT;
>  }

I'd like to see the above in a separate patch.

> +void dyn_sysfs_engines(int i915, int engines, const char *file,
> +		       void (*test)(int, int))
> +{
> +	char buf[512];
> +	int len;
> +
> +	lseek(engines, 0, SEEK_SET);
> +	while ((len = syscall(SYS_getdents64, engines, buf, sizeof(buf))) > 0) {
> +		void *ptr = buf;
> +
> +		while (len) {
> +			struct linux_dirent64 {
> +				ino64_t        d_ino;
> +				off64_t        d_off;
> +				unsigned short d_reclen;
> +				unsigned char  d_type;
> +				char           d_name[];
> +			} *de = ptr;

what is the need for having your own linux_dirent64?

All the rest look good.

Andi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-02-28 23:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28 10:43 [igt-dev] [PATCH i-g-t 1/5] i915: Start putting the mmio_base to wider use Chris Wilson
2020-02-28 10:43 ` [Intel-gfx] [PATCH i-g-t 2/5] i915/gem_ctx_isolation: Check engine relative registers Chris Wilson
2020-02-28 19:46   ` [igt-dev] " Stimson, Dale B
2020-02-28 10:43 ` [igt-dev] [PATCH i-g-t 3/5] i915: Exercise preemption timeout controls in sysfs Chris Wilson
2020-02-28 23:27   ` Andi Shyti [this message]
2020-02-28 23:32     ` [igt-dev] [Intel-gfx] " Chris Wilson
2020-02-28 23:51       ` Andi Shyti
2020-02-29 10:21         ` [igt-dev] " Chris Wilson
2020-02-29 12:45           ` Andi Shyti
2020-02-29 18:34             ` [igt-dev] " Chris Wilson
2020-02-29 18:39               ` Chris Wilson
2020-02-28 10:43 ` [Intel-gfx] [PATCH i-g-t 4/5] i915: Exercise sysfs heartbeat controls Chris Wilson
2020-02-28 23:34   ` Andi Shyti
2020-02-28 23:37     ` [igt-dev] " Chris Wilson
2020-02-28 10:43 ` [igt-dev] [PATCH i-g-t 5/5] i915: Exercise timeslice sysfs property Chris Wilson
2020-02-28 11:15 ` [igt-dev] ✗ GitLab.Pipeline: failure for series starting with [i-g-t,1/5] i915: Start putting the mmio_base to wider use Patchwork
2020-02-28 11:52 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2020-02-28 19:45 ` [igt-dev] [PATCH i-g-t 1/5] " Stimson, Dale B
2020-02-28 21:27 ` Andi Shyti
2020-03-01  1:09 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/5] " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2020-03-11  9:34 [igt-dev] [PATCH i-g-t 1/5] lib/i915: Create a context wrapping one specific engine Chris Wilson
2020-03-11  9:34 ` [igt-dev] [PATCH i-g-t 3/5] i915: Exercise preemption timeout controls in sysfs Chris Wilson
2020-03-13 22:26   ` [Intel-gfx] " Andi Shyti

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=20200228232704.GD11891@jack.zhora.eu \
    --to=andi@etezian.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --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