From: Marek Szyprowski <m.szyprowski@samsung.com>
To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
Sylwester Nawrocki <s.nawrocki@samsung.com>,
Andrzej Hajda <a.hajda@samsung.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
Inki Dae <inki.dae@samsung.com>,
Seung-Woo Kim <sw0312.kim@samsung.com>
Subject: [PATCH v2 00/15] Exynos MFC v6+ - remove the need for the reserved memory
Date: Mon, 20 Feb 2017 14:38:49 +0100 [thread overview]
Message-ID: <1487597944-2000-1-git-send-email-m.szyprowski@samsung.com> (raw)
In-Reply-To: CGME20170220133910eucas1p10f347d7688dd51ea70d15994c9d5d1f1@eucas1p1.samsung.com
Dear All,
This patchset is a result of my work on enabling full support for MFC device
(multimedia codec) on Exynos 5433 on ARM64 architecture. Initially I thought
that to let it working on ARM64 architecture with IOMMU, I would need to
solve the issue related to the fact that s5p-mfc driver was depending on the
first-fit allocation method in the DMA-mapping / IOMMU glue code (ARM64 use
different algorithm). It turned out, that there is a much simpler way.
During my research I found that some of the requirements for the memory
buffers for MFC v6+ devices were blindly copied from the previous
hardware (v5) version and simply turned out to be excessive. It turned out
that there is no strict requirement for ALL buffers to be allocated on
the higher addresses than the firmware base. This requirement is true only
for the device and per-context buffers. All video data buffers can be
allocated anywhere for all MFC v6+ versions. This heavily simplifies
memory management in the driver.
Such relaxed requirements for the memory buffers can be easily fulfilled
by allocating firmware, device and per-context buffers from the probe-time
preallocated larger buffer. There is no need to create special reserved
memory regions. The only case, when those memory regions are needed is an
oldest Exynos series - Exynos4210 or Exyno4412, which both have MFC v5
hardware, and only when IOMMU is disabled.
This patchset has been tested on Odroid U3 (Exynos4412 with MFC v5), Google
Snow (Exynos5250 with MFC v6), Odroid XU3 (Exynos5422 with MFC v8) and
TM2 (Exynos5433 with MFC v8, ARM64) boards.
To get it working on TM2/Exynos5433 with IOMMU enabled, the 'architectural
clock gating' in SYSMMU has to be disabled. Fixing this will be handled
separately. As a temporary solution, one need to clear CFG_ACGEN bit in
REG_MMU_CFG of the SYSMMU, see __sysmmu_init_config function in
drivers/iommu/exynos-iommu.c.
Patches are based on linux-next from 20th February 2017 with "media:
s5p-mfc: Fix initialization of internal structures" patch applied:
https://patchwork.linuxtv.org/patch/39198/
I've tried to split changes into small pieces to make it easier to review
the code. I've also did a bit of cleanup while touching the driver.
Best regards
Marek Szyprowski
Samsung R&D Institute Poland
Changelog:
v2:
- fixed issues pointed by Javier Martinez Canillas: code compiles now
after applying each patch, added missing cleanup
- added tags
v1: https://www.spinics.net/lists/linux-media/msg111156.html
- initial version
Patch summary:
Marek Szyprowski (15):
media: s5p-mfc: Remove unused structures and dead code
media: s5p-mfc: Use generic of_device_get_match_data helper
media: s5p-mfc: Replace mem_dev_* entries with an array
media: s5p-mfc: Replace bank1/bank2 entries with an array
media: s5p-mfc: Simplify alloc/release private buffer functions
media: s5p-mfc: Move setting DMA max segment size to DMA configure
function
media: s5p-mfc: Put firmware to private buffer structure
media: s5p-mfc: Move firmware allocation to DMA configure function
media: s5p-mfc: Allocate firmware with internal private buffer alloc
function
media: s5p-mfc: Reduce firmware buffer size for MFC v6+ variants
media: s5p-mfc: Split variant DMA memory configuration into separate
functions
media: s5p-mfc: Add support for probe-time preallocated block based
allocator
media: s5p-mfc: Remove special configuration of IOMMU domain
media: s5p-mfc: Use preallocated block allocator always for MFC v6+
ARM: dts: exynos: Remove MFC reserved buffers
.../devicetree/bindings/media/s5p-mfc.txt | 2 +-
arch/arm/boot/dts/exynos5250-arndale.dts | 1 -
arch/arm/boot/dts/exynos5250-smdk5250.dts | 1 -
arch/arm/boot/dts/exynos5250-spring.dts | 1 -
arch/arm/boot/dts/exynos5420-arndale-octa.dts | 1 -
arch/arm/boot/dts/exynos5420-peach-pit.dts | 1 -
arch/arm/boot/dts/exynos5420-smdk5420.dts | 1 -
arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 1 -
arch/arm/boot/dts/exynos5800-peach-pi.dts | 1 -
drivers/media/platform/s5p-mfc/regs-mfc-v6.h | 2 +-
drivers/media/platform/s5p-mfc/regs-mfc-v7.h | 2 +-
drivers/media/platform/s5p-mfc/regs-mfc-v8.h | 2 +-
drivers/media/platform/s5p-mfc/s5p_mfc.c | 214 +++++++++++++--------
drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v5.c | 2 +-
drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 43 ++---
drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c | 71 ++-----
drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.h | 1 -
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 8 +-
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 10 +-
drivers/media/platform/s5p-mfc/s5p_mfc_iommu.h | 51 +----
drivers/media/platform/s5p-mfc/s5p_mfc_opr.c | 65 +++++--
drivers/media/platform/s5p-mfc/s5p_mfc_opr.h | 8 +-
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c | 48 ++---
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 14 +-
24 files changed, 268 insertions(+), 283 deletions(-)
--
1.9.1
next parent reply other threads:[~2017-02-20 13:39 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170220133910eucas1p10f347d7688dd51ea70d15994c9d5d1f1@eucas1p1.samsung.com>
2017-02-20 13:38 ` Marek Szyprowski [this message]
2017-02-20 13:38 ` [PATCH v2 01/15] media: s5p-mfc: Remove unused structures and dead code Marek Szyprowski
2017-02-21 11:11 ` Andrzej Hajda
2017-03-03 9:24 ` [v2,01/15] " Smitha T Murthy
2017-03-03 11:56 ` Smitha T Murthy
2017-02-20 13:38 ` [PATCH v2 02/15] media: s5p-mfc: Use generic of_device_get_match_data helper Marek Szyprowski
2017-03-03 13:51 ` [v2, " Smitha T Murthy
2017-02-20 13:38 ` [PATCH v2 03/15] media: s5p-mfc: Replace mem_dev_* entries with an array Marek Szyprowski
2017-02-22 16:22 ` Shuah Khan
2017-03-17 11:29 ` Sylwester Nawrocki
2017-02-20 13:38 ` [PATCH v2 04/15] media: s5p-mfc: Replace bank1/bank2 " Marek Szyprowski
2017-02-20 13:38 ` [PATCH v2 05/15] media: s5p-mfc: Simplify alloc/release private buffer functions Marek Szyprowski
2017-02-20 13:38 ` [PATCH v2 06/15] media: s5p-mfc: Move setting DMA max segment size to DMA configure function Marek Szyprowski
2017-02-20 13:38 ` [PATCH v2 07/15] media: s5p-mfc: Put firmware to private buffer structure Marek Szyprowski
2017-02-20 13:38 ` [PATCH v2 08/15] media: s5p-mfc: Move firmware allocation to DMA configure function Marek Szyprowski
2017-02-20 13:49 ` Javier Martinez Canillas
2017-02-22 18:07 ` Shuah Khan
2017-02-23 7:30 ` Marek Szyprowski
2017-02-20 13:38 ` [PATCH v2 09/15] media: s5p-mfc: Allocate firmware with internal private buffer alloc function Marek Szyprowski
2017-02-20 13:38 ` [PATCH v2 10/15] media: s5p-mfc: Reduce firmware buffer size for MFC v6+ variants Marek Szyprowski
2017-02-20 13:39 ` [PATCH v2 11/15] media: s5p-mfc: Split variant DMA memory configuration into separate functions Marek Szyprowski
2017-02-20 13:39 ` [PATCH v2 12/15] media: s5p-mfc: Add support for probe-time preallocated block based allocator Marek Szyprowski
2017-02-20 13:39 ` [PATCH v2 13/15] media: s5p-mfc: Remove special configuration of IOMMU domain Marek Szyprowski
2017-02-20 13:39 ` [PATCH v2 14/15] media: s5p-mfc: Use preallocated block allocator always for MFC v6+ Marek Szyprowski
2017-02-20 13:39 ` [PATCH v2 15/15] ARM: dts: exynos: Remove MFC reserved buffers Marek Szyprowski
[not found] <CGME20170317120635eucas1p1d13c446f1418de46a49516e95bf9075d@eucas1p1.samsung.com>
2017-03-15 11:36 ` [PATCH v2 00/15] Exynos MFC v6+ - remove the need for the reserved memory Marian Mihailescu
2017-03-15 11:49 ` Javier Martinez Canillas
2017-03-15 12:00 ` Marian Mihailescu
2017-03-15 12:25 ` Javier Martinez Canillas
2017-03-17 12:06 ` Andrzej Hajda
2017-03-22 9:33 ` Marian Mihailescu
2017-03-22 9:40 ` Marek Szyprowski
2017-03-22 10:04 ` Marian Mihailescu
2017-03-22 10:17 ` Marek Szyprowski
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=1487597944-2000-1-git-send-email-m.szyprowski@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=a.hajda@samsung.com \
--cc=inki.dae@samsung.com \
--cc=krzk@kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=s.nawrocki@samsung.com \
--cc=sw0312.kim@samsung.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox