MI GFX Debug SOP
REVISION HISTORY¶
| Revision No. | Description |
Date |
|---|---|---|
| 1.0 | 12/05/2024 |
Introduction¶
This document is written for FAE and software development personnel, aiming to introduce how to conduct preliminary troubleshooting when customers encounter MI GFX-related issues during the development process, and to provide relevant information to FAE for analysis after confirming it is a Sigmastar SDK issue.
1. Abnormal GFX Processing Effects/Poor Effects¶
1.1 When suspecting abnormal GFX processing effects:¶
- First, check whether the actual content of the src/dst buffers matches the parameters passed to MI_GFX by the APP (width/height/stride/color format).
- Next, check whether other effect parameters are configured correctly.
- If the parameters and the actual content of the images match, dump the src/dst buffers passed to MI_GFX and the processed dst buffer to confirm whether there are abnormalities in the original src and dst buffers.
- If no issues are found, please provide the API parameters, src buffer, and dst buffer to FAE for analysis.
- For example, when using MI_GFX_BitBlit for bitmap transfer, src is usually the image to be processed, and dst is usually the Framebuffer.
- Check whether the phyAddr parameter of src and dst buffers is mapped to physical addresses.
- Check whether the width/height/stride/color format of src corresponds one-to-one with the image to be processed, noting that the calculation method for stride varies by format.
- Check whether the width/height/stride/color format of dst corresponds one-to-one with the Framebuffer, and ensure that the Framebuffer has a synchronization mechanism to prevent modification during rotation.
- Check whether the operation area specified by pstSrcRect and pstDstRect exceeds the total resolution of src or dst.
- Check whether the parameters defined in pstOpt for the BitBlit operation are correct. If rotating 90 or 270 degrees, it can only be cut into square shapes for rotation; refer to the fifth point of this document for details.
- If no issues are found, dump the physical addresses of the src/dst buffers mapped to their corresponding virtual addresses by writing to a local file for comparison, confirming whether there are abnormalities in the original src and dst buffers.
2. FB Display Abnormalities After GFX Overlay Operations¶
When using GFX to accelerate graphic operations onto the FB results in display abnormalities (including FB flickering/FB artifacts/FB misalignment, etc.), it is likely due to high BW usage by GFX, causing the disp gop to be unable to obtain BW and unable to read a complete display buffer from DDR in time, resulting in various FB display anomalies. Try removing the GFX accelerated graphic operation to see if the FB still displays abnormally. If the FB still displays abnormally, consult FAE to clarify any issues with the FB itself. If removing the GFX operation resolves the FB display issue, seek FAE's assistance to adjust the BW priority of the module (which can be set in the miu module) or reduce the resolution to resolve the issue.
3. MMU Memory Violation Issues/MIU Protect Issues¶
-
Symptoms
The following log indicates a memory violation by the MMU:
[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, with the current value being 0x2, indicating an illegal read/write operation.
-
PhyAddr
- The starting address of the entry that triggered the exception, with the current value being 0x40070000.
-
ClientId
- Module ID, with the current value being 0x3A.
-
Name
- Module name, with the current value being GE.
-
IsWrite
- Read/write operation, 1 indicates write, 0 indicates read, with the current value being 0, indicating a read operation.
The following log indicates a MIU protect issue:
[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
- Status
-
Analysis
-
Confirm whether the address violated by the MMU is within the virtual address range. Since MI_GFX uses physical addresses for both internally used buffers and API parameters for src/dst buffer addresses, if the address violated by GE is within the virtual address range, the APP needs to check whether the src/dst addresses passed to MI_GFX 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);
Check whether the u32PhyAddr of pstSrc corresponds to the physical address mapped from the required rotated image's virtual address, and whether the u32PhyAddr of pstDst corresponds to the physical address mapped from the FB. - Confirm whether the address violated by the MMU is a physical address. If the read address violated is within the last 16 bytes of the src/dst buffer passed by the APP, it can be ignored, as GE hardware performs pre-read operations to enhance performance. - If neither of the above two situations applies, check whether the actual size of the src/dst buffers passed by the APP matches the parameters set for MI_GFX (width/height/stride/color format).
4. APP Crashes on Forced Exit, Stack Information Shows Frequent MI_GFX Interrupts¶
- Use
cat /proc/interruptsto check interrupt information before and after the exit to determine whether the number of GE_ISR has significantly increased. - Check whether MI_SYS_Exit() is called last.
- Check whether the MI module's InitDev and DeInitDev are not paired correctly or whether Init is mismatched with DeInitDev.
- If no issues are found in the above checks, capture stack information and provide the MI module's node information from
cat /procto FAE for analysis.
5. GFX Rotation of 90 and 270 Degrees Limited to Square Data¶
- When using MI_GFX_BitBlit for image rotation, rotating 0 and 180 degrees can directly rotate rectangular image data.
- Rotating 90 and 270 degrees directly on rectangular data will result in image display anomalies. Due to hardware limitations, only square data can be rotated. If rectangular data needs to be rotated, the third and fifth parameters MI_GFX_Rect_t need to be cut into squares before calling MI_GFX_BitBlit for rotation. Contact FAE for a MI_GFX rotation demo for reference.