All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
To: Tomasz Figa <tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Rob Clark <robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>,
	Vivek Gautam
	<vivek.gautam-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
	dri-devel
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	freedreno
	<freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	Archit Taneja <architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	linux-arm-msm
	<linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Subject: Re: [PATCH v3 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg*
Date: Thu, 29 Nov 2018 20:03:51 +0000	[thread overview]
Message-ID: <06747338-b0fb-eef6-634a-0641e81ed3c1@arm.com> (raw)
In-Reply-To: <CAAFQd5D139pNx9aEpO8745R4kfVYCBDyqyJNR_HDDXvKt7NZjw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 29/11/2018 19:57, Tomasz Figa wrote:
> On Thu, Nov 29, 2018 at 11:40 AM Jordan Crouse <jcrouse@codeaurora.org> wrote:
>>
>> On Thu, Nov 29, 2018 at 01:48:15PM -0500, Rob Clark wrote:
>>> On Thu, Nov 29, 2018 at 10:54 AM Christoph Hellwig <hch@lst.de> wrote:
>>>>
>>>> On Thu, Nov 29, 2018 at 09:42:50AM -0500, Rob Clark wrote:
>>>>> Maybe the thing we need to do is just implement a blacklist of
>>>>> compatible strings for devices which should skip the automatic
>>>>> iommu/dma hookup.  Maybe a bit ugly, but it would also solve a problem
>>>>> preventing us from enabling per-process pagetables for a5xx (where we
>>>>> need to control the domain/context-bank that is allocated by the dma
>>>>> api).
>>>>
>>>> You can detach from the dma map attachment using arm_iommu_detach_device,
>>>> which a few drm drivers do, but I don't think this is the problem.
>>>
>>> I think even with detach, we wouldn't end up with the context-bank
>>> that the gpu firmware was hard-coded to expect, and so it would
>>> overwrite the incorrect page table address register.  (I could be
>>> mis-remembering that, Jordan spent more time looking at that.  But it
>>> was something along those lines.)
>>
>> Right - basically the DMA domain steals context bank 0 and the GPU is hard coded
>> to use that context bank for pagetable switching.
>>
>> I believe the Tegra guys also had a similar problem with a hard coded context
>> bank.

AIUI, they don't need a specific hardware context, they just need to 
know which one they're actually using, which the domain abstraction hides.

> Wait, if we detach the GPU/display struct device from the default
> domain and attach it to a newly allocated domain, wouldn't the newly
> allocated domain use the context bank we need? Note that we're already

The arm-smmu driver doesn't, but there's no fundamental reason it 
couldn't. That should just need code to refcount domain users and 
release hardware contexts for domains with no devices currently attached.

Robin.

> doing that, except that we're doing it behind the back of the DMA
> mapping subsystem, so that it keeps using the IOMMU version of the DMA
> ops for the device and doing any mapping operations on the default
> domain. If we ask the DMA mapping to detach, wouldn't it essentially
> solve the problem?
> 
> Best regards,
> Tomasz
> 
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

  parent reply	other threads:[~2018-11-29 20:03 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29 14:03 [PATCH v3 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg* Vivek Gautam
2018-11-29 14:14 ` Christoph Hellwig
2018-11-29 14:25   ` Rob Clark
     [not found]     ` <CAF6AEGvsFbXGkC+=4oq1xXnoC2EVX2J0k-GqShefcek1=uw4Lw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-11-29 14:42       ` Rob Clark
2018-11-29 15:54         ` Christoph Hellwig
     [not found]           ` <20181129155418.GB26537-jcswGhMUV9g@public.gmane.org>
2018-11-29 18:48             ` Rob Clark
     [not found]               ` <CAF6AEGufdp5jRtUZ_+VRQg3ZXH36hNHvbWZQeJDArp8N5SZ3Lg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-11-29 19:40                 ` Jordan Crouse
2018-11-29 19:57                   ` Tomasz Figa
     [not found]                     ` <CAAFQd5D139pNx9aEpO8745R4kfVYCBDyqyJNR_HDDXvKt7NZjw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-11-29 20:03                       ` Robin Murphy [this message]
2018-11-30  0:23                         ` Tomasz Figa
2018-12-01  2:05                           ` Tomasz Figa
     [not found]                             ` <CAAFQd5DMgGDPcK=4DktfC7T9O0MrU1VBqJqR+6VYpOh_DdEXUg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-12-01 11:46                               ` Rob Clark
     [not found]                                 ` <CAF6AEGujyP78PjOMwTmdHcJKpsrgmRGage=pFniad98peMBrDw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-12-03  0:12                                   ` Tomasz Figa
2018-11-29 14:43       ` Daniel Vetter
2018-11-29 15:57         ` Christoph Hellwig
     [not found]           ` <20181129155758.GC26537-jcswGhMUV9g@public.gmane.org>
2018-11-29 16:28             ` Daniel Vetter
     [not found]               ` <20181129162807.GL21184-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-11-29 16:57                 ` Christoph Hellwig
2018-11-29 17:09                   ` Daniel Vetter
2018-11-29 17:24                     ` Tomasz Figa
2018-11-29 18:35                       ` Christoph Hellwig
     [not found]                       ` <CAAFQd5A-Bh711VaNWhRJqcrofkBVCMFcNgqfztoyWJcUdhSu0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-11-29 18:57                         ` Rob Clark
2018-11-30  9:40                           ` Daniel Vetter
2018-11-30  9:35                       ` Daniel Vetter
2018-11-30  9:44                         ` Christoph Hellwig
2018-11-29 18:33                     ` Christoph Hellwig
     [not found]                       ` <20181129183334.GB30281-jcswGhMUV9g@public.gmane.org>
2018-11-30  9:46                         ` Daniel Vetter
2018-12-07  1:38                           ` Christoph Hellwig
     [not found]                             ` <20181207013841.GA4530-jcswGhMUV9g@public.gmane.org>
2018-12-07 14:29                               ` Rob Clark
2018-11-29 17:33                   ` Brian Starkey
     [not found]                     ` <20181129173301.rye77slpy27regi5-cyTpl0DnfLAx1Goa8x4jbQH0AcctZ4a01BehtkLrGTY@public.gmane.org>
2018-11-29 18:35                       ` Christoph Hellwig
2018-11-30  1:15             ` Rob Clark
2018-11-30  9:35               ` Christoph Hellwig
2018-11-29 15:53     ` Christoph Hellwig
     [not found]       ` <20181129155310.GA26537-jcswGhMUV9g@public.gmane.org>
2018-11-29 18:44         ` Rob Clark

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=06747338-b0fb-eef6-634a-0641e81ed3c1@arm.com \
    --to=robin.murphy-5wv7dgnigg8@public.gmane.org \
    --cc=airlied-cv59FeDIM0c@public.gmane.org \
    --cc=architt-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=hch-jcswGhMUV9g@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=vivek.gautam-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.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 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.