Boot animation through DRM in Linux

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Boot animation through DRM in Linux

Boot animation through DRM in Linux

This is simple known-how for how to implement "boot animation" with DRM under i.MX8/X + Linux:

 

Code to refer to:
=========================================================================
1. kmscube:
Either open source one or the customized on for i.MX will be OK:
https://cgit.freedesktop.org/mesa/kmscube/
https://source.codeaurora.org/external/imx/kmscube-imx/
2. Android display HAL:
KmsDisplay.cpp

 

Known-how:
=========================================================================
1. Only one application can grab the master role of the DRM device. If need to control DRM from two applicaiton simultanously, possible solution:

    A, Use "controlD" node instead of "card" node in /dev/dri/. This requires L4.14 or before. This
device node was removed by two commits in L4.14.x:
          8a357d10043c75e980e7fcdb60d2b913491564af
          6449b088dd51dd5aa6b38455888bbf538d21f2fc
    Can be brought back by reverting these two commits in L4.14.98.
    B, Use framebuffer emulator to emulate a FB device (/dev/fb0). (not recommended due to lack of vsync).


2. Some kernel functions will re-config the DRM device during boot. This will cause display abnormal after user application has configured the DRM device. Better to disable these kernel features:
      CONFIG_DRM_FBDEV_EMULATION
      CONFIG_FRAMEBUFFER_CONSOLE


3. Use atomic mode of KMS API instead of legacy mode for any dynamically screen drawing application, such as video, game and etc. Atomic mode will have much better performance compare to legacy mode. The kmscube has sample code for both mode.


4. Better to do commit checking before doing any real commit, especially when doing display during boot. Sometimes some internal component in DRM is not fully ready after card device is present.
      DRM_MODE_ATOMIC_ALLOW_MODESET


5. If video playback will be used, some points to remind:
    a, Sample code for direct video decoding (in unit-test): imx-test/test/mxc_v4l2_vpu_test/
    b, VPU in i.MX8/X only support tiled NV12 output and it has pixel alignment requirement (128).
Need to use CPU or G2D to do un-tile, CSC and cropping. Sample code:
<android>/vendor/nxp/fsl_imx_omx/OpenMAXIL/src/component/v4l2_common/G2dProcess.cpp
If using G2D under Linux, it will support un-tile directly (through OpenCL internally).

No ratings
Version history
Last update:
‎04-17-2022 07:29 PM
Updated by: