public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: "Chris Wilson" <chris@chris-wilson.co.uk>,
	"Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib/i915/gem_mman: Add support for GEM_MMAP_OFFSET ioctl
Date: Mon, 10 Feb 2020 10:55:47 +0000	[thread overview]
Message-ID: <3083c08e-9713-3c80-6853-97d42a936adc@linux.intel.com> (raw)
In-Reply-To: <158133184057.7442.7413967140789251418@skylake-alporthouse-com>


On 10/02/2020 10:50, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2020-02-10 10:47:23)
>>
>> On 10/02/2020 10:37, Chris Wilson wrote:
>>> Quoting Tvrtko Ursulin (2020-02-10 10:31:40)
>>>>
>>>> On 05/12/2019 12:40, Chris Wilson wrote:
>>>>> Quoting Zbigniew Kempczyński (2019-12-05 12:31:13)
>>>>>> With introduction of new kernel ioctl we need to cover this in
>>>>>> the IGT's. Patch adds mmap functions appropriate for this.
>>>>>>
>>>>>> Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
>>>>>> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
>>>>>> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
>>>>>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>>>>>
>>>>> Do we really have people outside of gem_mmap_wc.c and gem_mmap_offset.c
>>>>> that care whether their WC/WB mmapping is provided by MMAP_OFFSET_IOCTL
>>>>> or MMAP_IOCTL. They just expect it to work, I would have thought --
>>>>> basically just gem_mmap__device_coherent (and maybe the alternative would
>>>>> be gem_mmap__cache_coherent, don't quote me on that :)
>>>>>
>>>>> It's not a huge deal, I think it falls under overengineering that will
>>>>> simply lead to confusion of "when do I use one and not the other?"
>>>>
>>>> What shall we do with call sites which used to do:
>>>>
>>>>      gem_mmap__gtt()
>>>>      get_set_domain(GTT)
>>>>
>>>> And now do:
>>>>
>>>>      gem_mmap__device_coherent()
>>>>      gem_set_domain(GTT)
>>>>
>>>> ?
>>>
>>> For the large part it's immaterial. The subtly is only when mixing GEM
>>> operations on the same buffer within the same critical section.
>>>
>>>> Sounds like we need a helper to either lets the caller know which
>>>> flavour of mmap was used so correct flushing can be done, or a
>>>> synchronous helper where possible sounds much easier:
>>>>
>>>>      gem_mmap__device_coherent_sync() - does the correct set_domain internally
>>>
>>> gem_mmap__device_coherent_domain() to return the domain and sync to roll
>>> up the common actions into one (though I'm not fond of hiding subtle
>>> details in helpers when the tests are meant to be exercising those
>>> subtle details :(
>>
>> So gem_mmap__device_coherent_domain calls the set_domain, not just
>> returns the needed domain?
> 
> I would say returns the domain, with _sync being the helper that mmaps
> + set-domain in one.

Sounds good to me.

Sreedhar could you sketch this and convert gem_ctx_shared as an example?

Regards,

Tvrtko

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-02-10 10:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 12:31 [igt-dev] [PATCH i-g-t] lib/i915/gem_mman: Add support for GEM_MMAP_OFFSET ioctl Zbigniew Kempczyński
2019-12-05 12:40 ` Chris Wilson
2020-02-10 10:31   ` Tvrtko Ursulin
2020-02-10 10:37     ` Chris Wilson
2020-02-10 10:47       ` Tvrtko Ursulin
2020-02-10 10:50         ` Chris Wilson
2020-02-10 10:55           ` Tvrtko Ursulin [this message]
2019-12-05 13:13 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-12-05 16:53 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-12-06 12:37   ` Zbigniew Kempczyński
2019-12-09 10:19 ` [igt-dev] ✓ Fi.CI.IGT: success " 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=3083c08e-9713-3c80-6853-97d42a936adc@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=zbigniew.kempczynski@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