1. 08 Nov, 2020 6 commits
    • maurossi's avatar
      drm_hwcomposer: hwcutils: use <ui/Gralloc.h> with Android Q and later · 6a46a4ab
      maurossi authored
      Fixes the following building error with Android P:
      
      external/drm_hwcomposer/utils/hwcutils.cpp:21:10: fatal error: 'ui/Gralloc.h' file not found
               ^~~~~~~~~~~~~~
      1 error generated.
      
      Fixes: add24cb7
      
       ("drm_hwcomposer: stop using pixel_stride")
      Signed-off-by: maurossi's avatarMauro Rossi <issor.oruam@gmail.com>
      6a46a4ab
    • maurossi's avatar
      drm_hwcomposer: bufferinfo/legacy: use DRM_FORMAT_XYUV8888 for Android Q and later · c95d2ede
      maurossi authored
      To avoid following building errors with Android P:
      
      external/drm_hwcomposer/bufferinfo/legacy/BufferInfoLibdrm.cpp:61:57: error: use of undeclared identifier 'DRM_FORMAT_XYUV8888'
          {HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, YCrCb, 1, DRM_FORMAT_XYUV8888},
                                                              ^
      external/drm_hwcomposer/bufferinfo/legacy/BufferInfoLibdrm.cpp:68:23: error: invalid application of 'sizeof' to an incomplete type 'const struct droid_yuv_format []'
        for (int i = 0; i < ARRAY_SIZE(droid_yuv_formats); ++i)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      external/drm_hwcomposer/bufferinfo/legacy/BufferInfoLibdrm.cpp:64:30: note: expanded from macro 'ARRAY_SIZE'
                                   ^~~
      external/drm_hwcomposer/bufferinfo/legacy/BufferInfoLibdrm.cpp:78:23: error: invalid application of 'sizeof' to an incomplete type 'const struct droid_yuv_format []'
        for (int i = 0; i < ARRAY_SIZE(droid_yuv_formats); ++i)
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      external/drm_hwcomposer/bufferinfo/legacy/BufferInfoLibdrm.cpp:64:30: note: expanded from macro 'ARRAY_SIZE'
                                   ^~~
      3 errors generated.
      
      Fixes: add24cb7
      
       ("drm_hwcomposer: stop using pixel_stride")
      Signed-off-by: maurossi's avatarMauro Rossi <issor.oruam@gmail.com>
      c95d2ede
    • maurossi's avatar
      drm_hwcomposer: hwcutils: add cast (int) to building (Android P) · 6e9c7c6e
      maurossi authored
      Add cast to (int) to avoid following building error with Android P:
      
      external/drm_hwcomposer/utils/hwcutils.cpp:77:31: error: assigning to 'int' from incompatible type 'android::hardware::graphics::mapper::V2_0::Error'
        ret = gm.getGrallocMapper().importBuffer(handle,
              ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      1 error generated.
      
      Fixes: add24cb7
      
       ("drm_hwcomposer: stop using pixel_stride")
      Signed-off-by: maurossi's avatarMauro Rossi <issor.oruam@gmail.com>
      6e9c7c6e
    • maurossi's avatar
      drm_hwcomposer: add allocator@2.0 and mapper@2.1 shared dependencies (Android P) · 0c10f68c
      maurossi authored
      Fixes the following building errors after commit
      add24cb7 "drm_hwcomposer: stop using pixel_stride"
      
      In file included from external/drm_hwcomposer/utils/hwcutils.cpp:24:
      frameworks/native/libs/ui/include/ui/Gralloc2.h:22:10: fatal error: 'android/hardware/graphics/allocator/2.0/IAllocator.h' file not found
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 error generated.
      
      frameworks/native/libs/ui/include/ui/Gralloc2.h:25:10: fatal error: 'android/hardware/graphics/mapper/2.1/IMapper.h' file not found
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      1 error generated.
      
      Fixes: add24cb7
      
       ("drm_hwcomposer: stop using pixel_stride")
      Signed-off-by: maurossi's avatarMauro Rossi <issor.oruam@gmail.com>
      0c10f68c
    • maurossi's avatar
      drm_hwcomposer: Backend: build with -Wno-sign-compare cppflag (Android P) · 3c81cdf4
      maurossi authored
      To avoid the following building error with Android P:
      
      external/drm_hwcomposer/backend/Backend.cpp:89:62: error: comparison of integers of different signs: 'int' and 'std::__1::map<unsigned int, android::DrmHwcTwo::HwcLayer *, std::__1::less<unsigned int>, std::__1::allocator<std::__1::pair<const unsigned int, android::DrmHwcTwo::HwcLayer *> > >::size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
          bool testing_needed = !(client_start == 0 && client_size == z_map.size());
                                                       ~~~~~~~~~~~ ^  ~~~~~~~~~~~~
      1 error generated.
      
      Fixes: ef3c797d
      
       ("drm_hwcomposer: Add backend-dependent validation for HwcDisplay class")
      Signed-off-by: maurossi's avatarMauro Rossi <issor.oruam@gmail.com>
      3c81cdf4
    • maurossi's avatar
      drm_hwcomposer: Backend: build with -Wno-c++17-extensions cppflag (Android P) · 82899ec3
      maurossi authored
      To avoid the following building error with Android P:
      
      external/drm_hwcomposer/backend/Backend.cpp:115:15:
      error: decomposition declarations are a C++17 extension [-Werror,-Wc++17-extensions]
        for (auto & [ z_order, layer ] : z_map) {
                    ^~~~~~~~~~~~~~~~~~
      1 error generated.
      
      Fixes: ef3c797d
      
       ("drm_hwcomposer: Add backend-dependent validation for HwcDisplay class")
      Signed-off-by: maurossi's avatarMauro Rossi <issor.oruam@gmail.com>
      82899ec3
  2. 03 Nov, 2020 1 commit
  3. 02 Nov, 2020 2 commits
  4. 31 Oct, 2020 1 commit
    • Roman Stratiienko's avatar
      drm_hwcomposer: stop using pixel_stride · add24cb7
      Roman Stratiienko authored
      
      
      pixel_stride is used only to validate buffer when importing using
      GraphicBufferMapper::importBuffer() method.
      
      The problem is we can't always get this value from buffer_handle_t.
      Libdrm and MapperMetadata getters can only calculate this value based
      on byte stride and buffer format. But this calculation isn't always
      possible, which causes importBuffer() to fail.
      
      Instead we can use GrallocMapper::importBuffer() method,
      which doesn't require to validate the buffer.
      
      This commit is not compatible with Android-P.
      
      Signed-off-by: Roman Stratiienko's avatarRoman Stratiienko <r.stratiienko@gmail.com>
      add24cb7
  5. 22 Oct, 2020 1 commit
  6. 20 Oct, 2020 1 commit
    • Roman Stratiienko's avatar
      drm_hwcomposer: refactor platform directory · b2e9fe23
      Roman Stratiienko authored
      
      
      Motivation:
      
      Platform term meaning used in drm_hwcomposer does not correspond to the
      content of the platform directory. Platform directory consists of:
      1. Buffer information getters for different gralloc (currently called platform).
      2. Composition planner logic (which has flaws and should be reworked into
         layer->plane mapping during validation stage logic).
      3. DrmGenericImpoter with reference counting logic.
      
      Android-11 IMapper@4 metadata API offers a generic way to access buffer
      information which makes other gralloc buffer information getters obsolete.
      Legacy getters should be maintained for some time until all known users
      will migrate to Mapper@4 API.
      
      Implementation:
      
      1. Split 'PlatformImporter' logic to 'Importer' only and 'Buffer Getter' logic.
         a. Remove buffer_handle_t parameter from ImportBuffer(). Instead user should
            get BufferInfo using ConvertBoInfo to struct hwc_drm_bo_t, then use it for
            ImportBuffer().
         b. Move DrmGenericImporter.{cpp/h} into the drm directory.
      
      2. Isolate planner code in single file and move it to compositor directory as
         compositor/Planner.{cpp/h}
      
      3. Rename platform definition
         a. Rename platform directory to bufferinfo.
         b. Rename/move bufferinfo/platorm*.{cpp,h} getters to
            bufferinfo/legacy/BufferInfo*.{cpp,h}. Align class names/includes.
      
      4. Split legacy/metadata getters logic.
         a. Apply existing bufferinfogetter base class only for legacy getters.
         b. Combine legacy/generic gettera under new base class.
         c. Create a placeholder for generic(metadata) getter.
      
      Signed-off-by: Roman Stratiienko's avatarRoman Stratiienko <r.stratiienko@gmail.com>
      b2e9fe23
  7. 07 Oct, 2020 1 commit
  8. 04 Oct, 2020 1 commit
  9. 03 Oct, 2020 1 commit
  10. 28 Sep, 2020 1 commit
    • Roman Stratiienko's avatar
      drm_hwcomposer: Fix RegisterCallback() function · 2370109a
      Roman Stratiienko authored
      
      
      - Fixes segfault during client switch.
      - Allows to run VTS on Android-11.
      
      VTS Results:
      ============================================
          arm64-v8a VtsHalGraphicsComposerV2_1TargetTest: [53 tests / 42808 msec]
          armeabi-v7a VtsHalGraphicsComposerV2_1TargetTest: [53 tests / 33353 msec]
      =============== Summary ===============
      2/2 modules completed
      Total Tests       : 106
      PASSED            : 106
      FAILED            : 0
      ============================================
      
      Signed-off-by: Roman Stratiienko's avatarRoman Stratiienko <r.stratiienko@gmail.com>
      2370109a
  11. 26 Sep, 2020 1 commit
  12. 25 Sep, 2020 3 commits
  13. 24 Sep, 2020 1 commit
  14. 23 Sep, 2020 1 commit
    • Mattijs Korpershoek's avatar
      drm_hwcomposer: Add MediaTek platform support · 5284c7e9
      Mattijs Korpershoek authored
      This platform handler is dedicated for the i500 MediaTek SoC [1].
      i500 has a Mali-G72 MP3 GPU.
      
      OpenGL/Mali integration is based on ARM Gralloc module, version
      BX304L01B-SW-99005-r20p0-01rel0, without additional patches.
      
      This platformmediatek is based on platformmeson, without the additional
      usage flag in the private_handle_t.
      AFBC support has also been removed as it's unsupported.
      
      External Android.bp file should be created in order to build this
      module:
      
      ```
      cc_library_shared {
          name: "hwcomposer.drm_mediatek",
          defaults: ["hwcomposer.drm_defaults"],
          srcs: [":drm_hwcomposer_platformmediatek"],
          whole_static_libs: ["drm_hwcomposer"],
      }
      ```
      
      [1] https://www.mediatek.com/products/AIoT/i500
      
      
      Change-Id: I3ea7a980d76ba5c5ff583b5d4f21e1989875bafb
      Signed-off-by: Mattijs Korpershoek's avatarMattijs Korpershoek <mkorpershoek@baylibre.com>
      5284c7e9
  15. 12 Sep, 2020 2 commits
  16. 11 Sep, 2020 1 commit
  17. 08 Sep, 2020 2 commits
  18. 01 Sep, 2020 2 commits
  19. 26 Aug, 2020 6 commits
  20. 20 Aug, 2020 1 commit
  21. 24 Jul, 2020 1 commit
    • Matvii Zorin's avatar
      drm_hwcomposer: Add feature to search for KMS DRI card · ec75ccd0
      Matvii Zorin authored
      
      
      Most modern SOCs have separate IP cores for GPU and Display Unit (KMS).
      Also, there is no warranty that the KMS card will always have
      /dev/dri/card0 path and GPU - /dev/dri/card1, but drm_hwcomposer should
      open only KMS device. The order can depend on many factors. For example:
      on the rpi4 board, it was observed that enabling the WIFI kernel module
      swapping the card order. Therefore searching for the KMS card is the only
      efficient solution.
      
      The IsKMSDev function returns true when the file descriptor on the path
      is successfully opened, the drmlib function is returned resources and
      the target device has at least one CTRC, connector, and encoder. Also,
      the patch enables finding KMS devices in the case of the absence of
      the system property specification.
      
      Signed-off-by: Matvii Zorin's avatarMatvii Zorin <matvii.zorin@globallogic.com>
      Reviewed-by: Roman Stratiienko's avatarRoman Stratiienko <r.stratiienko@gmail.com>
      Change-Id: I8874a50188207833389fadd4815b42a80bf69240
      ec75ccd0
  22. 03 Jul, 2020 3 commits