From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C53FC433F5 for ; Sun, 9 Sep 2018 19:14:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0AC8720866 for ; Sun, 9 Sep 2018 19:14:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0AC8720866 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=paulk.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726884AbeIJAEk (ORCPT ); Sun, 9 Sep 2018 20:04:40 -0400 Received: from leonov.paulk.fr ([185.233.101.22]:44858 "EHLO leonov.paulk.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbeIJAEk (ORCPT ); Sun, 9 Sep 2018 20:04:40 -0400 Received: from gagarine.paulk.fr (gagarine [192.168.1.127]) by leonov.paulk.fr (Postfix) with ESMTPS id 18000C027D; Sun, 9 Sep 2018 21:14:00 +0200 (CEST) Received: by gagarine.paulk.fr (Postfix, from userid 114) id 27978C0FF6; Sun, 9 Sep 2018 21:13:58 +0200 (CEST) Received: from collins (unknown [192.168.1.1]) by gagarine.paulk.fr (Postfix) with ESMTPSA id 506EFC0FE6; Sun, 9 Sep 2018 21:13:43 +0200 (CEST) Message-ID: Subject: Re: [PATCH 0/2] Follow-up patches for Cedrus v9 From: Paul Kocialkowski To: Hans Verkuil , Chen-Yu Tsai Cc: linux-kernel , Linux Media Mailing List , devel@driverdev.osuosl.org, linux-arm-kernel , Maxime Ripard , Mauro Carvalho Chehab , Greg Kroah-Hartman , linux-sunxi , Randy Li , ezequiel@collabora.com, Tomasz Figa , Alexandre Courbot , Philipp Zabel , Laurent Pinchart , Sakari Ailus , Thomas Petazzoni Date: Sun, 09 Sep 2018 21:13:40 +0200 In-Reply-To: <7386a631-1753-22cb-955e-fd0f1ca7a2d1@xs4all.nl> References: <20180907163347.32312-1-contact@paulk.fr> <11104c03-97ac-8b36-7d75-dfecb8fcce10@xs4all.nl> <3c4e5a98-4dbd-9a8c-8dab-612a923f0eb9@xs4all.nl> <7386a631-1753-22cb-955e-fd0f1ca7a2d1@xs4all.nl> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-rM16QRiM22KYzxHBC9Xs" X-Mailer: Evolution 3.28.5 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-rM16QRiM22KYzxHBC9Xs Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Le dimanche 09 septembre 2018 =C3=A0 11:04 +0200, Hans Verkuil a =C3=A9crit= : > On 09/08/2018 09:42 PM, Paul Kocialkowski wrote: > > Hi, > >=20 > > Le samedi 08 septembre 2018 =C3=A0 13:24 +0200, Hans Verkuil a =C3=A9cr= it : > > > On 09/08/2018 12:22 PM, Chen-Yu Tsai wrote: > > > > On Sat, Sep 8, 2018 at 6:06 PM Hans Verkuil wr= ote: > > > > >=20 > > > > > 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 usi= ng the > > > > > > Request API. > > > > > >=20 > > > > > > Paul Kocialkowski (2): > > > > > > media: cedrus: Fix error reporting in request validation > > > > > > media: cedrus: Add TODO file with tasks to complete before un= staging > > > > > >=20 > > > > > > 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 > > > > > >=20 > > > > >=20 > > > > > So close... > > > > >=20 > > > > > When compiling under e.g. intel I get errors since it doesn't kno= w about > > > > > the sunxi_sram_claim/release function and the PHYS_PFN_OFFSET def= ine. > > > > >=20 > > > > > Is it possible to add stub functions to linux/soc/sunxi/sunxi_sra= m.h > > > > > if CONFIG_SUNXI_SRAM is not defined? That would be the best fix f= or that. > > > > >=20 > > > > > The use of PHYS_PFN_OFFSET is weird: are you sure this is the rig= ht > > > > > 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 devic= e tree. > > > > >=20 > > > > > You are the only driver that uses this define directly, which mak= es me > > > > > suspicious. > > > >=20 > > > > 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 th= e DRAM > > > > offset is either 0x40000000 or 0x20000000, depending on the SoC. Si= nce the > > > > former case is not described in the device tree (this is being work= ed on > > > > by Maxime BTW), the dma_pfn_offset is not the value it should be. A= FAIK > > > > only the display and media subsystems (VPU, camera, TS) are wired t= his > > > > way. > > > >=20 > > > > In drivers/gpu/drm/sun4i/sun4i_backend.c (the display driver) we us= e > > > > PHYS_OFFSET, which is pretty much the same thing. > > > >=20 > > >=20 > > > OK, in that case just put #ifdef PHYS_PFN_OFFSET around that line tog= ether > > > with a comment that this will eventually come from the device tree. > >=20 > > 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. >=20 > You should certainly select this kernel config. >=20 > But the real problem seems to to be drivers/soc/Makefile where it says: >=20 > obj-$(CONFIG_ARCH_SUNXI) +=3D sunxi/ >=20 > I think this should be: >=20 > obj-y +=3D sunxi/ >=20 > Now all compiles fine on i686 with the cedrus driver selecting SUNXI_SRAM= . I have just crafted a patch to the attention of Maxime to allow building the sunxi SRAM driver without selecting the sunxi architecture, the way you suggested. With that, I just sent out v2 of the follow-up series for the Cedrus driver, which should cover the build issues encountered so far. Hopefully everything should be in order this time! Cheers, Paul --=20 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/ --=-rM16QRiM22KYzxHBC9Xs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEAbcMXZQMtj1fphLChP3B6o/ulQwFAluVcOQACgkQhP3B6o/u lQykqQ//QYbM/uJYNKugcZ9ryGjZRUbMLeeB+AeVyk++fcu65tchn5PZwGo8l6GP HQiz3cJAjrhrLqcJjufWgKy+CCs5N13TL9mFEYm7YR6D9kfRtiWVq+4p7KNGZjeX vLhMPdg4EbU/9bYliGTPzGfYCjezD8nh3KmHerh2K1Z6k4lExVdy10bNjISRhzmg n0aXFirWlPOlyZW4fQgeijsvVQLBfMRCHzBWUEsfoFP6yb4p/icdAkmWX9+8B08U 8bosyiEmVqSg4YAw+h2/Vv/xO4a3udt+5MRd9TET3r2bYFaiQOsdj2B9c7EfncQj qdBfUiJYn70MfI975BXwQh3t1RyqJCAW8VvqxWpDts7Kw9cO/g5fLT1kgzH/gZnL mEETXLHipghEg/V7t6g1Hka/SSDm6FImujxbne1ALKAtFqtj0sA4zgzWipNLOkY8 pEWA1vlxvpYGUBseWp62kdr/wUlslUGzDH+KqABPP0ZWbsw751mo7IFQ5YzB2AnK LCra2JXVPrz9y9ih8ZyOzGF0iLrNvaj8ed+JFozdT+T/FqqV8S6De7sY/CEDAM/U vPTVNBeiGB3hqTIhPWATubtE0CnsonbYrjN0xTzawjNZButQKyvHBW5xbZrVZBq2 6MsCzFW8MvRuJX/5bYKq2gd1yCEjCyiKO6xN6I6ldxWQ9gqVyW0= =slNS -----END PGP SIGNATURE----- --=-rM16QRiM22KYzxHBC9Xs-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: contact@paulk.fr (Paul Kocialkowski) Date: Sun, 09 Sep 2018 21:13:40 +0200 Subject: [PATCH 0/2] Follow-up patches for Cedrus v9 In-Reply-To: <7386a631-1753-22cb-955e-fd0f1ca7a2d1@xs4all.nl> References: <20180907163347.32312-1-contact@paulk.fr> <11104c03-97ac-8b36-7d75-dfecb8fcce10@xs4all.nl> <3c4e5a98-4dbd-9a8c-8dab-612a923f0eb9@xs4all.nl> <7386a631-1753-22cb-955e-fd0f1ca7a2d1@xs4all.nl> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi, Le dimanche 09 septembre 2018 ? 11:04 +0200, Hans Verkuil a ?crit : > On 09/08/2018 09:42 PM, Paul Kocialkowski wrote: > > 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 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. > > You should certainly select this kernel config. > > But the real problem seems to to be drivers/soc/Makefile where it says: > > obj-$(CONFIG_ARCH_SUNXI) += sunxi/ > > I think this should be: > > obj-y += sunxi/ > > Now all compiles fine on i686 with the cedrus driver selecting SUNXI_SRAM. I have just crafted a patch to the attention of Maxime to allow building the sunxi SRAM driver without selecting the sunxi architecture, the way you suggested. With that, I just sent out v2 of the follow-up series for the Cedrus driver, which should cover the build issues encountered so far. Hopefully everything should be in order this time! 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/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part URL: