1

目前,我们正在使用 DirectFB 在嵌入式板 (i.MX 6) 上开发 SDL2 应用程序。我们的 LinuxOS 是通过 YOCTO 生成的。应用程序本身运行良好,SDL_RenderPresent( renderer_ )似乎只有软件 blitting 正在运行,这使 CPU 达到了极限。

  • 窗口(256 x 128 像素):60 FPS - ~20% 在一个核心
  • 窗口(1280 x 1024 像素):45 FPS - 100% 在一个核心

添加no-software到 DFBARGS 会使 CPU 使用率降低到 ~6%(这是可以接受的),但之后屏幕上将不再可见。这是因为我认为 SDL2/DirectFB 在这种情况下仅使用软件位块传输。我在初始化时忘记了一个标志吗?

以 1280x1024 和 60FPS 运行 qt5 应用程序需要大约 3-6% 的 CPU 使用率一个内核。

创建对象

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]

dfb 信息:

(*) 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]
4

0 回答 0