All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	ankitprasad.r.sharma@intel.com, intel-gfx@lists.freedesktop.org,
	akash.goel@intel.com, shashidhar.hiremath@intel.com
Subject: Re: [PATCH 1/3] igt/gem_stolen: Verifying extended gem_create ioctl
Date: Fri, 03 Jul 2015 10:38:49 +0100	[thread overview]
Message-ID: <55965829.6030203@linux.intel.com> (raw)
In-Reply-To: <20150703091623.GD14231@nuc-i3427.alporthouse.com>


On 07/03/2015 10:16 AM, Chris Wilson wrote:
> On Fri, Jul 03, 2015 at 10:05:05AM +0100, Tvrtko Ursulin wrote:
>>> +bool gem_create__has_stolen_support(int fd)
>>> +{
>>> +	static int has_stolen_support = -1;
>>> +
>>> +	if (has_stolen_support < 0) {
>>> +	struct drm_i915_getparam gp;
>>> +	int val = -1;
>
>>> +		memset(&gp, 0, sizeof(gp));
>>> +		gp.param = 36; /* CREATE_VERSION */
>>> +		gp.value = &val;
>>> +
>>> +		/* Do we have the extended gem_create_ioctl? */
>>> +		ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
>>> +		has_stolen_support = val >= 1;
>>
>> If ioctl fails it will declare stolen support. (val remains -1)
>>
>> I would also suggest "has_stolen_support = val > 1" as clearer.
>
> Tvrtko, -ENOCOFFEE? :)

Ooops don't know why I saw an arithmetic shift there.

Regards,

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

  reply	other threads:[~2015-07-03  9:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01  9:26 [PATCH v2 0/3] Tests for verifying the old and extended GEM_CREATE ioctl ankitprasad.r.sharma
2015-07-01  9:26 ` [PATCH 1/3] igt/gem_stolen: Verifying extended gem_create ioctl ankitprasad.r.sharma
2015-07-03  9:05   ` Tvrtko Ursulin
2015-07-03  9:16     ` Chris Wilson
2015-07-03  9:38       ` Tvrtko Ursulin [this message]
2015-07-01  9:26 ` [PATCH 2/3] igt/gem_pread: Support to verify pread/pwrite for non-shmem backed obj ankitprasad.r.sharma
2015-07-03  9:37   ` Tvrtko Ursulin
2015-07-06 14:33     ` Dave Gordon
2015-07-21 12:38     ` Ankitprasad Sharma
2015-07-01  9:26 ` [PATCH 3/3] igt/gem_create: Test to validate parameters for GEM_CREATE ioctl ankitprasad.r.sharma
2015-07-03  9:52   ` Tvrtko Ursulin
2015-07-21 13:09     ` Ankitprasad Sharma
  -- strict thread matches above, loose matches on Subject: below --
2015-09-15  8:36 [PATCH v4 0/3] Tests for verifying the old and extended " ankitprasad.r.sharma
2015-09-15  8:36 ` [PATCH 1/3] igt/gem_stolen: Verifying extended gem_create ioctl ankitprasad.r.sharma
2015-09-15 15:27   ` Tvrtko Ursulin
2015-07-22 13:45 [PATCH v3 0/3] Tests for verifying the old and extended GEM_CREATE ioctl ankitprasad.r.sharma
2015-07-22 13:45 ` [PATCH 1/3] igt/gem_stolen: Verifying extended gem_create ioctl ankitprasad.r.sharma
2015-07-22 16:00   ` Tvrtko Ursulin
2015-05-13 11:53 [PATCH 0/3] Tests for verifying the old and extended GEM_CREATE ioctl ankitprasad.r.sharma
2015-05-13 11:53 ` [PATCH 1/3] igt/gem_stolen: Verifying extended gem_create ioctl ankitprasad.r.sharma

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=55965829.6030203@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=akash.goel@intel.com \
    --cc=ankitprasad.r.sharma@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=shashidhar.hiremath@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.