From: Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "Terje Bergström"
<tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
"Stephen Warren"
<swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH 1/2] drm/tegra: Set DMA ops
Date: Wed, 24 Feb 2016 17:30:54 +0900 [thread overview]
Message-ID: <56CD6A3E.4090800@nvidia.com> (raw)
In-Reply-To: <20160223152815.GD27656@ulmo>
On 02/24/2016 12:28 AM, Thierry Reding wrote:
> * PGP Signed by an unknown key
>
> On Tue, Feb 23, 2016 at 03:25:53PM +0900, Alexandre Courbot wrote:
>> The current settings leaves the DRM device's dma_ops field NULL, which
>> makes it use the dummy DMA ops on arm64 and return an error whenever we
>> try to import a buffer. Call of_dma_configure() with a NULL node (since
>> the device is not spawn from the device tree) so that
>> arch_setup_dma_ops() is called and sets the default ioswtlb DMA ops.
>>
>> Signed-off-by: Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>> ---
>> drivers/gpu/drm/tegra/drm.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
>> index d347188bf8f4..bc0555adecaf 100644
>> --- a/drivers/gpu/drm/tegra/drm.c
>> +++ b/drivers/gpu/drm/tegra/drm.c
>> @@ -9,6 +9,7 @@
>>
>> #include <linux/host1x.h>
>> #include <linux/iommu.h>
>> +#include <linux/of_device.h>
>>
>> #include <drm/drm_atomic.h>
>> #include <drm/drm_atomic_helper.h>
>> @@ -990,6 +991,7 @@ static int host1x_drm_probe(struct host1x_device *dev)
>> return -ENOMEM;
>>
>> dev_set_drvdata(&dev->dev, drm);
>> + of_dma_configure(drm->dev, NULL);
>
> Looking at the various pieces, I think this really belongs in
> host1x_device_add() (see drivers/gpu/host1x/bus.c) where it can replace
> the open-coded setting of DMA and coherent DMA masks. Also why can't we
> pass the correct device tree node here? The DRM device is a virtual
> device that hangs off the host1x device, so I think it could use the
> same device tree node as the host1x device.
>
> Something like the below (untested).
You're right, that looks like a much better place to do this.
of_dma_configure() is called at the bus level (platform and PCI), so it
makes sense to do it from host1x too.
WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Courbot <acourbot@nvidia.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: "Terje Bergström" <tbergstrom@nvidia.com>,
"Stephen Warren" <swarren@wwwdotorg.org>,
dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org, gnurou@gmail.com
Subject: Re: [PATCH 1/2] drm/tegra: Set DMA ops
Date: Wed, 24 Feb 2016 17:30:54 +0900 [thread overview]
Message-ID: <56CD6A3E.4090800@nvidia.com> (raw)
In-Reply-To: <20160223152815.GD27656@ulmo>
On 02/24/2016 12:28 AM, Thierry Reding wrote:
> * PGP Signed by an unknown key
>
> On Tue, Feb 23, 2016 at 03:25:53PM +0900, Alexandre Courbot wrote:
>> The current settings leaves the DRM device's dma_ops field NULL, which
>> makes it use the dummy DMA ops on arm64 and return an error whenever we
>> try to import a buffer. Call of_dma_configure() with a NULL node (since
>> the device is not spawn from the device tree) so that
>> arch_setup_dma_ops() is called and sets the default ioswtlb DMA ops.
>>
>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
>> ---
>> drivers/gpu/drm/tegra/drm.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
>> index d347188bf8f4..bc0555adecaf 100644
>> --- a/drivers/gpu/drm/tegra/drm.c
>> +++ b/drivers/gpu/drm/tegra/drm.c
>> @@ -9,6 +9,7 @@
>>
>> #include <linux/host1x.h>
>> #include <linux/iommu.h>
>> +#include <linux/of_device.h>
>>
>> #include <drm/drm_atomic.h>
>> #include <drm/drm_atomic_helper.h>
>> @@ -990,6 +991,7 @@ static int host1x_drm_probe(struct host1x_device *dev)
>> return -ENOMEM;
>>
>> dev_set_drvdata(&dev->dev, drm);
>> + of_dma_configure(drm->dev, NULL);
>
> Looking at the various pieces, I think this really belongs in
> host1x_device_add() (see drivers/gpu/host1x/bus.c) where it can replace
> the open-coded setting of DMA and coherent DMA masks. Also why can't we
> pass the correct device tree node here? The DRM device is a virtual
> device that hangs off the host1x device, so I think it could use the
> same device tree node as the host1x device.
>
> Something like the below (untested).
You're right, that looks like a much better place to do this.
of_dma_configure() is called at the bus level (platform and PCI), so it
makes sense to do it from host1x too.
next prev parent reply other threads:[~2016-02-24 8:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-23 6:25 [PATCH 1/2] drm/tegra: Set DMA ops Alexandre Courbot
[not found] ` <1456208754-12362-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-02-23 6:25 ` [PATCH 2/2] drm/tegra: Set the DMA mask Alexandre Courbot
2016-02-23 6:25 ` Alexandre Courbot
2016-02-23 16:04 ` Thierry Reding
2016-02-23 16:04 ` Thierry Reding
2016-02-23 16:18 ` Terje Bergstrom
2016-02-23 16:18 ` Terje Bergstrom
2016-02-23 16:27 ` Thierry Reding
2016-02-23 16:27 ` Thierry Reding
2016-02-24 8:38 ` Alexandre Courbot
2016-02-24 8:38 ` Alexandre Courbot
2016-02-23 15:28 ` [PATCH 1/2] drm/tegra: Set DMA ops Thierry Reding
2016-02-23 15:28 ` Thierry Reding
2016-02-24 8:30 ` Alexandre Courbot [this message]
2016-02-24 8:30 ` Alexandre Courbot
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=56CD6A3E.4090800@nvidia.com \
--to=acourbot-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
--cc=tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@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.