MI GFX Debug SOP¶
REVISION HISTORY¶
| Revision No. | Description |
Date |
|---|---|---|
| 1.0 | 12/05/2024 |
Preface¶
This document is intended for FAE and software development personnel. Its purpose is to introduce preliminary troubleshooting methods for MI GFX-related issues encountered by customers during the development process. Only after determining that the issue is related to Sgs SDK should relevant information be provided to FAE for analysis.
1. GFX Processing Effect Abnormal/Poor Quality¶
1.1 When GFX processing effect abnormalities are suspected:¶
- First, verify that the actual content of src/dst buf matches the parameters passed to MI_GFX by the application (width/height/stride/color format).
- Second, verify that other effect parameters are configured correctly.
- If parameters and actual image content are confirmed to match, dump the src/dst buf passed to MI_GFX as well as the processed dst buf to confirm whether the original src buf and dst buf exhibit abnormalities.
- If no issues are identified during verification, provide the API parameters, src buf, and dst buf to FAE for analysis.
- For example, when using MI_GFX_BitBlit for bitmap transfer, src is typically the image to be processed, and dst is typically the Framebuffer.
- Verify the src and dst buffers, specifically whether the phyAddr parameter is mapped to physical addresses.
- Verify that src width/height/stride/color format correspond one-to-one with the image to be processed. Note that stride calculation methods vary according to different formats.
- Verify that dst width/height/stride/color format correspond one-to-one with the Framebuffer. Note whether the Framebuffer has a synchronization mechanism to prevent modification during rotation.
- Verify whether the operation area specified by pstSrcRect and pstDstRect exceeds the total resolution of src or dst.
- Verify whether the parameters defined in pstOpt for BitBlit operation are correct. For 90-degree or 270-degree rotation, only square data can be rotated. Refer to the detailsLimitation: Only Square Data Can Be Rotated at 90 and 270 Degrees in GFX.
- If no issues are identified during verification, dump the src/dst buf by mapping physical addresses to corresponding virtual addresses through local file writing, and compare to confirm whether the original src buf and dst buf exhibit abnormalities.
2. FB Display Abnormalities After GFX Operation Overlay¶
When display abnormalities occur after using GFX-accelerated graphics operations to overlay onto FB (including FB flickering, FB artifacts, FB misalignment, etc.), it is highly probable that the GFX bandwidth (BW) occupation is excessively high, causing the display GOP to fail to acquire sufficient BW and unable to read a complete display buffer from DDR in a timely manner, resulting in various FB display anomalies. Attempt to remove GFX-accelerated graphics operations and observe whether FB display abnormalities persist. If FB display abnormalities still occur, contact FAE to clarify issues inherent to FB itself. If FB display becomes normal after removing GFX operations, contact FAE to assist in adjusting module BW priority (configurable via miu module) or reducing resolution to resolve the issue.
3. MMU Memory Violation/MIU Protection Issues¶
- Phenomena
When the following log appears, it indicates that an MMU memory violation has occurred:
[MI WRN] MI_SYS_Mma_MmuCallback[227]: [MI_SYS_Mma_MmuCallback] Status=0x2, PhyAddr=0x40070000, ClientId=0x3A,Name=GE IsWrite=0
- Status
- The reason for triggering this callback. The current value is 0x2, indicating an illegal read/write operation.
-
PhyAddr
- The starting address of the entry that triggered the access exception. The current value is 0x40070000.
-
ClientId
- Module ID. The current value is 0x3A.
-
Name
- Module name. The current value is GE.
-
IsWrite
- Read/write operation. 1 indicates write, 0 indicates read. The current value is 0, indicating a read operation.
When the following log appears, it indicates that MIU protection has occurred:
[HAL MIU ERR] [hal_miu_protect_show_hit_info@1301] [PROTECT] IP hit protect address.
Hit block 32, address: 0x400800000<->0x400802000, whitelist: [CPU_CA55, ]
Hit count: 1
Hit IP : 0x3A - GE
Hit MMU address: 0x400800000<->0x40080000f
-
Analysis
-
Confirm whether the address violated by MMU is within the virtual address range. Since MI_GFX uses physical addresses for both internally used buffers and src/dst buf addresses passed via API parameters, when the address violated by GE is within the virtual address range, the application must verify whether the src/dst addresses passed to MI_GFX via API are virtual addresses.
For example: MI_S32 MI_GFX_BitBlit(MI_GFX_DEV GfxDevId, MI_GFX_Surface_t *pstSrc, MI_GFX_Rect_t *pstSrcRect, MI_GFX_Surface_t *pstDst, MI_GFX_Rect_t *pstDstRect, MI_GFX_Opt_t *pstOpt, MI_U16 *pu16Fence);
Verify whether u32PhyAddr of pstSrc corresponds to the physical address mapped from the virtual address of the image to be rotated, and whether u32PhyAddr of pstDst corresponds to the physical address mapped from FB. - Confirm that the address violated by MMU is a physical address. If the read violation address is within 16 bytes of the end of the src/dst buf passed by the application, it can be ignored, as the GE hardware performs prefetch operations to improve performance. - If neither of the above conditions applies, verify that the actual size of the src/dst buf passed by the application does not match the parameters set for MI_GFX (width/height/stride/color format).
4. System Crash During Forced Application Exit with Stack Trace Showing Frequent MI_GFX Interrupt Triggers¶
- Execute cat /proc/interrupts to view interrupt information before and after exit, and determine whether the GE_ISR count has increased significantly.
- Verify whether MI_SYS_Exit() is called last.
- Verify whether InitDev and DeInitDev of MI modules are not used in pairs, or whether Init is incorrectly paired with DeInitDev.
- If no issues are identified during the above verification, capture stack trace information and information from each MI module node under /proc to provide to FAE for analysis.
5. Limitation: Only Square Data Can Be Rotated at 90 and 270 Degrees in GFX¶
- When using MI_GFX_BitBlit for image rotation, rectangular image data can be rotated directly at 0 and 180 degrees.
- When rotating at 90 and 270 degrees, direct rotation of rectangular data will result in image display abnormalities. Due to hardware limitations, only square data can be rotated. To rotate rectangular data, the third and fifth parameters (MI_GFX_Rect_t) must divide the rectangle into squares, then call MI_GFX_BitBlit for rotation. Contact FAE to provide an MI_GFX rotation demo for reference.