Edit online

MPP 配置

MPP 包括以下配置内容:
  1. 内核配置
    MPP 依赖 VE 驱动,MPP Heap 内存管理框架,请在 MPP 编译前进行配置。
    1. MPP Heap

      ArtInChip 平台使用 DMA-BUF 来实现多媒体模块间的 buffer 共享。对于 DMA-BUF,Kernel 提供 System Heap 和 CMA Heap 两个 exporter。 前者直接申请匿名页面,后者则在 CMA 内存中申请页面。

      虽然通过这两个 exporter 都能拿到足够的物理连续内存,但它们在系统长时间运行后,都面临内存碎片化问题。特别是在 64 M 小内存方案中,碎片化问题尤为严重。

      为了 解决内存碎片化 的问题,ArtInChip 基于 CMA Heap 进行封装,提供一个私有的 exporter ,即 MPP Heap

      在 luban 根目录下执行 make kernel-menuconfig,进入 kernel 的功能配置,按如下选择:
      Linux
          Device Drivers  --->
              DMABUF options --->
                  [*] Explicit Synchronization Framework
                  [*]   Sync File Validation Framework
                  [*] userspace dmabuf misc driver
                  [ ] Move notify between drivers (EXPERIMENTAL)
                  < > Selftests for the dma-buf interfaces
                  [*] DMA-BUF Userland Memory Heaps  --->
                      [ ]   DMA-BUF System Heap
                      [*]   DMA-BUF CMA Heap
                      [*]   DMA-BUF MPP Heap
      MPP Heap 在 CMA 内存中申请一大块物理连续内存,使用 genpool 算法进行管理,提供给 MPP 中间件专用,其大小配置:
      Linux
          Library routines  --->
              [*] DMA Contiguous Memory Allocator
              [ ]   Enable separate DMA Contiguous Memory Area for each NUMA Node
              *** Default contiguous memory area size: ***
              (16)  Size in Mega Bytes
              (8)   Size in Mega Bytes for MPP Heap

      在上述例子中,系统预留了 16M CMA 内存,MPP Heap 再从 16M CMA 内存中申请 8M。

      因为 MPP Heap 的内存是从 CMA 中申请的,前者是后者的子集,所以 MPP Heap 的 size 要小于 CMA 的 size。

      注:

      为了兼顾系统中其他需要物理连续内存的模块,不能将 CMA 内存全部分配给 MPP Heap,分配数值设置可参考 。

    2. VE 驱动

      关于 VE 模块驱动配置,详见 VE 配置

  2. DTS 参数配置

    关于 VE 模块 DTS 配置,详见 VE 配置