[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGb2v65ecm+9iK7GY6xKUHNhjdDimcL8Kd6eg-yX_nOm5rMZjA@mail.gmail.com>
Date: Wed, 15 Jul 2020 10:22:13 +0800
From: Chen-Yu Tsai <wens@...nel.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
stable <stable@...r.kernel.org>,
Paul Kocialkowski <paul.kocialkowski@...tlin.com>,
Maxime Ripard <maxime@...no.tech>,
Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 5.4 026/109] drm/sun4i: mixer: Call of_dma_configure if
theres an IOMMU
Hi Greg,
On Wed, Jul 15, 2020 at 3:11 AM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
>
> From: Maxime Ripard <maxime@...no.tech>
>
> [ Upstream commit 842ec61f4006a6477a9deaedd69131e9f46e4cb5 ]
>
> The main DRM device is actually a virtual device so it doesn't have the
> iommus property, which is instead on the DMA masters, in this case the
> mixers.
The iommu driver and DT changes were added in v5.8-rc1. IMO There is no
point in backporting this patch to any stable kernel.
ChenYu
> Add a call to of_dma_configure with the mixers DT node but on the DRM
> virtual device to configure it in the same way than the mixers.
>
> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@...tlin.com>
> Signed-off-by: Maxime Ripard <maxime@...no.tech>
> Link: https://patchwork.freedesktop.org/patch/msgid/9a4daf438dd3f2fe07afb23688bfb793a0613d7d.1589378833.git-series.maxime@cerno.tech
> (cherry picked from commit b718102dbdfd0285ad559687a30e27cc9124e592)
> [Maxime: Applied to -fixes since it missed the merge window and display is
> broken without it]
> Signed-off-by: Maxime Ripard <maxime@...no.tech>
> Signed-off-by: Sasha Levin <sashal@...nel.org>
> ---
> drivers/gpu/drm/sun4i/sun8i_mixer.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c
> index 18b4881f44814..e24f225d80f1f 100644
> --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c
> +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c
> @@ -452,6 +452,19 @@ static int sun8i_mixer_bind(struct device *dev, struct device *master,
> mixer->engine.ops = &sun8i_engine_ops;
> mixer->engine.node = dev->of_node;
>
> + if (of_find_property(dev->of_node, "iommus", NULL)) {
> + /*
> + * This assume we have the same DMA constraints for
> + * all our the mixers in our pipeline. This sounds
> + * bad, but it has always been the case for us, and
> + * DRM doesn't do per-device allocation either, so we
> + * would need to fix DRM first...
> + */
> + ret = of_dma_configure(drm->dev, dev->of_node, true);
> + if (ret)
> + return ret;
> + }
> +
> /*
> * While this function can fail, we shouldn't do anything
> * if this happens. Some early DE2 DT entries don't provide
> --
> 2.25.1
>
>
>
Powered by blists - more mailing lists