|
| 1 | +# DMA-BUF Configuration Validation Test |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This test validates the DMA-BUF subsystem configuration on Qualcomm platforms, including kernel configuration, device tree setup, and system interfaces. |
| 6 | + |
| 7 | +## Test Coverage |
| 8 | + |
| 9 | +### 1. Kernel Configuration Validation |
| 10 | +**Mandatory**: |
| 11 | +- `CONFIG_DMA_SHARED_BUFFER CONFIG_DMABUF_HEAPS CONFIG_DMABUF_HEAPS_SYSTEM` - Core DMA-BUF support |
| 12 | + |
| 13 | +**Optional but Recommended**: |
| 14 | +- `CONFIG_DMA_HEAP` - Modern DMA heap interface |
| 15 | +- `CONFIG_DMA_CMA` - Contiguous Memory Allocator |
| 16 | +- `CONFIG_TEE_DMABUF_HEAPS` |
| 17 | +- `CONFIG_HAS_DMA` |
| 18 | + |
| 19 | +### 2. Device Tree Validation |
| 20 | +- Reserved memory nodes (`/proc/device-tree/reserved-memory`) - informational |
| 21 | +- Platform-specific DMA heap nodes |
| 22 | +- Memory region sizes and configurations |
| 23 | + |
| 24 | +## Usage |
| 25 | + |
| 26 | +### Run directly: |
| 27 | +```bash |
| 28 | +cd /path/to/Runner/suites/Kernel/Baseport/dmabuf |
| 29 | +./run.sh |
| 30 | +``` |
| 31 | + |
| 32 | +### Run via test runner: |
| 33 | +```bash |
| 34 | +cd /path/to/Runner |
| 35 | +./run-test.sh dmabuf |
| 36 | +``` |
| 37 | + |
| 38 | +## Test Results |
| 39 | + |
| 40 | +Generates: |
| 41 | +- `dmabuf.res` - Final result (PASS/FAIL) |
| 42 | +- Console output with detailed validation steps |
| 43 | + |
| 44 | +## Prerequisites |
| 45 | + |
| 46 | +### Required: |
| 47 | +- `CONFIG_DMA_SHARED_BUFFER=y` in kernel config |
| 48 | + |
| 49 | + |
| 50 | +## Expected Output |
| 51 | + |
| 52 | +``` |
| 53 | +[INFO] 2026-03-23 12:39:05 - ================================================================================ |
| 54 | +[INFO] 2026-03-23 12:39:05 - ============ Starting dmabuf Testcase ======================================= |
| 55 | +[INFO] 2026-03-23 12:39:05 - ================================================================================ |
| 56 | +[INFO] 2026-03-23 12:39:05 - === Kernel Configuration Validation === |
| 57 | +[PASS] 2026-03-23 12:39:05 - Kernel config CONFIG_DMA_SHARED_BUFFER is enabled |
| 58 | +[PASS] 2026-03-23 12:39:05 - Kernel config CONFIG_DMABUF_HEAPS is enabled |
| 59 | +[PASS] 2026-03-23 12:39:06 - Kernel config CONFIG_DMABUF_HEAPS_SYSTEM is enabled |
| 60 | +[PASS] 2026-03-23 12:39:06 - Core DMA-BUF configs available |
| 61 | +[INFO] 2026-03-23 12:39:06 - Checking optional DMA-BUF configurations... |
| 62 | +[PASS] 2026-03-23 12:39:06 - Kernel config CONFIG_TEE_DMABUF_HEAPS is enabled |
| 63 | +[PASS] 2026-03-23 12:39:06 - CONFIG_TEE_DMABUF_HEAPS: enabled |
| 64 | +[PASS] 2026-03-23 12:39:06 - Kernel config CONFIG_HAS_DMA is enabled |
| 65 | +[PASS] 2026-03-23 12:39:06 - CONFIG_HAS_DMA: enabled |
| 66 | +[WARN] 2026-03-23 12:39:06 - Kernel config CONFIG_DMA_HEAP is missing or not enabled |
| 67 | +[WARN] 2026-03-23 12:39:06 - CONFIG_DMA_HEAP: not enabled (optional) |
| 68 | +[WARN] 2026-03-23 12:39:06 - Kernel config CONFIG_DMA_CMA is missing or not enabled |
| 69 | +[WARN] 2026-03-23 12:39:06 - CONFIG_DMA_CMA: not enabled (optional) |
| 70 | +[INFO] 2026-03-23 12:39:06 - === Device Tree Validation === |
| 71 | +[INFO] 2026-03-23 12:39:06 - Found reserved-memory node |
| 72 | +[INFO] 2026-03-23 12:39:06 - Region: adsp-region@95c00000 |
| 73 | +[INFO] 2026-03-23 12:39:06 - Region: adsp-rpc-remote-heap-region@94a00000 |
| 74 | +[INFO] 2026-03-23 12:39:06 - Region: aop-cmd-db-region@90860000 |
| 75 | +[INFO] 2026-03-23 12:39:06 - Region: aop-image-region@90800000 |
| 76 | +[INFO] 2026-03-23 12:39:06 - Region: camera-region@95200000 |
| 77 | +[INFO] 2026-03-23 12:39:06 - Region: cdsp-region@99980000 |
| 78 | +[INFO] 2026-03-23 12:39:06 - Region: cvp-region@9b782000 |
| 79 | +[INFO] 2026-03-23 12:39:06 - Region: gpdsp-region@97b00000 |
| 80 | +[INFO] 2026-03-23 12:39:06 - Region: gpu-microcode-region@9b780000 |
| 81 | +[INFO] 2026-03-23 12:39:06 - Region: lpass-machine-learning-region@93b00000 |
| 82 | +[INFO] 2026-03-23 12:39:06 - Region: q6-adsp-dtb-region@97a00000 |
| 83 | +[INFO] 2026-03-23 12:39:06 - Region: q6-cdsp-dtb-region@99900000 |
| 84 | +[INFO] 2026-03-23 12:39:06 - Region: q6-gpdsp-dtb-region@97a80000 |
| 85 | +[INFO] 2026-03-23 12:39:06 - Region: smem@90900000 |
| 86 | +[INFO] 2026-03-23 12:39:06 - Region: video-region@9be82000 |
| 87 | +[INFO] 2026-03-23 12:39:06 - /proc/device-tree/soc*/dma* /proc/device-tree/soc*/qcom,ion* /proc/device-tree/ion* |
| 88 | +[INFO] 2026-03-23 12:39:06 - /proc/device-tree/soc@0/dma-controller@1dc4000 |
| 89 | +[PASS] 2026-03-23 12:39:06 - Device tree node exists: /proc/device-tree/soc@0/dma-controller@1dc4000 |
| 90 | +[INFO] 2026-03-23 12:39:06 - /proc/device-tree/soc@0/dma-controller@900000 |
| 91 | +[PASS] 2026-03-23 12:39:06 - Device tree node exists: /proc/device-tree/soc@0/dma-controller@900000 |
| 92 | +[INFO] 2026-03-23 12:39:06 - /proc/device-tree/soc@0/dma-controller@a00000 |
| 93 | +[PASS] 2026-03-23 12:39:06 - Device tree node exists: /proc/device-tree/soc@0/dma-controller@a00000 |
| 94 | +[INFO] 2026-03-23 12:39:06 - /proc/device-tree/soc@0/dma-controller@b00000 |
| 95 | +[PASS] 2026-03-23 12:39:06 - Device tree node exists: /proc/device-tree/soc@0/dma-controller@b00000 |
| 96 | +[INFO] 2026-03-23 12:39:06 - /proc/device-tree/soc*/qcom,ion* |
| 97 | +[INFO] 2026-03-23 12:39:06 - /proc/device-tree/ion* |
| 98 | +[PASS] 2026-03-23 12:39:06 - At least one node was found. |
| 99 | +[PASS] 2026-03-23 12:39:06 - Device tree validation passed (found 1 relevant nodes) |
| 100 | +[INFO] 2026-03-23 12:39:06 - Found DMA heap device directory: /dev/dma_heap |
| 101 | +[PASS] 2026-03-23 12:39:06 - Available heap: system |
| 102 | +[PASS] 2026-03-23 12:39:06 - Total heaps found: 1 |
| 103 | +[INFO] 2026-03-23 12:39:06 - DMA-BUF buffer information: |
| 104 | +[INFO] 2026-03-23 12:39:06 - Total DMA-BUF buffers: 1 |
| 105 | +[PASS] 2026-03-23 12:39:06 - dmabuf : Test Passed |
| 106 | +[INFO] 2026-03-23 12:39:06 - -------------------Completed dmabuf Testcase---------------------------- |
| 107 | +``` |
| 108 | + |
| 109 | +## License |
| 110 | + |
| 111 | +Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. |
| 112 | +SPDX-License-Identifier: BSD-3-Clause |
0 commit comments