public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Antonio Argenziano <antonio.argenziano@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, igt-dev@lists.freedesktop.org
Cc: Janulgue Abdiel <abdiel.janulgue@intel.com>,
	Matthew Auld <matthew.auld@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t v3] lib/i915: Add mmap_offset support
Date: Tue, 26 Feb 2019 10:44:17 -0800	[thread overview]
Message-ID: <f2c631c6-b393-bfea-c95f-14f99c18a6fe@intel.com> (raw)
In-Reply-To: <155120579777.17933.14831240638485565131@skylake-alporthouse-com>



On 26/02/19 10:29, Chris Wilson wrote:
> Quoting Antonio Argenziano (2019-02-26 18:23:53)
>> +bool has_mmap_offset(int fd)
> 
> Prefix please.
> 
>> +{
>> +       static int has_mmap_offset = -1;
> 
> What's our plan to avoiding the static?

How about: make the variable not static and remove the if?

> 
> I don't think we need the statics for these, as their use should be
> limited to fixtures. Once plan has been decided upon, enact it for all
> in gem_mman.c :)

OK, there isn't really much in gem_mman, I'll add a patch before this 
one to remove what is there and not add this here.

Antonio

> 
>> +
>> +       if (has_mmap_offset == -1) {
>> +               struct drm_i915_getparam gp;
>> +
>> +               has_mmap_offset = 0;
>> +
>> +               memset(&gp, 0, sizeof(gp));
>> +               gp.param = 0x55; /* I915_PARAM_MMAP_OFFSET_VERSION */
>> +               gp.value = &has_mmap_offset;
>> +               ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
>> +       }
>> +
>> +       return has_mmap_offset > 0;
>> +}
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-02-26 18:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-26 18:23 [igt-dev] [PATCH i-g-t v3] lib/i915: Add mmap_offset support Antonio Argenziano
2019-02-26 18:29 ` Chris Wilson
2019-02-26 18:44   ` Antonio Argenziano [this message]
2019-02-26 18:47     ` Chris Wilson
2019-02-26 19:29       ` Antonio Argenziano
2019-02-26 19:36         ` Chris Wilson
2019-02-26 19:59 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork

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=f2c631c6-b393-bfea-c95f-14f99c18a6fe@intel.com \
    --to=antonio.argenziano@intel.com \
    --cc=abdiel.janulgue@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=matthew.auld@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox