Skip to content

Commit 8324bee

Browse files
committed
sunxi-6.18: restore original patch headers
make them persistent against rewrites
1 parent 9b31785 commit 8324bee

3 files changed

Lines changed: 65 additions & 42 deletions

patch/kernel/archive/sunxi-6.18/patches.armbian/drm-gem-dma-support-dedicated-dma-device-for-allocation-and-mapping.patch

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2-
From: EvilOlaf <werner@armbian.com>
3-
Date: Fri, 27 Mar 2026 15:19:07 +0100
4-
Subject: [ARCHEOLOGY] sunxi-6.18: drm/gem-dma: Support dedicated DMA device
5-
for allocation
2+
From: Chen-Yu Tsai <wenst@chromium.org>
3+
Date: Wed, 11 Mar 2026 17:49:26 +0800
4+
Subject: drm/gem-dma: Support dedicated DMA device for allocation and mapping
65

7-
> X-Git-Archeology: - Revision 501ad529462d3159993b07485eb4d5f5746c3f46: https://github.com/armbian/build/commit/501ad529462d3159993b07485eb4d5f5746c3f46
8-
> X-Git-Archeology: Date: Fri, 27 Mar 2026 15:19:07 +0100
9-
> X-Git-Archeology: From: EvilOlaf <werner@armbian.com>
10-
> X-Git-Archeology: Subject: sunxi-6.18: drm/gem-dma: Support dedicated DMA device for allocation
11-
> X-Git-Archeology:
12-
> X-Git-Archeology: - Revision d944703ab8a32e52838f921cb67dd2db6d26b5df: https://github.com/armbian/build/commit/d944703ab8a32e52838f921cb67dd2db6d26b5df
13-
> X-Git-Archeology: Date: Fri, 27 Mar 2026 15:19:07 +0100
14-
> X-Git-Archeology: From: EvilOlaf <werner@armbian.com>
15-
> X-Git-Archeology: Subject: sunxi-7.0: drm/gem-dma: Support dedicated DMA device for allocation
16-
> X-Git-Archeology:
6+
Support for a dedicated DMA device for prime imports was added in commit
7+
143ec8d3f939 ("drm/prime: Support dedicated DMA device for dma-buf imports").
8+
This allowed the DRM driver to provide a dedicated DMA device when its
9+
own underlying device was not capable of DMA, for example when it is a
10+
USB device (the original target) or a virtual device. The latter case is
11+
common on embedded SoCs, on which the display pipeline is composed of
12+
various fixed function blocks, and the DRM device is simply a made-up
13+
device, an address space managing the routing between the blocks, or
14+
whichever block the implementor thought made sense at the time. The
15+
point is that the chosen device is often not the actual device doing
16+
the DMA. Various drivers have used workarounds or reimplemented the
17+
GEM DMA helpers to get the DMA addresses and IOMMUs to work correctly.
18+
19+
Add support for the dedicated DMA device to the GEM DMA helpers.
20+
21+
No existing driver currently uses the GEM DMA helpers and calls
22+
drm_dev_set_dma_dev() to set a dedicated DMA device, so no existing
23+
users should be affected.
24+
25+
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
26+
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
27+
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
1728
---
1829
drivers/gpu/drm/drm_gem_dma_helper.c | 21 ++++++----
1930
1 file changed, 12 insertions(+), 9 deletions(-)

patch/kernel/archive/sunxi-6.18/patches.armbian/drm-prime-limit-scatter-list-size-with-dedicated-dma-device.patch

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2-
From: EvilOlaf <werner@armbian.com>
3-
Date: Fri, 27 Mar 2026 15:19:07 +0100
4-
Subject: [ARCHEOLOGY] sunxi-6.18: drm/gem-dma: Support dedicated DMA device
5-
for allocation
2+
From: Chen-Yu Tsai <wenst@chromium.org>
3+
Date: Wed, 11 Mar 2026 17:49:25 +0800
4+
Subject: drm/prime: Limit scatter list size with dedicated DMA device
65

7-
> X-Git-Archeology: - Revision 501ad529462d3159993b07485eb4d5f5746c3f46: https://github.com/armbian/build/commit/501ad529462d3159993b07485eb4d5f5746c3f46
8-
> X-Git-Archeology: Date: Fri, 27 Mar 2026 15:19:07 +0100
9-
> X-Git-Archeology: From: EvilOlaf <werner@armbian.com>
10-
> X-Git-Archeology: Subject: sunxi-6.18: drm/gem-dma: Support dedicated DMA device for allocation
11-
> X-Git-Archeology:
12-
> X-Git-Archeology: - Revision d944703ab8a32e52838f921cb67dd2db6d26b5df: https://github.com/armbian/build/commit/d944703ab8a32e52838f921cb67dd2db6d26b5df
13-
> X-Git-Archeology: Date: Fri, 27 Mar 2026 15:19:07 +0100
14-
> X-Git-Archeology: From: EvilOlaf <werner@armbian.com>
15-
> X-Git-Archeology: Subject: sunxi-7.0: drm/gem-dma: Support dedicated DMA device for allocation
16-
> X-Git-Archeology:
6+
If a dedicated DMA device is specified for the DRM device, then the
7+
scatter list size limit should pertain to the DMA device.
8+
9+
Use the dedicated DMA device, if given, to limit the scatter list size.
10+
This only applies to drivers that have called drm_dev_set_dma_dev() and
11+
are using drm_prime_pages_to_sg() either directly or through the SHMEM
12+
helpers. At the time of this writing, the former case only includes the
13+
Rockchip DRM driver, while the latter case includes the gud, udl, and
14+
the tiny appletbdrm and gm12u320 drivers.
15+
16+
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
17+
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
18+
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
1719
---
1820
drivers/gpu/drm/drm_prime.c | 2 +-
1921
1 file changed, 1 insertion(+), 1 deletion(-)

patch/kernel/archive/sunxi-6.18/patches.armbian/drm-sun4i-use-backend-mixer-as-dedicated-dma-device.patch

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2-
From: EvilOlaf <werner@armbian.com>
3-
Date: Fri, 27 Mar 2026 15:19:07 +0100
4-
Subject: [ARCHEOLOGY] sunxi-6.18: drm/gem-dma: Support dedicated DMA device
5-
for allocation
2+
From: Chen-Yu Tsai <wenst@chromium.org>
3+
Date: Wed, 11 Mar 2026 17:49:28 +0800
4+
Subject: drm/sun4i: Use backend/mixer as dedicated DMA device
65

7-
> X-Git-Archeology: - Revision 501ad529462d3159993b07485eb4d5f5746c3f46: https://github.com/armbian/build/commit/501ad529462d3159993b07485eb4d5f5746c3f46
8-
> X-Git-Archeology: Date: Fri, 27 Mar 2026 15:19:07 +0100
9-
> X-Git-Archeology: From: EvilOlaf <werner@armbian.com>
10-
> X-Git-Archeology: Subject: sunxi-6.18: drm/gem-dma: Support dedicated DMA device for allocation
11-
> X-Git-Archeology:
12-
> X-Git-Archeology: - Revision d944703ab8a32e52838f921cb67dd2db6d26b5df: https://github.com/armbian/build/commit/d944703ab8a32e52838f921cb67dd2db6d26b5df
13-
> X-Git-Archeology: Date: Fri, 27 Mar 2026 15:19:07 +0100
14-
> X-Git-Archeology: From: EvilOlaf <werner@armbian.com>
15-
> X-Git-Archeology: Subject: sunxi-7.0: drm/gem-dma: Support dedicated DMA device for allocation
16-
> X-Git-Archeology:
6+
The sun4i DRM driver deals with DMA constraints in a peculiar way.
7+
Instead of using the actual DMA device in various helpers, it justs
8+
reconfigures the DMA constraints of the virtual display device using
9+
the DMA device's device tree node by calling of_dma_configure().
10+
11+
Turns out of_dma_configure() should only be called from bus code.
12+
Lately this also triggers a big warning through of_iommu_configure()
13+
and ultimately __iommu_probe_device():
14+
15+
late IOMMU probe at driver bind, something fishy here!
16+
17+
Now that the GEM DMA helpers have proper support for allocating
18+
and mapping buffers with a dedicated DMA device, switch over to
19+
it as the proper solution.
20+
21+
The mixer change was tested on a Pine H64 model B. The backend change
22+
was only compile tested. Though I don't expect any issues, help testing
23+
on an older device would be appreciated.
24+
25+
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
26+
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
1727
---
1828
drivers/gpu/drm/sun4i/sun4i_backend.c | 27 +++++-----
1929
drivers/gpu/drm/sun4i/sun8i_mixer.c | 27 +++++-----

0 commit comments

Comments
 (0)