[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e17313d436b8b8b778218f0ab309274e2ae2f1c4.camel@paulk.fr>
Date: Sat, 08 Sep 2018 21:42:34 +0200
From: Paul Kocialkowski <contact@...lk.fr>
To: Hans Verkuil <hverkuil@...all.nl>, Chen-Yu Tsai <wens@...e.org>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
Linux Media Mailing List <linux-media@...r.kernel.org>,
devel@...verdev.osuosl.org,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
Maxime Ripard <maxime.ripard@...tlin.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-sunxi <linux-sunxi@...glegroups.com>,
Randy Li <ayaka@...lik.info>, ezequiel@...labora.com,
Tomasz Figa <tfiga@...omium.org>,
Alexandre Courbot <acourbot@...omium.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH 0/2] Follow-up patches for Cedrus v9
Hi,
Le samedi 08 septembre 2018 à 13:24 +0200, Hans Verkuil a écrit :
> On 09/08/2018 12:22 PM, Chen-Yu Tsai wrote:
> > On Sat, Sep 8, 2018 at 6:06 PM Hans Verkuil <hverkuil@...all.nl> wrote:
> > >
> > > On 09/07/2018 06:33 PM, Paul Kocialkowski wrote:
> > > > This brings the requested modifications on top of version 9 of the
> > > > Cedrus VPU driver, that implements stateless video decoding using the
> > > > Request API.
> > > >
> > > > Paul Kocialkowski (2):
> > > > media: cedrus: Fix error reporting in request validation
> > > > media: cedrus: Add TODO file with tasks to complete before unstaging
> > > >
> > > > drivers/staging/media/sunxi/cedrus/TODO | 7 +++++++
> > > > drivers/staging/media/sunxi/cedrus/cedrus.c | 15 ++++++++++++---
> > > > 2 files changed, 19 insertions(+), 3 deletions(-)
> > > > create mode 100644 drivers/staging/media/sunxi/cedrus/TODO
> > > >
> > >
> > > So close...
> > >
> > > When compiling under e.g. intel I get errors since it doesn't know about
> > > the sunxi_sram_claim/release function and the PHYS_PFN_OFFSET define.
> > >
> > > Is it possible to add stub functions to linux/soc/sunxi/sunxi_sram.h
> > > if CONFIG_SUNXI_SRAM is not defined? That would be the best fix for that.
> > >
> > > The use of PHYS_PFN_OFFSET is weird: are you sure this is the right
> > > way? I see that drivers/of/device.c also sets dev->dma_pfn_offset, which
> > > makes me wonder if this information shouldn't come from the device tree.
> > >
> > > You are the only driver that uses this define directly, which makes me
> > > suspicious.
> >
> > On Allwinner platforms, some devices do DMA directly on the memory BUS
> > with the DRAM controller. In such cases, the DRAM has no offset. In all
> > other cases where the DMA goes through the common system bus and the DRAM
> > offset is either 0x40000000 or 0x20000000, depending on the SoC. Since the
> > former case is not described in the device tree (this is being worked on
> > by Maxime BTW), the dma_pfn_offset is not the value it should be. AFAIK
> > only the display and media subsystems (VPU, camera, TS) are wired this
> > way.
> >
> > In drivers/gpu/drm/sun4i/sun4i_backend.c (the display driver) we use
> > PHYS_OFFSET, which is pretty much the same thing.
> >
>
> OK, in that case just put #ifdef PHYS_PFN_OFFSET around that line together
> with a comment that this will eventually come from the device tree.
That seems fine, although I'm less certain about what to do for the
SRAM situation. Other drivers that use SUNXI_SRAM have a Kconfig select
on it (that Cedrus lacks). Provided that the SRAM driver builds fine
for non-sunxi configs, bringing-in that select would remove the need
for dummy functions and also ensure that the actual implementation is
always used on sunxi. Otherwise, there'd be a risk of having the dummy
functions used (if the SRAM driver is not explicitly selected in the
config), causing a hang when accessing the VPU.
What do you think?
Cheers,
Paul
--
Developer of free digital technology and hardware support.
Website: https://www.paulk.fr/
Coding blog: https://code.paulk.fr/
Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists