Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Christoph Hellwig <hch@lst.de>, Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: dri-devel@lists.freedesktop.org,
	Karol Herbst <kherbst@redhat.com>,
	nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	Thomas Hellstrom <thomas.hellstrom@intel.com>,
	Ben Skeggs <bskeggs@redhat.com>,
	Matthew Auld <matthew.auld@intel.com>
Subject: Re: [Intel-gfx] susetting the remaining swioltb couplin in DRM
Date: Mon, 18 Jul 2022 12:36:59 +0100	[thread overview]
Message-ID: <46938a7a-0b89-0bd3-d137-851a037b644f@linux.intel.com> (raw)
In-Reply-To: <20220712050055.GA4727@lst.de>


Hi,

On 12/07/2022 06:00, Christoph Hellwig wrote:
> On Mon, Jul 11, 2022 at 04:31:49PM -0400, Rodrigo Vivi wrote:
>> On Mon, Jul 11, 2022 at 10:26:14AM +0200, Christoph Hellwig wrote:
>>> Hi i915 and nouveau maintainers,
>>>
>>> any chance I could get some help to remove the remaining direct
>>> driver calls into swiotlb, namely swiotlb_max_segment and
>>> is_swiotlb_active.  Either should not matter to a driver as they
>>> should be written to the DMA API.
>>
>> Hi Christoph,
>>
>> while we take a look here, could you please share the reasons
>> behind sunsetting this calls?
> 
> Because they are a completely broken layering violation.  A driver has
> absolutely no business knowing the dma-mapping violation.  The DMA
> API reports what we think is all useful constraints (e.g.
> dma_max_mapping_size()), and provides useful APIs to (e.g.
> dma_alloc_noncoherent or dma_alloc_noncontiguous) to allocate pages
> that can be mapped without bounce buffering and drivers should use
> the proper API instead of poking into one particular implementation
> and restrict it from changing.
> 
> swiotlb_max_segment in particular returns a value that isn't actually
> correct (a driver can't just use all of swiotlb) AND actually doesn't
> work as is in various scenarious that are becoming more common,
> most notably host with memory encryption schemes that always require
> bounce buffering.

All these are either in the internal backend or in the old shmem 
backend. I understand both are soon to be retired or deprecated. I think.

+ Matt & Thomas, and Bob actually as well, as I think authorities in the 
shmem, TTM and internal backend at the moment. Could you guys please 
have look if and how the TTM backend needs to handle this and what is 
the timeline of retirement if relevant?

Regards,

Tvrtko

  reply	other threads:[~2022-07-18 11:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-11  8:26 [Intel-gfx] susetting the remaining swioltb couplin in DRM Christoph Hellwig
2022-07-11 20:31 ` Rodrigo Vivi
2022-07-12  5:00   ` Christoph Hellwig
2022-07-18 11:36     ` Tvrtko Ursulin [this message]
2022-07-21 14:28       ` Robert Beckett
2022-07-28 21:17 ` Lyude Paul
2022-07-28 21:55   ` Lyude Paul

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=46938a7a-0b89-0bd3-d137-851a037b644f@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hch@lst.de \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=kherbst@redhat.com \
    --cc=matthew.auld@intel.com \
    --cc=nouveau@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=thomas.hellstrom@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