directfb2 / DirectFB2

Core DirectFB library
GNU Lesser General Public License v2.1
132 stars 15 forks source link

Benchmarks using df_dok - DRM/KMS approximately 30% the speed of FBDEV. #110

Open kjngineering opened 1 year ago

kjngineering commented 1 year ago
          Benchmarks using df_dok - no other changes other than one compiled for fbdev, one for DRM/KMS.
# df_dok

   ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 2.0.0  |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2017-2023  DirectFB2 Open Source Project (fork of DirectFB)
        (c) 2012-2016  DirectFB integrated media GmbH
        (c) 2001-2016  The world wide DirectFB Open Source Community
        (c) 2000-2004  Convergence (integrated media) GmbH
      ----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2023-04-10 01:02)
(*) DRMKMS/System: Using device /dev/dri/card0 (default)
(*) DRMKMS/System: Found 1 connectors, 1 encoders, 3 planes
(*) DirectFB/Input: Hot-plug detection enabled with Linux Input
(*) DirectFB/Genefx: NEON enabled
(*) DirectFB/Graphics: Genefx Software Rasterizer 0.7 (DirectFB)
(*) DRMKMS/Screen: Default mode is 800x480 (1 modes in total)
(*) DRMKMS/Layer: Supported properties for layer id 36
(*)      zpos
(*) DRMKMS/Layer: Supported properties for layer id 41
(*)      alpha
(*)      zpos
(*) DirectFB/Core/WM: Default 0.3 (DirectFB)
(*) Direct/Interface: Loaded 'DGIFF' implementation of 'IDirectFBFont'
(*) Direct/Interface: Loaded 'DFIFF' implementation of 'IDirectFBImageProvider'
Benchmarking 256x256 on 800x459 RGB16 (16bit)...
Anti-aliased Text                              3.091 secs (   29.116 KChars/sec) [100.0%]
Anti-aliased Text (blend)                      3.155 secs (   20.538 KChars/sec) [100.0%]
Fill Rectangle                                 3.000 secs (  443.460 MPixel/sec) [100.0%]
Fill Rectangle (blend)                         3.330 secs (    7.872 MPixel/sec) [100.0%]
Fill Rectangles [10]                           3.018 secs (  456.015 MPixel/sec) [100.3%]
Fill Rectangles [10] (blend)                   8.257 secs (    7.937 MPixel/sec) [100.0%]
Fill Triangles                                 3.004 secs (  278.157 MPixel/sec) [100.3%]
Fill Triangles (blend)                         3.054 secs (    7.510 MPixel/sec) [100.0%]
Draw Rectangle                                 3.002 secs (   30.046 KRects/sec) [100.0%]
Draw Rectangle (blend)                         3.008 secs (    2.227 KRects/sec) [100.3%]
Draw Lines [10]                                3.008 secs (  104.720 KLines/sec) [100.0%]
Draw Lines [10] (blend)                        3.019 secs (    9.274 KLines/sec) [100.0%]
Fill Spans                                     3.009 secs (  413.819 MPixel/sec) [100.0%]
Fill Spans (blend)                             3.385 secs (    7.744 MPixel/sec) [100.0%]
Fill Trapezoids [10]                           3.104 secs (  380.041 MPixel/sec) [100.3%]
Blit                                           3.353 secs (   11.727 MPixel/sec) [100.0%]
Blit 180                                       4.365 secs (    4.504 MPixel/sec) [100.2%]
Blit colorkeyed                                3.381 secs (    5.815 MPixel/sec) [100.0%]
Blit with format conversion                    3.247 secs (    8.073 MPixel/sec) [100.0%]
Blit with colorizing                           3.475 secs (   11.315 MPixel/sec) [100.2%]
Blit from 32bit (blend)                        5.627 secs (    2.329 MPixel/sec) [100.0%]
Blit from 32bit (blend) with colorizing        3.533 secs (    3.709 MPixel/sec) [100.0%]
Blit SrcOver (premultiplied source)            3.291 secs (    3.982 MPixel/sec) [100.0%]
Blit SrcOver (premultiply source)              3.594 secs (    3.646 MPixel/sec) [100.2%]
Stretch Blit                                   7.160 secs (    4.487 MPixel/sec) [100.0%]
Stretch Blit colorkeyed                        7.234 secs (    4.441 MPixel/sec) [100.0%]
# df_dok

   ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 2.0.0  |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2017-2023  DirectFB2 Open Source Project (fork of DirectFB)
        (c) 2012-2016  DirectFB integrated media GmbH
        (c) 2001-2016  The world wide DirectFB Open Source Community
        (c) 2000-2004  Convergence (integrated media) GmbH
      ----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2023-04-09 22:23)
(*) FBDev/System: Using device /dev/fb0 (default)
(*) FBDev/System: Found 'sun4i-drmdrmfb' (ID 0) with framebuffer at 0x00000000, 1500k (MMIO 0x00000000, 0k)
(*) DirectFB/Input: Hot-plug detection enabled with Linux Input
(*) DirectFB/Genefx: NEON enabled
(*) DirectFB/Graphics: Generic Software Rasterizer 0.7 (DirectFB)
(*) FBDev/Screen: Default mode is 800x480 (0 modes in total)
(*) DirectFB/Core/WM: Default 0.3 (DirectFB)
(*) FBDev/Mode: Setting 800x480 RGB32
(*) FBDev/Mode: Switched to 800x480 (virtual 800x480) at 32 bits (RGB32), pitch 3200
(*) Direct/Interface: Loaded 'DGIFF' implementation of 'IDirectFBFont'
(*) Direct/Interface: Loaded 'DFIFF' implementation of 'IDirectFBImageProvider'
(*) FBDev/Mode: Setting 800x480 RGB32
(*) FBDev/Mode: Switched to 800x480 (virtual 800x480) at 32 bits (RGB32), pitch 3200
Benchmarking 256x256 on 800x459 RGB32 (32bit)...
Anti-aliased Text                              3.000 secs (   92.400 KChars/sec) [100.0%]
Anti-aliased Text (blend)                      3.159 secs (   20.512 KChars/sec) [100.3%]
Fill Rectangle                                 3.007 secs (  217.944 MPixel/sec) [100.3%]
Fill Rectangle (blend)                         3.511 secs (    3.733 MPixel/sec) [100.0%]
Fill Rectangles [10]                           3.254 secs (  221.541 MPixel/sec) [100.3%]
Fill Rectangles [10] (blend)                  17.525 secs (    3.739 MPixel/sec) [100.0%]
Fill Triangles                                 3.017 secs (  170.519 MPixel/sec) [100.3%]
Fill Triangles (blend)                         3.539 secs (    3.703 MPixel/sec) [100.2%]
Draw Rectangle                                 3.003 secs (   28.837 KRects/sec) [100.0%]
Draw Rectangle (blend)                         3.046 secs (    2.035 KRects/sec) [100.0%]
Draw Lines [10]                                3.006 secs (   99.800 KLines/sec) [100.3%]
Draw Lines [10] (blend)                        3.038 secs (    9.874 KLines/sec) [100.3%]
Fill Spans                                     3.006 secs (  252.900 MPixel/sec) [100.3%]
Fill Spans (blend)                             3.525 secs (    3.718 MPixel/sec) [100.0%]
Fill Trapezoids [10]                           3.218 secs (  203.654 MPixel/sec) [100.0%]
Blit                                           3.040 secs (  107.789 MPixel/sec) [100.0%]
Blit 180                                       3.001 secs (   96.087 MPixel/sec) [100.0%]
Blit colorkeyed                                3.049 secs (   90.275 MPixel/sec) [100.0%]
Blit with format conversion                    3.062 secs (   34.244 MPixel/sec) [100.0%]
Blit with colorizing                           3.283 secs (   19.962 MPixel/sec) [100.0%]
Blit from 32bit (blend)                        3.229 secs (    4.059 MPixel/sec) [100.3%]
Blit from 32bit (blend) with colorizing        4.110 secs (    3.189 MPixel/sec) [100.0%]
Blit SrcOver (premultiplied source)            3.600 secs (    7.281 MPixel/sec) [100.0%]
Blit SrcOver (premultiply source)              3.016 secs (   21.729 MPixel/sec) [100.0%]
Stretch Blit                                   3.000 secs (  112.313 MPixel/sec) [100.0%]
Stretch Blit colorkeyed                        3.007 secs (   82.687 MPixel/sec) [100.0%]

Blit performance and alpha seems to really struggle in DRM/KMS.

Fbdev is a huge performance increase on DirectFB(1.7)

Let me know if you would like any more tests run, I can build and test quite quickly now.

Also massive shoutout to @fifteenhex for the Buildroot packages for DFB2 - I would highly recommend switching to official sources and committing them to the buildroot repository.

Originally posted by @kjngineering in https://github.com/directfb2/DirectFB2/issues/108#issuecomment-1501274085

kjngineering commented 1 year ago

For reference, here is the same FBDev benchmark on 1.7.7 (no other changes).

