Hello Everyone,
This is another attempt to finally make Exynos SYSMMU driver fully
integrated with DMA-mapping subsystem. The main change from previous
version is a rebase onto latest "automatic DMA configuration for IOMMU
masters" patches from Will Deacon.
This patchset demonstrates that Will's proposal works fine and
significantly simplifies the driver code.
Best regards
Marek Szyprowski
Samsung R&D Institute Poland
Changelog:
v3:
- rebased onto "[RFC PATCH v4 0/8] Introduce automatic DMA
configuration for IOMMU masters"
- added some minor fixes for iommu and dma-mapping frameworks
v2: http://thread.gmane.org/gmane.linux.kernel.iommu/6472/
- rebased onto "[RFC PATCH v3 0/7] Introduce automatic DMA
configuration for IOMMU masters" patches:
http://www.spinics.net/lists/arm-kernel/msg362076.html
- changed initialization from bus notifiers to DT related callbacks
- removed support for separate IO address spaces - this will be
discussed separately after the basic support gets merged
- removed support for power domain notifier-based runtime power
management - this also will be discussed separately later
v1: https://lkml.org/lkml/2014/8/5/183
- initial version, feature complete, completely rewrote integration
approach
Patch summary:
Marek Szyprowski (19):
iommu: fix const qualifier in of_iommu_set_ops
iommu: fix initialization without 'add_device' callback
arm: dma-mapping: add missing check for iommu
drm: exynos: detach from default dma-mapping domain on init
arm: exynos: pm_domains: add support for devices registered before
arch_initcall
ARM: dts: exynos4: add sysmmu nodes
iommu: exynos: don't read version register on every tlb operation
iommu: exynos: remove unused functions
iommu: exynos: remove useless spinlock
iommu: exynos: refactor function parameters to simplify code
iommu: exynos: remove unused functions, part 2
iommu: exynos: remove useless device_add/remove callbacks
iommu: exynos: add support for binding more than one sysmmu to master
device
iommu: exynos: add support for runtime_pm
iommu: exynos: rename variables to reflect their purpose
iommu: exynos: document internal structures
iommu: exynos: remove excessive includes and sort others
alphabetically
iommu: exynos: init from dt-specific callback instead of initcall
iommu: exynos: add callback for initializing devices from device tree
arch/arm/boot/dts/exynos4.dtsi | 117 +++++++
arch/arm/boot/dts/exynos4210.dtsi | 23 ++
arch/arm/boot/dts/exynos4x12.dtsi | 82 +++++
arch/arm/mach-exynos/pm_domains.c | 9 +-
arch/arm/mm/dma-mapping.c | 2 +-
drivers/gpu/drm/exynos/exynos_drm_iommu.c | 3 +
drivers/iommu/exynos-iommu.c | 490 ++++++++++++++----------------
drivers/iommu/iommu.c | 2 +-
include/linux/of_iommu.h | 4 +-
9 files changed, 459 insertions(+), 273 deletions(-)
--
1.9.2
Hello Dave,
This patch enable the last big hardware feature of my driver: the
connector for panel.
Like for HMDI and HDA, Digital Video Out (DVO) create brige, encoder
and connector
drm objects.
The following changes since commit 4e0cd68115620bc3236ff4e58e4c073948629b41:
drm: sti: fix module compilation issue (2014-12-15 17:07:57 +1000)
are available in the git repository at:
http://git.linaro.org/people/benjamin.gaignard/kernel.git drm-sti-next-add-dvo
for you to fetch changes up to f32c4c506f9b197f24d4be4ee7283bd549e3a30f:
drm: sti: add DVO output connector (2014-12-30 15:08:16 +0100)
----------------------------------------------------------------
Benjamin Gaignard (1):
drm: sti: add DVO output connector
.../devicetree/bindings/gpu/st,stih4xx.txt | 29 ++
drivers/gpu/drm/sti/Makefile | 4 +
drivers/gpu/drm/sti/sti_awg_utils.c | 184 +++++++
drivers/gpu/drm/sti/sti_awg_utils.h | 34 ++
drivers/gpu/drm/sti/sti_dvo.c | 551 +++++++++++++++++++++
drivers/gpu/drm/sti/sti_tvout.c | 118 +++++
6 files changed, 920 insertions(+)
create mode 100644 drivers/gpu/drm/sti/sti_awg_utils.c
create mode 100644 drivers/gpu/drm/sti/sti_awg_utils.h
create mode 100644 drivers/gpu/drm/sti/sti_dvo.c
Hi,
Why:
====
While sharing buffers using dma-buf, currently there's no mechanism to let
devices share their memory access constraints with each other to allow for
delayed allocation of backing storage.
This RFC attempts to introduce the idea of memory constraints of a device,
and how these constraints can be shared and used to help allocate buffers that
can satisfy requirements of all devices attached to a particular dma-buf.
How:
====
A constraints_mask is added to dma_parms of the device, and at the time of
each device attachment to a dma-buf, the dma-buf uses this constraints_mask
to calculate the access_mask for the dma-buf.
Allocators can be defined for each of these constraints_masks, and then helper
functions can be used to allocate the backing storage from the matching
allocator satisfying the constraints of all devices interested.
A new miscdevice, /dev/cenalloc [1] is created, which acts as the dma-buf
exporter to make this transparent to the devices.
More details in the patch description of "cenalloc: Constraint-Enabled
Allocation helpers for dma-buf".
At present, the constraint_mask is only a bitmask, but it should be possible to
change it to a struct and adapt the constraint_mask calculation accordingly,
based on discussion.
Important requirement:
======================
Of course, delayed allocation can only work if all participating devices
will wait for other devices to have 'attached' before mapping the buffer
for the first time.
As of now, users of dma-buf(drm prime, v4l2 etc) call the attach() and then
map_attachment() almost immediately after it. This would need to be changed if
they were to benefit from constraints.
What 'cenalloc' is not:
=======================
- not 'general' allocator helpers - useful only for constraints-enabled
devices that share buffers with others using dma-buf.
- not a replacement for existing allocation mechanisms inside various
subsystems; merely a possible alternative.
- no page-migration - it would be very complementary to the delayed allocation
suggested here.
TODOs:
======
- demonstration test cases
- vma helpers for allocators
- more sample allocators
- userspace ioctl (It should be a simple one, and we have one ready, but wanted
to agree on the kernel side of things first)
May the brickbats begin, please! :)
Best regards,
~Sumit.
[1]: 'C'onstraints 'EN'abled 'ALLOC'ation helpers = cenalloc: it might not be a
very appealing name, so suggestions are very welcome!
Benjamin Gaignard (1):
cenalloc: a sample allocator for contiguous page allocation
Sumit Semwal (3):
dma-buf: Add constraints sharing information
cenalloc: Constraint-Enabled Allocation helpers for dma-buf
cenalloc: Build files for constraint-enabled allocation helpers
MAINTAINERS | 1 +
drivers/Kconfig | 2 +
drivers/Makefile | 1 +
drivers/cenalloc/Kconfig | 8 +
drivers/cenalloc/Makefile | 3 +
drivers/cenalloc/cenalloc.c | 597 ++++++++++++++++++++++++++++++
drivers/cenalloc/cenalloc.h | 99 +++++
drivers/cenalloc/cenalloc_priv.h | 188 ++++++++++
drivers/cenalloc/cenalloc_system_contig.c | 225 +++++++++++
drivers/dma-buf/dma-buf.c | 50 ++-
include/linux/device.h | 7 +-
include/linux/dma-buf.h | 14 +
12 files changed, 1189 insertions(+), 6 deletions(-)
create mode 100644 drivers/cenalloc/Kconfig
create mode 100644 drivers/cenalloc/Makefile
create mode 100644 drivers/cenalloc/cenalloc.c
create mode 100644 drivers/cenalloc/cenalloc.h
create mode 100644 drivers/cenalloc/cenalloc_priv.h
create mode 100644 drivers/cenalloc/cenalloc_system_contig.c
--
1.9.1
Hi,
I need some some pointers on how to write a IOMMU driver on arm64 for a new SoC.
The iommu interface is currently not being provided in dma-mappings.c (the DMA API is SWIOTLB-based)
what is the alternative?
thanks
Jorge
Hi,
I'm adding more people to CC who have commented on Wayland dmabuf
attempts before and might be interested.
If you want to keep updated without monitoring wayland-devel@, you
could subscribe to
https://bugs.freedesktop.org/show_bug.cgi?id=83881
Thanks,
pq
On Fri, 12 Dec 2014 16:51:01 -0500
Louis-Francis Ratté-Boulianne <lfrb(a)collabora.com> wrote:
> This serie of patches by Pekka and George contains an experimental
> implementation of "zlinux_dmabuf" protocol.
>
> See these links for more information about the design and failed previous
> attempts:
>
> http://lists.freedesktop.org/archives/wayland-devel/2014-June/015362.html
> https://bugs.freedesktop.org/show_bug.cgi?id=83881
>
> This protocol allows clients to wrap a dmabuf into a wl_buffer, and push that
> into the compositor for display. The compositor then uses GBM to import that
> wl_buffer as a bo for compositing with GL (via EGLImage) or direct scanout as a
> DRM FB object.
>
> Note that a round-trip is needed when creating the buffer because there is no
> way to communicate all dmabuf constraints from the compositor to a client
> before-hand. They are simply too complicated and changing to be described in
> a Wayland protocol extension. In fact, there are existing APIs like EGL (the
> dmabuf import extension) that are based on trial-and-error rather than knowing
> the constraints before-hand.
>
> However, the protocol design is far far away from complete. Even the kernel
> developers are still discussing, how cross-device support for dmabufs should
> work, and what is the proper information split between the kernel and the user
> space. How do you communicate, or even describe, things like tiling formats.
>
> But, we should start from somewhere, and this patch is pushing the user space
> part forward a bit.
>
> The extension is especially useful for video players and this pipeline has been
> demonstrated to work with GStreamer:
>
> http://cgit.collabora.com/git/user/gkiagia/gst-plugins-bad.git/commit/?h=in…
>
>
> George Kiagiadakis (1):
> clients: add simple-dmabuf client
>
> Pekka Paalanen (6):
> protocol: add linux_dmabuf extension RFCv1
> dmabuf: implement linux_dmabuf extension
> gl-renderer: add dmabuf import
> compositor-x11: init linux_dmabuf support
> compositor-drm: init linux_dmabuf support
> compositor-drm: dmabuf GBM import
>
> .gitignore | 1 +
> Makefile.am | 24 +-
> clients/simple-dmabuf.c | 578 ++++++++++++++++++++++++++++++++++++++++++++++
> configure.ac | 9 +
> protocol/linux-dmabuf.xml | 224 ++++++++++++++++++
> src/compositor-drm.c | 31 ++-
> src/compositor-x11.c | 5 +
> src/gl-renderer.c | 103 +++++++++
> src/linux-dmabuf.c | 322 ++++++++++++++++++++++++++
> src/linux-dmabuf.h | 45 ++++
> 10 files changed, 1336 insertions(+), 6 deletions(-)
> create mode 100644 clients/simple-dmabuf.c
> create mode 100644 protocol/linux-dmabuf.xml
> create mode 100644 src/linux-dmabuf.c
> create mode 100644 src/linux-dmabuf.h
>
This series of patches fix various issues in STI drm driver.
Now HDMI i2c adapter could be selected in device tree
and plug detection doesn't use gpio anymore.
I also had fix some signal timing problems after testing the driver
on more hardware.
The remaining patches attemps to simplify the code and prepare
the next evolutions like DVO and auxiliary CRTC support
The changes could be fetch here:
http://git.linaro.org/people/benjamin.gaignard/kernel.git
on drm-sti-fixes-2014-12-04 branch
Benjamin Gaignard (9):
drm: sti: allow to change hdmi ddc i2c adapter
drm: sti: remove gpio for HDMI hot plug detection
drm: sti: clear all mixer control
drm: sti: simplify gdp code
drm: sti: remove event lock while disabling vblank
drm: sti: fix hdmi avi infoframe
drm: sti: use drm_crtc_vblank_{on/off} instead of drm_vblank_{on/off}
drm: sti: prepare sti_tvout to support auxiliary crtc
drm: sti: fix delay in VTG programming
.../devicetree/bindings/gpu/st,stih4xx.txt | 3 +-
drivers/gpu/drm/sti/sti_drm_crtc.c | 10 +--
drivers/gpu/drm/sti/sti_gdp.c | 39 ++++-----
drivers/gpu/drm/sti/sti_hdmi.c | 84 +++++++++++---------
drivers/gpu/drm/sti/sti_hdmi.h | 6 +-
drivers/gpu/drm/sti/sti_mixer.c | 9 +++
drivers/gpu/drm/sti/sti_mixer.h | 1 +
drivers/gpu/drm/sti/sti_tvout.c | 92 ++++++++++++----------
drivers/gpu/drm/sti/sti_vtg.c | 25 +++++-
9 files changed, 160 insertions(+), 109 deletions(-)
--
1.9.1
Hello Everyone,
This is yet another attempt to finally make Exynos SYSMMU driver fully
integrated with DMA-mapping subsystem.
Previous approach is available here: https://lkml.org/lkml/2014/8/5/183
I meantime, there have been a discussion about the way the iommu driver
should be integrated with dma-mapping subsystem, which resulted in "[RFC
PATCH v3 0/7] Introduce automatic DMA configuration for IOMMU masters"
patches prepared by Will Deacon:
http://www.spinics.net/lists/arm-kernel/msg362076.html
Those patches removed the need to use bus-specific notifiers for
initialization.
Main changes since previous version of my patches:
1. rebased onto "[RFC PATCH v3 0/7] Introduce automatic DMA
configuration for IOMMU masters" patches, changed initialization from
bus notifiers to DT related callbacks
2. removed support for separate IO address spaces - this will be
discussed separately after the basic support gets merged
3. removed support for power domain notifier-based runtime power
management - this also will be discussed separately later
I hope that the driver with above changes will be easier to be merged to
v3.18.
Best regards
Marek Szyprowski
Samsung R&D Institute Poland
Patch summary:
Marek Szyprowski (18):
arm: dma-mapping: arm_iommu_attach_device: automatically set
max_seg_size
arm: exynos: bind power domains earlier, on device creation
drm: exynos: detach from default dma-mapping domain on init
clk: exynos: add missing smmu_g2d clock and update comments
ARM: DTS: Exynos4: add System MMU nodes
iommu: exynos: don't read version register on every tlb operation
iommu: exynos: remove unused functions
iommu: exynos: remove useless spinlock
iommu: exynos: refactor function parameters to simplify code
iommu: exynos: remove unused functions, part 2
iommu: exynos: remove useless device_add/remove callbacks
iommu: exynos: add support for binding more than one sysmmu to master
device
iommu: exynos: add support for runtime_pm
iommu: exynos: rename variables to reflect their purpose
iommu: exynos: document internal structures
iommu: exynos: remove excessive includes and sort others
alphabetically
iommu: exynos: init from dt-specific callback instead of initcall
iommu: exynos: add callback for initializing devices from device tree
arch/arm/boot/dts/exynos4.dtsi | 117 +++++++
arch/arm/boot/dts/exynos4210.dtsi | 23 ++
arch/arm/boot/dts/exynos4x12.dtsi | 82 +++++
arch/arm/mach-exynos/pm_domains.c | 12 +-
arch/arm/mm/dma-mapping.c | 16 +
drivers/clk/samsung/clk-exynos4.c | 1 +
drivers/gpu/drm/exynos/exynos_drm_iommu.c | 3 +
drivers/iommu/exynos-iommu.c | 494 ++++++++++++++----------------
include/dt-bindings/clock/exynos4.h | 10 +-
9 files changed, 483 insertions(+), 275 deletions(-)
--
1.9.2
Hello,
This is another approach to finish support for reserved memory regions
defined in device tree. Previous attempts
(http://lists.linaro.org/pipermail/linaro-mm-sig/2014-February/003738.html
and https://lkml.org/lkml/2014/7/14/108) ended in merging parts of the
code and documentation. Merged patches allow to reserve memory, but
there is still no reserved memory drivers nor any code that actually
uses reserved memory regions.
The final conclusion from the above mentioned threads is that there is
no automated reserved memory initialization. All drivers that want to
use reserved memory, should initialize it on their own.
This patch series provides two driver for reserved memory regions (one
based on CMA and one based on dma_coherent allocator). The main
improvement comparing to the previous version is removal of automated
reserved memory for every device and support for named memory regions.
Those patches are for merging, rebased on top of recent linux-next tree.
Best regards
Marek Szyprowski
Samsung R&D Institute Poland
Changes since v1 (https://lkml.org/lkml/2014/8/26/339):
- removed patches for named reserved regions - they will be discussed
separately
- added a check for 'no-map' property to dma coherent allocator
(suggested by Laura Abbott)
- removed example code for s5p-mfc driver
Changes since '[PATCH v2 RESEND 0/4] CMA & device tree, once again' version:
(https://lkml.org/lkml/2014/7/14/108)
- added return error value to of_reserved_mem_device_init()
- added support for named memory regions (so more than one region can be
defined per device)
- added usage example - converted custom reserved memory code used by
s5p-mfc driver to the generic reserved memory handling code
Patch summary:
Marek Szyprowski (3):
drivers: of: add return value to of_reserved_mem_device_init
drivers: dma-coherent: add initialization from device tree
drivers: dma-contiguous: add initialization from device tree
drivers/base/dma-coherent.c | 145 ++++++++++++++++++++++++++++++++++------
drivers/base/dma-contiguous.c | 71 ++++++++++++++++++++
drivers/of/of_reserved_mem.c | 3 +-
include/linux/cma.h | 3 +
include/linux/of_reserved_mem.h | 9 ++-
mm/cma.c | 62 ++++++++++++++---
6 files changed, 259 insertions(+), 34 deletions(-)
--
1.9.2