From: CK Hu <ck.hu@mediatek•com>
To: Rob Herring <robh@kernel•org>
Cc: "Heiko Stübner" <heiko@sntech•de>,
"Neil Armstrong" <narmstrong@baylibre•com>,
"David Airlie" <airlied@linux•ie>,
"Liviu Dudau" <liviu.dudau@arm•com>,
"Daniel Kurtz" <djkurtz@chromium•org>,
"Sandy Huang" <hjc@rock-chips•com>,
"Laurent Pinchart" <laurent.pinchart@ideasonboard•com>,
"Benjamin Gaignard" <benjamin.gaignard@linaro•org>,
"Yannick Fertre" <yannick.fertre@st•com>,
"Nicolas Boichat" <drinkcat@chromium•org>,
"Kevin Hilman" <khilman@baylibre•com>,
"Xinwei Kong" <kong.kongxinwei@hisilicon•com>,
"Xinliang Liu" <z.liuxinliang@hisilicon•com>,
"open list:ARM/Rockchip SoC..."
<linux-rockchip@lists•infradead.org>,
"Chen-Yu Tsai" <wens@csie•org>,
"Noralf Trønnes" <noralf@tronnes•org>,
"James (Qian) Wang" <james.qian.wang@arm•com>,
"Philipp Zabel" <p.zabel@pengutronix•de>,
"Ulrich Hecht" <uli@fpond•eu>,
"Alexandre Torgue" <alexandre.torgue@st•com>,
"Chen Feng" <puck.chen@hisilicon•com>,
"Maarten Lankhorst" <maarten.lankhorst@linux•intel.com>,
"Maxime Ripard" <mripard@kernel•org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@lists•infradead.org>,
dri-devel <dri-devel@lists•freedesktop.org>,
"Matthias Brugger" <matthias.bgg@gmail•com>,
"Daniel Vetter" <daniel@ffwll•ch>, "Sean Paul" <sean@poorly•run>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@lists•infradead.org>,
"Philippe Cornu" <philippe.cornu@st•com>,
"Vincent Abriou" <vincent.abriou@st•com>,
"Kieran Bingham" <kieran.bingham+renesas@ideasonboard•com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail•com>,
"Rongrong Zou" <zourongrong@gmail•com>
Subject: Re: [PATCH 5/6] drm/mediatek: Convert to use CMA helpers
Date: Thu, 24 Oct 2019 15:02:57 +0800 [thread overview]
Message-ID: <1571900577.27203.6.camel@mtksdaap41> (raw)
In-Reply-To: <CAL_JsqJJ2ET2oCCkE=fqk7PWTWp3xiMRiMM_AmxRDws-NaKoOg@mail.gmail.com>
Hi, Rob:
On Wed, 2019-10-23 at 17:56 -0500, Rob Herring wrote:
> On Wed, Oct 23, 2019 at 4:06 PM CK Hu <ck.hu@mediatek•com> wrote:
> >
> > Hi, Rob:
> >
> > On Wed, 2019-10-23 at 12:42 -0500, Rob Herring wrote:
> > > On Tue, Oct 22, 2019 at 12:07 PM Matthias Brugger
> > > <matthias.bgg@gmail•com> wrote:
> > > >
> > > > Hi Rob,
> > > >
> > > > On 21/10/2019 23:45, Rob Herring wrote:
> > > > > The only reason the Mediatek driver doesn't use the CMA helpers is it
> > > > > sets DMA_ATTR_NO_KERNEL_MAPPING and does a vmap() on demand. Using
> > > > > vmap() is not even guaranteed to work as DMA buffers may not have a
> > > > > struct page. Now that the CMA helpers support setting
> > > > > DMA_ATTR_NO_KERNEL_MAPPING as needed or not, convert Mediatek driver to
> > > > > use CMA helpers.
> > > > >
> > > > > Cc: CK Hu <ck.hu@mediatek•com>
> > > > > Cc: Philipp Zabel <p.zabel@pengutronix•de>
> > > > > Cc: David Airlie <airlied@linux•ie>
> > > > > Cc: Daniel Vetter <daniel@ffwll•ch>
> > > > > Cc: Matthias Brugger <matthias.bgg@gmail•com>
> > > > > Cc: linux-arm-kernel@lists•infradead.org
> > > > > Cc: linux-mediatek@lists•infradead.org
> > > > > Signed-off-by: Rob Herring <robh@kernel•org>
> > > > > ---
> > > >
> > > > I tested this on my Chromebook with some patches on top of v5.4-rc1 [1], which
> > > > work. If I add your patches on top of that, the system does not boot up.
> > > > Unfortunately I don't have a serial console, so I wasn't able to see if there is
> > > > any error message.
> > >
> > > Thanks for testing. I'm based on drm-misc-next, but don't see anything
> > > obvious there that would matter. There are some mmap changes, but I
> > > think they shouldn't matter.
> > >
> > > Did you have fbcon enabled? That may give more clues about where the problem is.
> >
> > There are priv->dma_dev for dma device, but it is not drm device. In
> > mt8173.dtsi [1], there are mmsys device and ovl device, mmsys device is
> > drm device and ovl device is mmsys's sub device which provide dma
> > function, so ovl is the priv->dma_dev. I think your patch directly use
> > drm device for dma operation and this would cause dma function fail.
> > Please use priv->dma_dev for dma operation.
>
> Right, thanks for catching that. Either we'll need to make CMA GEM
> object have a struct device ptr or adjust the drm_device.dev to have
> the necessary DMA setup.
>
> One question though, why do you use CMA when you have an IOMMU? That's
> not optimal as CMA size may be limited. Or you don't always have an
> IOMMU?
For all upstreamed mediatek SoC, all has IOMMU, so it does not need CMA.
I think we use CMA just because we refer to other drm driver to
implement mediatek drm driver and we misused CMA helper function but it
works. I think we should change to more accurate implementation. If you
want, you could modify it in this series.
Regards,
CK
>
> Rob
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-10-24 7:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-21 21:45 [PATCH 0/6] drm: Support CMA per allocation kernel mappings Rob Herring
2019-10-21 21:45 ` [PATCH 1/6] drm/kirin: Use DRM_GEM_CMA_VMAP_DRIVER_OPS Rob Herring
2019-10-21 21:45 ` [PATCH 2/6] drm: Introduce DRM_MODE_DUMB_KERNEL_MAP flag Rob Herring
2019-10-22 11:14 ` Laurent Pinchart
2019-10-22 12:42 ` Rob Herring
2019-10-23 14:28 ` Laurent Pinchart
2019-10-23 17:03 ` Rob Herring
2019-10-21 21:45 ` [PATCH 3/6] drm/cma-helper: Use the dma_*_attr API variant Rob Herring
2019-10-22 1:01 ` kbuild test robot
2019-10-22 11:18 ` Laurent Pinchart
2019-10-21 21:45 ` [PATCH 4/6] drm/cma-helper: Support DRM_MODE_DUMB_KERNEL_MAP flag Rob Herring
2019-10-22 6:13 ` james qian wang (Arm Technology China)
2019-10-22 7:50 ` Neil Armstrong
2019-10-22 11:30 ` Laurent Pinchart
2019-10-22 11:40 ` Geert Uytterhoeven
2019-10-22 19:52 ` Rob Herring
2019-10-22 20:02 ` Rob Herring
2019-10-23 14:27 ` Laurent Pinchart
2019-10-21 21:45 ` [PATCH 5/6] drm/mediatek: Convert to use CMA helpers Rob Herring
2019-10-22 17:07 ` Matthias Brugger
2019-10-23 17:42 ` Rob Herring
2019-10-23 21:06 ` CK Hu
2019-10-23 22:56 ` Rob Herring
2019-10-24 7:02 ` CK Hu [this message]
2019-12-17 1:12 ` Laurent Pinchart
2019-10-21 21:45 ` [PATCH 6/6] drm/rockchip: Convert to use generic fbdev emulation Rob Herring
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=1571900577.27203.6.camel@mtksdaap41 \
--to=ck.hu@mediatek$(echo .)com \
--cc=airlied@linux$(echo .)ie \
--cc=alexandre.torgue@st$(echo .)com \
--cc=benjamin.gaignard@linaro$(echo .)org \
--cc=daniel@ffwll$(echo .)ch \
--cc=djkurtz@chromium$(echo .)org \
--cc=dri-devel@lists$(echo .)freedesktop.org \
--cc=drinkcat@chromium$(echo .)org \
--cc=heiko@sntech$(echo .)de \
--cc=hjc@rock-chips$(echo .)com \
--cc=james.qian.wang@arm$(echo .)com \
--cc=khilman@baylibre$(echo .)com \
--cc=kieran.bingham+renesas@ideasonboard$(echo .)com \
--cc=kong.kongxinwei@hisilicon$(echo .)com \
--cc=laurent.pinchart@ideasonboard$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-mediatek@lists$(echo .)infradead.org \
--cc=linux-rockchip@lists$(echo .)infradead.org \
--cc=liviu.dudau@arm$(echo .)com \
--cc=maarten.lankhorst@linux$(echo .)intel.com \
--cc=matthias.bgg@gmail$(echo .)com \
--cc=mcoquelin.stm32@gmail$(echo .)com \
--cc=mripard@kernel$(echo .)org \
--cc=narmstrong@baylibre$(echo .)com \
--cc=noralf@tronnes$(echo .)org \
--cc=p.zabel@pengutronix$(echo .)de \
--cc=philippe.cornu@st$(echo .)com \
--cc=puck.chen@hisilicon$(echo .)com \
--cc=robh@kernel$(echo .)org \
--cc=sean@poorly$(echo .)run \
--cc=uli@fpond$(echo .)eu \
--cc=vincent.abriou@st$(echo .)com \
--cc=wens@csie$(echo .)org \
--cc=yannick.fertre@st$(echo .)com \
--cc=z.liuxinliang@hisilicon$(echo .)com \
--cc=zourongrong@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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