# df_dok
(*) Direct/Thread: Started 'SigHandler' (108) [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. (2023-04-11 22:24)
(*) Direct/Memcpy: Using libc memcpy()
(*) Direct/Thread: Started 'Fusion Dispatch' (109) [MESSAGING - OTHER/0] <838860                                                                                                      8>...
(*) Direct/Thread: Started 'VT Switcher' (110) [CRITICAL - OTHER/0] <8388608>...
(*) Direct/Thread: Started 'VT Flusher' (111) [DEFAULT - OTHER/0] <8388608>...
(*) DirectFB/FBDev: Found 'sun4i-drmdrmfb' (ID 0) with frame buffer at 0x0000000                                                                                                      0, 1500k (MMIO 0x00000000, 0k)
(*) Direct/Thread: Started 'Keyboard Input' (112) [INPUT - OTHER/0] <8388608>...
(*) DirectFB/Input: Keyboard 0.9 (directfb.org)
(*) Direct/Thread: Started 'Hotplug with Linux Input' (113) [INPUT - OTHER/0] <8                                                                                                      388608>...
(*) DirectFB/Input: Hot-plug detection enabled with Linux Input Driver
(*) DirectFB/Graphics: Generic Software Rasterizer 0.7 (directfb.org)
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
(*) Direct/Thread: Started 'Genefx' (114) [DEFAULT - OTHER/0] <8388608>...
(*) FBDev/Mode: Setting 800x480 RGB32
(*) FBDev/Mode: Switched to 800x480 (virtual 800x480) at 32 bit (RGB32), pitch 3                                                                                                      200
(!) DirectFB/FBDev: Could not set gamma ramp    --> Invalid argument
(*) Direct/Interface: Loaded 'PNG' implementation of 'IDirectFBImageProvider'.
(*) Direct/Interface: Loaded 'FT2' implementation of 'IDirectFBFont'.
(*) FBDev/Mode: Setting 800x480 RGB32
(*) FBDev/Mode: Switched to 800x480 (virtual 800x480) at 32 bit (RGB32), pitch 3                                                                                                      200
(!) DirectFB/FBDev: Could not set gamma ramp    --> Invalid argument
(*) Direct/Interface: Loaded 'GIF' implementation of 'IDirectFBImageProvider'.

Benchmarking 256x256 on 800x464 RGB32 (32bit)...

Anti-aliased Text                              3.036 secs (   74.703 KChars/sec) [100.0%]
Anti-aliased Text (blend)                      3.009 secs (   21.535 KChars/sec) [100.0%]
Fill Rectangle                                 3.009 secs (  217.799 MPixel/sec) [100.3%]
Fill Rectangle (blend)                         3.917 secs (    3.346 MPixel/sec) [100.2%]
Fill Rectangles [10]                           3.256 secs (  221.405 MPixel/sec) [100.0%]
Fill Rectangles [10] (blend)                  19.595 secs (    3.344 MPixel/sec) [100.0%]
Fill Triangles                                 3.009 secs (  164.438 MPixel/sec) [100.3%]
Fill Triangles (blend)                         3.941 secs (    3.325 MPixel/sec) [100.0%]
Draw Rectangle                                 3.000 secs (   24.300 KRects/sec) [100.0%]
Draw Rectangle (blend)                         3.029 secs (    2.112 KRects/sec) [100.0%]
Draw Lines [10]                                3.008 secs (   90.093 KLines/sec) [100.0%]
Draw Lines [10] (blend)                        3.071 secs (   10.094 KLines/sec) [100.0%]
Fill Spans                                     3.014 secs (  191.345 MPixel/sec) [100.0%]
Fill Spans (blend)                             3.941 secs (    3.325 MPixel/sec) [100.0%]
Fill Trapezoids [10]                           3.026 secs (  194.918 MPixel/sec) [100.0%]
Blit                                           3.042 secs (  107.718 MPixel/sec) [100.0%]
Blit 180                                       3.016 secs (   89.090 MPixel/sec) [100.0%]
Blit colorkeyed                                3.067 secs (   76.925 MPixel/sec) [100.0%]
Blit destination colorkeyed                    4.368 secs (    4.501 MPixel/sec) [100.0%]
Blit with format conversion                    3.245 secs (   26.254 MPixel/sec) [100.0%]
Blit with colorizing                           3.028 secs (   15.150 MPixel/sec) [100.3%]
Blit from 32bit (blend)                        3.753 secs (    3.492 MPixel/sec) [100.0%]
Blit from 32bit (blend) with colorizing        4.990 secs (    2.626 MPixel/sec) [100.0%]
Blit SrcOver (premultiplied source)            3.726 secs (    7.035 MPixel/sec) [100.2%]
Blit SrcOver (premultiply source)              3.159 secs (   18.671 MPixel/sec) [100.3%]
Stretch Blit                                   3.002 secs (  105.281 MPixel/sec) [100.0%]
Stretch Blit colorkeyed                        3.001 secs (   66.318 MPixel/sec) [ 99.6%]