LIBSDL2 + DirectFB + i.MX 6 - только программный блатинг? - PullRequest
1 голос
/ 01 апреля 2020

В данный момент мы разрабатываем приложение SDL2 на встроенной плате (i.MX 6) с DirectFB. Наш LinuxOS генерируется через YOCTO. Само приложение работает нормально, бит на SDL_RenderPresent( renderer_ ), кажется, работает только программный блиттинг, который поднимает процессор до предела.

  • Окно (256 x 128 px): 60 FPS - ~ 20% в одном ядре
  • Окно (1280 x 1024 px): 45 FPS - 100% в одном ядре

При добавлении no-software в DFBARGS загрузка процессора снижается до ~ 6% (что приемлемо), но после этого на экране больше ничего не видно. Это потому, что я думаю, что в этом случае SDL2 / DirectFB использует только программный блиттинг. Я забыл флаг при инициализации?

Запуск приложения qt5 с разрешением 1280x1024 с 60FPS занимает ~ 3-6% использования ЦП одним ядром.

Создание объектов

window_ = SDL_CreateWindow( "", 0, 0, 256, 128, 0 );

renderer_ = SDL_CreateRenderer( window_, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC );

Некоторые выходы из DirectFB

fbset:

mode "1280x1024-0"
        # D: 0.000 MHz, H: 0.000 kHz, V: 0.000 Hz
        geometry 1280 1024 1280 1024 32
        timings 0 0 0 0 0 0 0
        accel true
        rgba 8/16,8/8,8/0,0/0
endmode

dfbdump:

(*) Direct/Thread: Started 'SigHandler' (411) [CRITICAL - OTHER/0] <8388608>...

   ~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.7.7 |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2012-2015  DirectFB integrated media GmbH
        (c) 2001-2015  The world wide DirectFB Open Source Community
        (c) 2000-2004  Convergence (integrated media) GmbH
      ----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2020-04-01 09:36)
(*) Direct/Memcpy: Using libc memcpy()
(*) Direct/Thread: Started 'Fusion Dispatch' (412) [MESSAGING - OTHER/0] <8388608>...
(*) Direct/Thread: Started 'VT Switcher' (415) [CRITICAL - OTHER/0] <8388608>...
(*) Direct/Thread: Started 'VT Flusher' (416) [DEFAULT - OTHER/0] <8388608>...
(*) DRMKMS/Init: using device /dev/dri/card0 (default)
(*) Direct/Thread: Started 'DRMKMS/Buffer' (417) [CRITICAL - OTHER/0] <8388608>...
(*) DirectFB/Graphics: nsc NSC GX1/GX2 driver version 1.1 (NSC)
(*) DirectFB/DRMKMS: Got 1 connectors, 1 encoders
(*) DirectFB/DRMKMS: found connected connector id 38.
(*) DirectFB/DRMKMS: connector 38 is already bound to encoder 37.
(*) DirectFB/DRMKMS: encoder 37 is already bound to ctrc 28.
(*) DirectFB/DRMKMS: Default mode is 1280x1024, we have 16 modes in total
(*) DirectFB/DRMKMS: supported properties for layer id 29
(*) DirectFB/DRMKMS: supported properties for layer id 34
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
(*) Direct/Thread: Started 'Genefx' (418) [DEFAULT - OTHER/0] <8388608>...
Dependent NSC Kernel FrameBuffer driver version is 2.7.7 or later

DirectFB uptime: 01:02:30

-----------------------------[ Surfaces ]--------------------------------------------
Reference   FID  . Refs  Width Height  Format     ID     Video   System  Capabilities
-------------------------------------------------------------------------------------
N/A              :   3   1280 x 1024       ARGB     1  10240k       0k   video only   double
                                                       ------   ------
                                                       10240k       0k   -> 10240k total

----------------------------------[ Contexts of Layer 0 ]----------------------------------------
Reference   FID  . Refs  Width Height Format   Location on screen  Regions  Active  Info    Level
-------------------------------------------------------------------------------------------------
N/A              :   2   1280 x 1024  ARGB     0.0, 0.0 -> 1.0, 1.0    1     (*)    SHARED   N/A
 (!!!)  *** UNIMPLEMENTED [fusion_dispatch] *** [../../../DirectFB-1.7.7/lib/fusion/fusion.c:3947]

dfbinfo:

(*) Direct/Thread: Started 'SigHandler' (427) [CRITICAL - OTHER/0] <8388608>...

   ~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.7.7 |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2012-2015  DirectFB integrated media GmbH
        (c) 2001-2015  The world wide DirectFB Open Source Community
        (c) 2000-2004  Convergence (integrated media) GmbH
      ----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2020-04-01 09:36)
(*) Direct/Memcpy: Using libc memcpy()
(*) Direct/Thread: Started 'Fusion Dispatch' (428) [MESSAGING - OTHER/0] <8388608>...
(*) Direct/Thread: Started 'VT Switcher' (431) [CRITICAL - OTHER/0] <8388608>...
(*) Direct/Thread: Started 'VT Flusher' (432) [DEFAULT - OTHER/0] <8388608>...
(*) DRMKMS/Init: using device /dev/dri/card0 (default)
(*) Direct/Thread: Started 'DRMKMS/Buffer' (433) [CRITICAL - OTHER/0] <8388608>...
Dependent NSC Kernel FrameBuffer driver version is 2.7.7 or later
(*) DirectFB/Graphics: nsc NSC GX1/GX2 driver version 1.1 (NSC)
(*) DirectFB/DRMKMS: Got 1 connectors, 1 encoders
(*) DirectFB/DRMKMS: found connected connector id 38.
(*) DirectFB/DRMKMS: connector 38 is already bound to encoder 37.
(*) DirectFB/DRMKMS: encoder 37 is already bound to ctrc 28.
(*) DirectFB/DRMKMS: Default mode is 1280x1024, we have 16 modes in total
(*) DirectFB/DRMKMS: supported properties for layer id 29
(*) DirectFB/DRMKMS: supported properties for layer id 34
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
(*) Direct/Thread: Started 'Genefx' (434) [DEFAULT - OTHER/0] <8388608>...


Screen (00) DRMKMS Screen                   (primary screen)
   Caps: MIXERS ENCODERS OUTPUTS

   Mixer (0) DRMKMS Mixer
     Caps:                    FULL SUB_LAYERS
     Layers (full mode):      (00) (01) (02)
     Layers (sub mode):  0 of (00) (01) (02)


   Encoder (0) DRMKMS Encoder
     Type:           DIGITAL
     Caps:           FREQUENCY RESOLUTION
     Output Resolutions: 640_480 800_600 1024_768 1152_864 1280_1024


   Output (0) DRMKMS Output
     Caps:       RESOLUTION
     Resolutions: 640_480 800_600 1024_768 1152_864 1280_1024
     Signals:    HDMI


     Layer (00) DRMKMS Layer                    (primary layer)
        Type:    GRAPHICS
        Caps:    SURFACE

     Layer (01) DRMKMS Plane Layer 0
        Type:    GRAPHICS
        Caps:    SURFACE ALPHACHANNEL SCREEN_POSITION

     Layer (02) DRMKMS Plane Layer 1
        Type:    GRAPHICS
        Caps:    SURFACE ALPHACHANNEL SCREEN_POSITION


 (!!!)  *** UNIMPLEMENTED [fusion_dispatch] *** [../../../DirectFB-1.7.7/lib/fusion/fusion.c:3947]
...