Changelog:
v4:
* Split pcim_p2pdma_provider() to two functions, one that initializes
array of providers and another to return right provider pointer.
v3: https://lore.kernel.org/all/cover.1758804980.git.leon@kernel.org
* Changed pcim_p2pdma_enable() to be pcim_p2pdma_provider().
* Cache provider in vfio_pci_dma_buf struct instead of BAR index.
* Removed misleading comment from pcim_p2pdma_provider().
* Moved MMIO check to be in pcim_p2pdma_provider().
v2: https://lore.kernel.org/all/cover.1757589589.git.leon@kernel.org/
* Added extra patch which adds new CONFIG, so next patches can reuse it.
* Squashed "PCI/P2PDMA: Remove redundant bus_offset from map state"
into the other patch.
* Fixed revoke calls to be aligned with true->false semantics.
* Extended p2pdma_providers to be per-BAR and not global to whole device.
* Fixed possible race between dmabuf states and revoke.
* Moved revoke to PCI BAR zap block.
v1: https://lore.kernel.org/all/cover.1754311439.git.leon@kernel.org
* Changed commit messages.
* Reused DMA_ATTR_MMIO attribute.
* Returned support for multiple DMA ranges per-dMABUF.
v0: https://lore.kernel.org/all/cover.1753274085.git.leonro@nvidia.com
---------------------------------------------------------------------------
Based on "[PATCH v6 00/16] dma-mapping: migrate to physical address-based API"
https://lore.kernel.org/all/cover.1757423202.git.leonro@nvidia.com/ series.
---------------------------------------------------------------------------
This series extends the VFIO PCI subsystem to support exporting MMIO
regions from PCI device BARs as dma-buf objects, enabling safe sharing of
non-struct page memory with controlled lifetime management. This allows RDMA
and other subsystems to import dma-buf FDs and build them into memory regions
for PCI P2P operations.
The series supports a use case for SPDK where a NVMe device will be
owned by SPDK through VFIO but interacting with a RDMA device. The RDMA
device may directly access the NVMe CMB or directly manipulate the NVMe
device's doorbell using PCI P2P.
However, as a general mechanism, it can support many other scenarios with
VFIO. This dmabuf approach can be usable by iommufd as well for generic
and safe P2P mappings.
In addition to the SPDK use-case mentioned above, the capability added
in this patch series can also be useful when a buffer (located in device
memory such as VRAM) needs to be shared between any two dGPU devices or
instances (assuming one of them is bound to VFIO PCI) as long as they
are P2P DMA compatible.
The implementation provides a revocable attachment mechanism using dma-buf
move operations. MMIO regions are normally pinned as BARs don't change
physical addresses, but access is revoked when the VFIO device is closed
or a PCI reset is issued. This ensures kernel self-defense against
potentially hostile userspace.
The series includes significant refactoring of the PCI P2PDMA subsystem
to separate core P2P functionality from memory allocation features,
making it more modular and suitable for VFIO use cases that don't need
struct page support.
-----------------------------------------------------------------------
The series is based originally on
https://lore.kernel.org/all/20250307052248.405803-1-vivek.kasireddy@intel.c…
but heavily rewritten to be based on DMA physical API.
-----------------------------------------------------------------------
The WIP branch can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/log/?h=…
Thanks
Leon Romanovsky (8):
PCI/P2PDMA: Separate the mmap() support from the core logic
PCI/P2PDMA: Simplify bus address mapping API
PCI/P2PDMA: Refactor to separate core P2P functionality from memory
allocation
PCI/P2PDMA: Export pci_p2pdma_map_type() function
types: move phys_vec definition to common header
vfio/pci: Add dma-buf export config for MMIO regions
vfio/pci: Enable peer-to-peer DMA transactions by default
vfio/pci: Add dma-buf export support for MMIO regions
Vivek Kasireddy (2):
vfio: Export vfio device get and put registration helpers
vfio/pci: Share the core device pointer while invoking feature
functions
block/blk-mq-dma.c | 7 +-
drivers/iommu/dma-iommu.c | 4 +-
drivers/pci/p2pdma.c | 177 +++++++++----
drivers/vfio/pci/Kconfig | 20 ++
drivers/vfio/pci/Makefile | 2 +
drivers/vfio/pci/vfio_pci_config.c | 22 +-
drivers/vfio/pci/vfio_pci_core.c | 56 ++--
drivers/vfio/pci/vfio_pci_dmabuf.c | 398 +++++++++++++++++++++++++++++
drivers/vfio/pci/vfio_pci_priv.h | 23 ++
drivers/vfio/vfio_main.c | 2 +
include/linux/pci-p2pdma.h | 120 +++++----
include/linux/types.h | 5 +
include/linux/vfio.h | 2 +
include/linux/vfio_pci_core.h | 3 +
include/uapi/linux/vfio.h | 25 ++
kernel/dma/direct.c | 4 +-
mm/hmm.c | 2 +-
17 files changed, 750 insertions(+), 122 deletions(-)
create mode 100644 drivers/vfio/pci/vfio_pci_dmabuf.c
--
2.51.0
On Tue, 30 Sept 2025 at 12:56, Himanshu Dewangan <h.dewangan(a)samsung.com> wrote:
>
> From: Nagaraju Siddineni <nagaraju.s(a)samsung.com>
>
> Introduce a new Kconfig entry VIDEO_EXYNOS_MFC for the Samsung
> Exynos MFC driver that supports firmware version 13 and later.
> Extend the top‑level Samsung platform Kconfig to disable the legacy
> S5P‑MFC driver when its firmware version is > v12 and to select the
> new Exynos‑MFC driver only when VIDEO_SAMSUNG_S5P_MFC is not enabled.
>
> Add exynos-mfc Kconfig and Makefile for probe functionality and creation
> of decoder and encoder device files by registering the driver object
> exynos_mfc.o and other relevant source files.
>
> Provide header files mfc_core_ops.h and mfc_rm.h containing core
> operation prototypes, resource‑manager helpers,
> and core‑selection utilities.
>
> Add a configurable option MFC_USE_COREDUMP to enable core‑dump
> support for debugging MFC errors.
>
> These changes bring support for newer Exynos‑based MFC hardware,
> cleanly separate it from the legacy S5P‑MFC driver, and lay the
> groundwork for future feature development and debugging.
>
No, NAK. Existing driver is well tested and already used on newest
Exynos SoC, so all this new driver is exactly how you should not work
in upstream. You need to integrate into existing driver.
Samsung received this review multiple times already.
Best regards,
Krzysztof
On Tue, Sep 30, 2025 at 12:50:47PM +0000, Shameer Kolothum wrote:
> This is where hisi_acc reports a different BAR size as it tries to hide
> the migration control region from Guest access.
I think for now we should disable DMABUF for any PCI driver that
implements a VFIO_DEVICE_GET_REGION_INFO
For a while I've wanted to further reduce the use of the ioctl
multiplexer, so maybe this series:
https://github.com/jgunthorpe/linux/commits/vfio_get_region_info_op/
And then the dmabuf code can check if the ops are set to the generic
or not and disable itself automatically.
Otherwise perhaps route the dmabuf through an op and deliberately omit
it (with a comment!) from hisi, virtio, nvgrace.
We need to route it through an op anyhow as those three drivers will
probably eventually want to implement their own version.
Jason
Hi Himanshu,
Le mardi 30 septembre 2025 à 09:33 +0530, Himanshu Dewangan a écrit :
> Exynos MFC new driver upstream proposal
> +++++++++++++++++++++++++++++++++++++++
>
> The s5p-mfc driver in the kernel is quite outdated and has not kept up with the hardware advances of the MFC IP.
> Going forward, we want to provide support for all the later versions of MFC in open source (both mobile and
> ExynosAuto would be supported by Samsung)
>
> We (Samsung) would like to propose a new driver for the latest generation of Samsung MFC (Multi-Format Codec) hardware.
> Although the kernel already contains a Samsung MFC driver (drivers/media/platform/s5p-mfc/), the newer hardware
> diverges significantly from the previous generations, in features supported, register interface and in system integration.
> This has necessitated a new driver, rather than updating the existing one.
I wont deny that sometimes a new driver is needed, and I encourage you to defend
your point. It does just justify any form of copy paste, also understand that
device descriptions should be independent from the driver implementation. This
is also why this is reviewed indecently, and DT nack won't ever be ignored by
us.
From quick walk through, I'm not convince this new driver actually makes use of
everything new in Linux and Linux Media since 2011. It will be important for you
to research what other modern drivers do, and what could apply to your code
base. I'm quite skeptical with all the custom memory handling code, which
generally indicates the miss-use of dma APIs. Realistically, you will have to
split your driver in smaller parts and submit in a way we can see your design
principle, and not just randomly unused files being added. Considering the state
of it, we are up to 20 or 30 revision, with 29 patches, you won't get to the end
of that process.
V4L2 wise, one of the common mistakes is that you are adding a lot of new
controls, most of them just slammed as vendor control without even trying to
generalize. It did make sense in 2011, since there was no decoder to compare
against, but today there is a lot of example and overlap between various brand.
Omitting documentation and not keeping the API addition separate is also a no go
for me. Make it very clear whenever something that will live in our API forever
is to be added.
We also added rules since 2011 that enforce drivers submitter to show that
proper testing have occurred. Its starts with the very basic v4l2-compliance
report which you have omitted. Since its codec driver, we require a summary of
your conformance decoding testing done with fluster[] with the supported
framework of your choice (for v4l2 stateful, ffmpeg and gstreamer are supported,
you can add more, as long as they are open source).
We also expect that your firmware has been submitted to linux-firmware with a
link to that submission. Without that, we can only consider your set as an RFC
to show people what is coming.
regards,
Nicolas
>
>
> Current driver vs targetted driver comparison
> +++++++++++++++++++++++++++++++++++++++++++++
>
> Target Feature
> Current mainline : Simple V4L2/ VB2 interface based encoder/ decoder
> New proposed driver: Dual core support, NAL-q support, LLC, Coredump, performance
> measurement, plugin driver architecture, hardware manager(meerkat), DRM/OTF,
> Resource manager, bandwidth compression, New Pixel formats (NV12N, YV12, P010,
> SBWC, RGB family), 10 bit support, HDR support, Prio and RR Process Scheduler support,
>
> Register map
> Current mainline : Fixed register layout, compatible across s5p variants
> New proposed driver: Completely redesigned register set, incompatible with old layout
>
> Command model
> Current mainline : Mailbox-style command queue
> New proposed driver: Ring-buffer command queue with different signaling
>
> Memory management
> Current mainline : CMA-backed contiguous buffers, ION legacy
> New proposed driver: dma-heap / scatter-gather buffers with strict alignment rules
>
> Firmware
> Current mainline : Supports up to Firmware v12, Legacy binary format, loaded via shared mechanism
> New proposed driver: New firmware format, different protocol for control messages. Support Firmware v13 onwards
>
> DT bindings
> Current mainline : Single clock + reset, simple PM
> New proposed driver: Multiple clocks, reset domains, runtime PM dependencies
>
> Error handling
> Current mainline : Simple IRQ error flags
> New proposed driver: Detailed error codes, recovery sequences required
>
> Code impact
> Current mainline :~8k LOC, minimal conditionals
> New proposed driver: ~65KLOC with full features
>
>
> Plan for supporting latest MFC (Best balance between code clarity and long-term kernel health, while still respecting ABI and legacy users.)
> 1 We propose a new driver (exynos-mfc) for the latest generation of Samsung MFC (Multi-Format Codec) hardware.
> 2 MFC FW V6 to V12 will be supported by existing mainline (s5p-mfc) and later versions by Exynos-mfc driver
> 3 The existing MFC driver will remain available for older SoC’s and will not be broken. The new driver will only bind
> to new compatible strings in DT, avoiding regressions for legacy hardware. Samsung will take responsibility for
> maintaining both drivers until the old one can be formally marked as “legacy.”
> 4 Keep it buildable for old SoCs but clearly say new SoCs should use the new driver.
> 5 VIDEO_SAMSUNG_S5P_MFC and VIDEO_EXYNOS_MFC will both be supported for an agreed time
> 6 Long term Support for new driver - commitment from Samsung
> 7 The hardware has diverged to the point where conditionally supporting both in one codebase is worse for long-term kernel health
> 8 Splitting keeps the code clean, testable, and reviewable, while ensuring legacy users aren’t broken due to user space ABI guarantees.
> This seems more clean and easier approach Both can coexist without code spaghetti.
>
> Features and description supported
> ++++++++++++++++++++++++++++++++++
>
> 1 MFC driver registration Probe functionality and video nodes registration
> 2 MFC driver open & close support MFC firmware loading, "ls" & "cat" on the video nodes and udev rules on the video nodes
> 3 H264 decoding H264 decoding support - HW supported profiles & levels (YUV420 Semi-Planar, 8-bit, min/max resolution)
> 4 HEVC decoding HEVC decoding support - HW supported profiles & levels (YUV420 Semi-Planar, 8-bit, min/max resolution)
> 5 VP8 decoding VP8 decoding support - HW supported profiles & levels (YUV420 Semi-Planar, 8-bit, min/max resolution)
> 6 VP9 decoding VP9 decoding support - HW supported profiles & levels (YUV420 Semi-Planar, 8-bit, min/max resolution)
> 7 AV1 decoding AV1 decoding support - HW supported profiles & levels (YUV420 Semi-Planar, 8-bit, min/max resolution)
> 8 H264 encoding H264 encoding support - Basic encoding (YUV420 Semi-Planar, 8-bit, min/max resolution)
> 9 HEVC encoding HEVC encoding support - Basic encoding (YUV420 Semi-Planar, 8-bit, min/max resolution)
> 10 VP8 encoding VP8 encoding support - Basic encoding (YUV420 Semi-Planar, 8-bit, min/max resolution)
> 11 VP9 encoding VP9 encoding support - Basic encoding (YUV420 Semi-Planar, 8-bit, min/max resolution)
> 12 Debug fs support Debug fs to control the MFC functionalities
> 13 Debug log support Debug logs to get on the dmesg prompt for debug purpose
> 14 Debug SFR dump support MFC SFR dumps during failures
> 15 NAL Queue mode control NAL Queue mode support
> 16 Batch mode control Batch mode support
> 17 HW supported YUV formats YUV 420, 422, 444 (planar, semi-planar) formats support as per MFC HW specification
> 18 HW supported RGB formats RGB format support as per MFC HW specification
> 19 Multi instance decoding/encoding Multi instance decoding/encoding
> 20 Suspend and resume Suspend and resume support
> 21 Runtime suspend and resume Runtime suspend and resume support
> 22 Priority decoding (decoders) Priority decoding support
> 23 Frame delay configuration (decoders) Frame delay configuration support
> 24 Error handling and conceal control (decoders) HW/Platform limitations should be gracefully exited and,
> bit stream errors should be reported or concealed with warning indication
> 25 Reference frame control (encoders) Reference frame control support
> 26 SPS/PPS control (encoders) SPS/PPS control support
> 27 Loop filter control (encoders) Loop filter control support
> 28 B frame support (encoders) B frame support
> 29 GOP control (encoders) GOP control support
> 30 Frame rate control (encoders) Frame rate control support
>
> Features to be supported in 2026
> +++++++++++++++++++++++++++++++++
>
> 31 Bit rate control (encoders) Bit rate control support
> 32 QP control (encoders) QP control support
> 33 I/IDR control (encoders) I/IDR control support
> 34 Scalable control (encoders) Scalable control support
> 35 ROI control (encoders) ROI control support
> 36 Multi slice control (encoders) Multi slice control support
> 37 Profile/Level control (encoders) Profile/Level control support
> 38 Padding control (encoders) Padding control support
> 39 Aspect ratio control (encoders) Aspect ratio control support
> 40 Buffer full handling (encoders) Buffer full handling support
> 41 SBWC SBWC bandwidth compression support
> 42 10-bit support 10-bit support as per MFC HW specification
> 43 Secure signed FW support Security signed FW support
> 44 Secure playback DRM content playback for decoders
> 45 HDR Support (decoders) HDR metadata support
> 46 Dynamic resolution change Dynamic resolution change support
>
> Nagaraju Siddineni (29):
> dt-bindings: media: mfc: Add Exynos MFC devicetree binding
> arm64: dts: mfc: Add MFC device tree for Auto V920 SoC
> media: mfc: Add MFC driver data structures and debugging macros
> media: mfc: Add full register map and bit definitions for MFC hardware
> media: mfc: Add MFC driver header files and core utilities
> media: mfc: Add MFC core hardware register and debugfs APIs
> media: mfc: Add MFC core command, hwlock, ISR and run functionalities
> media: mfc: Add Exynos‑MFC driver probe support
> media: mfc: Add bus‑devfreq, QoS, multi‑view and control
> infrastructure
> media: mfc: Add buffer‑queue and IOVMM support
> media: mfc: Add rate‑calculation framework and memory utilities
> media: mfc: Introduce QoS support and instance context handling
> media: mfc: Add decoder core sync functions
> media: mfc: Add buffer‑control framework
> media: mfc: Add decoder resource‑management (RM) support and
> load‑balancing
> media: mfc: Enhance HW‑lock handling, scheduling and error recovery
> media: mfc: Add VB2 decoder support
> media: mfc: Add V4L2 decoder driver
> media: mfc: Add QoS, Butler workqueue, and priority‑based scheduling
> media: mfc: Add H264 decoder support
> media: mfc: Add multi‑codec support & QoS improvements
> media: mfc: Add H.264 encoder support with buffer and QoS improvements
> media: mfc: Add encoder parameters, ROI & QoS support
> media: mfc: Add encoder VB2 support to driver
> media: mfc: Add encoder v4l2 driver interface
> media: mfc: Add full encoder support
> media: mfc: Add H.264 encoder support
> media: mfc: Add AVC, VP8, VP9, and HEVC encoding support
> media: mfc: Hardware‑accelerated encoding support
>
> .../bindings/media/samsung,exynos-mfc.yaml | 77 +
> MAINTAINERS | 10 +
> .../dts/exynos/exynosautov920-evt2-mfc.dtsi | 630 +++
> .../arm64/boot/dts/exynos/exynosautov920.dtsi | 1 +
> drivers/media/platform/samsung/Kconfig | 7 +
> drivers/media/platform/samsung/Makefile | 1 +
> .../media/platform/samsung/exynos-mfc/Kconfig | 34 +
> .../platform/samsung/exynos-mfc/Makefile | 26 +
> .../samsung/exynos-mfc/base/mfc_buf.c | 765 +++
> .../samsung/exynos-mfc/base/mfc_buf.h | 43 +
> .../samsung/exynos-mfc/base/mfc_common.h | 444 ++
> .../samsung/exynos-mfc/base/mfc_data_struct.h | 2014 +++++++
> .../samsung/exynos-mfc/base/mfc_debug.h | 247 +
> .../samsung/exynos-mfc/base/mfc_format.h | 316 ++
> .../samsung/exynos-mfc/base/mfc_macros.h | 95 +
> .../samsung/exynos-mfc/base/mfc_media.h | 554 ++
> .../samsung/exynos-mfc/base/mfc_mem.c | 995 ++++
> .../samsung/exynos-mfc/base/mfc_mem.h | 155 +
> .../samsung/exynos-mfc/base/mfc_qos.c | 1070 ++++
> .../samsung/exynos-mfc/base/mfc_qos.h | 99 +
> .../samsung/exynos-mfc/base/mfc_queue.c | 966 ++++
> .../samsung/exynos-mfc/base/mfc_queue.h | 158 +
> .../exynos-mfc/base/mfc_rate_calculate.c | 640 +++
> .../exynos-mfc/base/mfc_rate_calculate.h | 106 +
> .../samsung/exynos-mfc/base/mfc_regs.h | 58 +
> .../samsung/exynos-mfc/base/mfc_regs_mfc.h | 1002 ++++
> .../samsung/exynos-mfc/base/mfc_sched.h | 30 +
> .../samsung/exynos-mfc/base/mfc_utils.c | 401 ++
> .../samsung/exynos-mfc/base/mfc_utils.h | 481 ++
> .../media/platform/samsung/exynos-mfc/mfc.c | 1366 +++++
> .../platform/samsung/exynos-mfc/mfc_core.c | 703 +++
> .../samsung/exynos-mfc/mfc_core_buf_ctrl.c | 543 ++
> .../samsung/exynos-mfc/mfc_core_cmd.c | 576 ++
> .../samsung/exynos-mfc/mfc_core_cmd.h | 41 +
> .../samsung/exynos-mfc/mfc_core_enc_param.c | 1463 ++++++
> .../samsung/exynos-mfc/mfc_core_enc_param.h | 23 +
> .../samsung/exynos-mfc/mfc_core_hw_reg_api.c | 122 +
> .../samsung/exynos-mfc/mfc_core_hw_reg_api.h | 144 +
> .../samsung/exynos-mfc/mfc_core_hwlock.c | 761 +++
> .../samsung/exynos-mfc/mfc_core_hwlock.h | 80 +
> .../samsung/exynos-mfc/mfc_core_intlock.c | 98 +
> .../samsung/exynos-mfc/mfc_core_intlock.h | 20 +
> .../samsung/exynos-mfc/mfc_core_isr.c | 2104 ++++++++
> .../samsung/exynos-mfc/mfc_core_isr.h | 25 +
> .../samsung/exynos-mfc/mfc_core_ops.c | 813 +++
> .../samsung/exynos-mfc/mfc_core_ops.h | 16 +
> .../platform/samsung/exynos-mfc/mfc_core_pm.c | 209 +
> .../platform/samsung/exynos-mfc/mfc_core_pm.h | 33 +
> .../samsung/exynos-mfc/mfc_core_reg_api.c | 597 +++
> .../samsung/exynos-mfc/mfc_core_reg_api.h | 380 ++
> .../samsung/exynos-mfc/mfc_core_run.c | 541 ++
> .../samsung/exynos-mfc/mfc_core_run.h | 35 +
> .../samsung/exynos-mfc/mfc_core_sched_prio.c | 431 ++
> .../samsung/exynos-mfc/mfc_core_sync.c | 423 ++
> .../samsung/exynos-mfc/mfc_core_sync.h | 34 +
> .../samsung/exynos-mfc/mfc_ctx_ctrl.c | 1469 ++++++
> .../platform/samsung/exynos-mfc/mfc_debugfs.c | 248 +
> .../platform/samsung/exynos-mfc/mfc_debugfs.h | 20 +
> .../samsung/exynos-mfc/mfc_dec_v4l2.c | 1739 +++++++
> .../samsung/exynos-mfc/mfc_dec_v4l2.h | 20 +
> .../platform/samsung/exynos-mfc/mfc_dec_vb2.c | 394 ++
> .../platform/samsung/exynos-mfc/mfc_dec_vb2.h | 19 +
> .../samsung/exynos-mfc/mfc_enc_v4l2.c | 4614 +++++++++++++++++
> .../samsung/exynos-mfc/mfc_enc_v4l2.h | 20 +
> .../platform/samsung/exynos-mfc/mfc_enc_vb2.c | 443 ++
> .../platform/samsung/exynos-mfc/mfc_enc_vb2.h | 19 +
> .../platform/samsung/exynos-mfc/mfc_rm.c | 2652 ++++++++++
> .../platform/samsung/exynos-mfc/mfc_rm.h | 110 +
> 68 files changed, 34773 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/media/samsung,exynos-mfc.yaml
> create mode 100644 arch/arm64/boot/dts/exynos/exynosautov920-evt2-mfc.dtsi
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/Kconfig
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/Makefile
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_buf.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_buf.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_common.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_data_struct.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_debug.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_format.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_macros.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_media.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_mem.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_mem.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_qos.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_qos.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_queue.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_queue.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_rate_calculate.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_rate_calculate.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_regs.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_regs_mfc.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_sched.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_utils.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/base/mfc_utils.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_buf_ctrl.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_cmd.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_cmd.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_enc_param.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_enc_param.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_hw_reg_api.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_hw_reg_api.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_hwlock.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_hwlock.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_intlock.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_intlock.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_isr.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_isr.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_ops.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_ops.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_pm.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_pm.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_reg_api.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_reg_api.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_run.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_run.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_sched_prio.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_sync.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_core_sync.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_ctx_ctrl.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_debugfs.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_debugfs.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_dec_v4l2.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_dec_v4l2.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_dec_vb2.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_dec_vb2.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_enc_v4l2.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_enc_v4l2.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_enc_vb2.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_enc_vb2.h
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_rm.c
> create mode 100644 drivers/media/platform/samsung/exynos-mfc/mfc_rm.h
On Tue, 30 Sept 2025 at 12:55, Himanshu Dewangan <h.dewangan(a)samsung.com> wrote:
>
> From: Nagaraju Siddineni <nagaraju.s(a)samsung.com>
>
> Introduce the device‑tree entries for the Samsung Exynos AUTO V920
> multimedia‑function controller (MFC). The patch defines:
> - Reserved memory regions for firmware and CMA buffers.
> - Core0 and Core1 memory mappings.
> - The main MFC node with basic properties (compatible, reg, interrupts,
> clocks, DMA window, firmware name, debug mode, etc.).
> - Per‑core sub‑nodes (MFC‑0 and MFC‑1) with their own sysmmu,
> firmware region, and configuration parameters.
> - Resource table listing supported codecs and their capabilities.
>
> Adds full support for the V920 MFC hardware to the mainline kernel
> device‑tree, enabling proper memory allocation, interrupt handling and
> codec operation on this platform.
>
> Signed-off-by: Nagaraju Siddineni <nagaraju.s(a)samsung.com>
> Signed-off-by: Himanshu Dewangan <h.dewangan(a)samsung.com>
> ---
> .../dts/exynos/exynosautov920-evt2-mfc.dtsi | 187 ++++++++++++++++++
No, there are no such files. Don't push your downstream here.
> .../arm64/boot/dts/exynos/exynosautov920.dtsi | 1 +
> 2 files changed, 188 insertions(+)
> create mode 100644 arch/arm64/boot/dts/exynos/exynosautov920-evt2-mfc.dtsi
>
This doesn't belong to media patchset, don't combine them.
Anyway, you completely disregarded DTS coding style and how we were
Samsung DTS. Please don't send us downstream code.
I won't be reviewing this, you need to start from scratch looming at
other recent code.
Remember also about Samsung maintainer profile, although with such
completely broken and non working bindings it's pointless now - this
code couldn't even be reliably tested with them.
Best regards,
Krzysztof
On Tue, 30 Sept 2025 at 12:55, Himanshu Dewangan <h.dewangan(a)samsung.com> wrote:
>
> From: Nagaraju Siddineni <nagaraju.s(a)samsung.com>
>
> Introduce a new DT binding file for exynos-mfc
>
> Documentation/devicetree/bindings/media/samsung,exynos-mfc.yaml
> which describes the Exynos Multi‑Format Codec (MFC) IP. The schema
> covers the core node properties, required fields, and provides an
> example snippet.
>
> Signed-off-by: Himanshu Dewangan <h.dewangan(a)samsung.com>
> Signed-off-by: Nagaraju Siddineni <nagaraju.s(a)samsung.com>
> ---
> .../bindings/media/samsung,exynos-mfc.yaml | 77 +++++++++++++++++++
> MAINTAINERS | 10 +++
> 2 files changed, 87 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/media/samsung,exynos-mfc.yaml
>
> diff --git a/Documentation/devicetree/bindings/media/samsung,exynos-mfc.yaml b/Documentation/devicetree/bindings/media/samsung,exynos-mfc.yaml
> new file mode 100644
> index 000000000000..fbed987fb9cf
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/media/samsung,exynos-mfc.yaml
> @@ -0,0 +1,77 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/media/samsung,exynos-mfc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Samsung Exynos Multi Format Codec (MFC)
> +
> +maintainers:
> + - Nagaraju Siddineni <nagaraju.s(a)samsung.com>
> + - Himanshu Dewangan <h.dewangan(a)samsung.com>
> +
> +description:
> + Multi Format Codec (MFC) is the IP present in Samsung SoCs which
> + supports high resolution decoding and encoding functionalities.
> +
> +properties:
> + compatible:
> + oneOf:
> + - enum:
> + - samsung,exynos-mfc # Exynos920
> + - samsung,mfc_core0_mem # Reserved Memory
> + - samsung,mfc_core1_mem # Reserved Memory
NAK
These bindings duplicate existing ones, do not follow any existing
standards (wrong compatible) and are written completely different than
any other binding, which means you probably created big AI slop.
I'm not going to review this, it's quality is just beyond basic
standards. Sending something like this from Samsung means you do not
respect our time. You need to stay from scratch and read existing
documentation and existing bindings
I'll be organizing a mini meeting with Samsung on 13th Oct in Seoul,
feel free to join if you are around. I can explain then more why
wasting our time is making me very grumpy.
Best regards,
Krzysztof
Two patches to implement a generic framework for dma-buf to support
local private interconnects, in particular interconnects that are not
driver-private.
The interconnect support is negotiated as part of an attachment and is
not a property of the dma-buf itself. Just like pcie p2p support.
The first patch adds members to the dma_buf_attach_ops and to the
dma_buf_attachment structure. These are needed for generic check of
interconnect support, typically when an interconnect is shared between
drivers. For truly driver-private interconnects they are not
strictly needed, but still could be convenient.
The second patch implements an interconnect negotiation for xe,
without actually changing the protocol itself from pcie_p2p.
Just as an example. This patch is not intended to be merged.
Note: This RFC only deals with interconnect negotiation. The
attachment state and what data-structure to use to convey the mapping
information is not dealt with in this RFC.
v2:
- Get rid of void pointers and instead provide generic structures
that are intended to be embedded / subclassed for each interconnect
implementation.
Thomas Hellström (2):
dma-buf: Add support for private interconnects
drm/xe/dma-buf: Add generic interconnect support framework
drivers/gpu/drm/xe/tests/xe_dma_buf.c | 12 ++---
drivers/gpu/drm/xe/xe_dma_buf.c | 73 ++++++++++++++++++++++++---
drivers/gpu/drm/xe/xe_dma_buf.h | 1 -
drivers/gpu/drm/xe/xe_interconnect.h | 31 ++++++++++++
include/linux/dma-buf.h | 51 +++++++++++++++++++
5 files changed, 155 insertions(+), 13 deletions(-)
create mode 100644 drivers/gpu/drm/xe/xe_interconnect.h
--
2.51.0
Changelog:
v2:
* Added extra patch which adds new CONFIG, so next patches can reuse it.
* Squashed "PCI/P2PDMA: Remove redundant bus_offset from map state"
into the other patch.
* Fixed revoke calls to be aligned with true->false semantics.
* Extended p2pdma_providers to be per-BAR and not global to whole
device.
* Fixed possible race between dmabuf states and revoke.
* Moved revoke to PCI BAR zap block.
v1: https://lore.kernel.org/all/cover.1754311439.git.leon@kernel.org
* Changed commit messages.
* Reused DMA_ATTR_MMIO attribute.
* Returned support for multiple DMA ranges per-dMABUF.
v0: https://lore.kernel.org/all/cover.1753274085.git.leonro@nvidia.com
---------------------------------------------------------------------------
Based on "[PATCH v6 00/16] dma-mapping: migrate to physical address-based API"
https://lore.kernel.org/all/cover.1757423202.git.leonro@nvidia.com/ series.
---------------------------------------------------------------------------
This series extends the VFIO PCI subsystem to support exporting MMIO
regions from PCI device BARs as dma-buf objects, enabling safe sharing of
non-struct page memory with controlled lifetime management. This allows RDMA
and other subsystems to import dma-buf FDs and build them into memory regions
for PCI P2P operations.
The series supports a use case for SPDK where a NVMe device will be
owned by SPDK through VFIO but interacting with a RDMA device. The RDMA
device may directly access the NVMe CMB or directly manipulate the NVMe
device's doorbell using PCI P2P.
However, as a general mechanism, it can support many other scenarios with
VFIO. This dmabuf approach can be usable by iommufd as well for generic
and safe P2P mappings.
In addition to the SPDK use-case mentioned above, the capability added
in this patch series can also be useful when a buffer (located in device
memory such as VRAM) needs to be shared between any two dGPU devices or
instances (assuming one of them is bound to VFIO PCI) as long as they
are P2P DMA compatible.
The implementation provides a revocable attachment mechanism using dma-buf
move operations. MMIO regions are normally pinned as BARs don't change
physical addresses, but access is revoked when the VFIO device is closed
or a PCI reset is issued. This ensures kernel self-defense against
potentially hostile userspace.
The series includes significant refactoring of the PCI P2PDMA subsystem
to separate core P2P functionality from memory allocation features,
making it more modular and suitable for VFIO use cases that don't need
struct page support.
-----------------------------------------------------------------------
The series is based originally on
https://lore.kernel.org/all/20250307052248.405803-1-vivek.kasireddy@intel.c…
but heavily rewritten to be based on DMA physical API.
-----------------------------------------------------------------------
The WIP branch can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/log/?h=…
Thanks
Leon Romanovsky (8):
PCI/P2PDMA: Separate the mmap() support from the core logic
PCI/P2PDMA: Simplify bus address mapping API
PCI/P2PDMA: Refactor to separate core P2P functionality from memory
allocation
PCI/P2PDMA: Export pci_p2pdma_map_type() function
types: move phys_vec definition to common header
vfio/pci: Add dma-buf export config for MMIO regions
vfio/pci: Enable peer-to-peer DMA transactions by default
vfio/pci: Add dma-buf export support for MMIO regions
:wqa
Vivek Kasireddy (2):
vfio: Export vfio device get and put registration helpers
vfio/pci: Share the core device pointer while invoking feature
functions
block/blk-mq-dma.c | 7 +-
drivers/iommu/dma-iommu.c | 4 +-
drivers/pci/p2pdma.c | 165 ++++++++----
drivers/vfio/pci/Kconfig | 20 ++
drivers/vfio/pci/Makefile | 2 +
drivers/vfio/pci/vfio_pci_config.c | 22 +-
drivers/vfio/pci/vfio_pci_core.c | 59 +++--
drivers/vfio/pci/vfio_pci_dmabuf.c | 398 +++++++++++++++++++++++++++++
drivers/vfio/pci/vfio_pci_priv.h | 23 ++
drivers/vfio/vfio_main.c | 2 +
include/linux/pci-p2pdma.h | 114 +++++----
include/linux/types.h | 5 +
include/linux/vfio.h | 2 +
include/linux/vfio_pci_core.h | 4 +
include/uapi/linux/vfio.h | 25 ++
kernel/dma/direct.c | 4 +-
mm/hmm.c | 2 +-
17 files changed, 734 insertions(+), 124 deletions(-)
create mode 100644 drivers/vfio/pci/vfio_pci_dmabuf.c
--
2.51.0
The Arm Ethos-U65/85 NPUs are designed for edge AI inference
applications[0].
The driver works with Mesa Teflon. A merge request for Ethos support is
here[1]. The UAPI should also be compatible with the downstream (open
source) driver stack[2] and Vela compiler though that has not been
implemented.
Testing so far has been on i.MX93 boards with Ethos-U65 and a FVP model
with Ethos-U85. More work is needed in mesa for handling U85 command
stream differences, but that doesn't affect the UABI.
A git tree is here[3].
Rob
[0] https://www.arm.com/products/silicon-ip-cpu?families=ethos%20npus
[1] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36699/
[2] https://gitlab.arm.com/artificial-intelligence/ethos-u/
[3] git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git ethos-v3
Signed-off-by: Rob Herring (Arm) <robh(a)kernel.org>
---
Changes in v3:
- Rework and improve job submit validation
- Rename ethos to ethosu. There was an Ethos-Nxx that's unrelated.
- Add missing init for sched_lock mutex
- Drop some prints to debug level
- Fix i.MX93 SRAM accesses (AXI config)
- Add U85 AXI configuration and test on FVP with U85
- Print the current cmd value on timeout
- Link to v2: https://lore.kernel.org/r/20250811-ethos-v2-0-a219fc52a95b@kernel.org
Changes in v2:
- Rebase on v6.17-rc1 adapting to scheduler changes
- scheduler: Drop the reset workqueue. According to the scheduler docs,
we don't need it since we have a single h/w queue.
- scheduler: Rework the timeout handling to continue running if we are
making progress. Fixes timeouts on larger jobs.
- Reset the NPU on resume so it's in a known state
- Add error handling on clk_get() calls
- Fix drm_mm splat on module unload. We were missing a put on the
cmdstream BO in the scheduler clean-up.
- Fix 0-day report needing explicit bitfield.h include
- Link to v1: https://lore.kernel.org/r/20250722-ethos-v1-0-cc1c5a0cbbfb@kernel.org
---
Rob Herring (Arm) (2):
dt-bindings: npu: Add Arm Ethos-U65/U85
accel: Add Arm Ethos-U NPU driver
.../devicetree/bindings/npu/arm,ethos.yaml | 79 +++
MAINTAINERS | 9 +
drivers/accel/Kconfig | 1 +
drivers/accel/Makefile | 1 +
drivers/accel/ethosu/Kconfig | 10 +
drivers/accel/ethosu/Makefile | 4 +
drivers/accel/ethosu/ethosu_device.h | 187 ++++++
drivers/accel/ethosu/ethosu_drv.c | 430 +++++++++++++
drivers/accel/ethosu/ethosu_drv.h | 15 +
drivers/accel/ethosu/ethosu_gem.c | 709 +++++++++++++++++++++
drivers/accel/ethosu/ethosu_gem.h | 46 ++
drivers/accel/ethosu/ethosu_job.c | 543 ++++++++++++++++
drivers/accel/ethosu/ethosu_job.h | 41 ++
include/uapi/drm/ethosu_accel.h | 262 ++++++++
14 files changed, 2337 insertions(+)
---
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
change-id: 20250715-ethos-3fdd39ef6f19
Best regards,
--
Rob Herring (Arm) <robh(a)kernel.org>
Two patches to implement a generic framework for dma-buf to support
local private interconnects.
The interconnect support is negotiated as part of an attachment and is
not a property of the dma-buf itself. Just like pcie p2p support.
The first patch adds members to the dma_buf_attach_ops and to the
dma_buf_attachment structure. These are needed for generic check of
interconnect support, typically when an interconnect is shared between
drivers. For truly driver-private interconnects they are not
strictly needed, but still could be convenient.
The second patch implements an interconnect negotiation for xe,
without actually changing the protocol itself from pcie_p2p.
Just as an example.
Thomas Hellström (2):
dma-buf: Add support for private interconnects
drm/xe/dma-buf: Add generic interconnect support framework
drivers/gpu/drm/xe/tests/xe_dma_buf.c | 12 +++---
drivers/gpu/drm/xe/xe_dma_buf.c | 54 +++++++++++++++++++++++----
drivers/gpu/drm/xe/xe_dma_buf.h | 1 -
drivers/gpu/drm/xe/xe_interconnect.h | 22 +++++++++++
include/linux/dma-buf.h | 15 ++++++++
5 files changed, 90 insertions(+), 14 deletions(-)
create mode 100644 drivers/gpu/drm/xe/xe_interconnect.h
--
2.51.0