1. 12 Sep, 2020 2 commits
  2. 11 Sep, 2020 1 commit
  3. 08 Sep, 2020 2 commits
  4. 01 Sep, 2020 2 commits
  5. 26 Aug, 2020 6 commits
  6. 20 Aug, 2020 1 commit
  7. 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
  8. 03 Jul, 2020 4 commits
  9. 01 Jul, 2020 1 commit
  10. 26 Jun, 2020 2 commits
    • Paul Howgego's avatar
      drm_hwcomposer: Fix invalid buffer_handle_t pointer · 3f17bc09
      Paul Howgego authored
      In Android 11, at boot time, I see the following sequence of
      calls from SurfaceFlinger that trigger this:
      
        // Composition type for layer is saved in DRM HWC Layer validated_type_
        validateDisplay()
      
        // Layer composition type saved in DRM HWC Layer sf_type_
        acceptDisplayChanges()
      
        // Composition type in Layer sf_type_ is now "client" so DRM HWC doesn't
        // update the Layer buffer pointer
        setLayerBuffer()
      
        // DRM HWC Layer sf_type_ is now changed back to "device"
        setLayerCompositionType()
      
        // DRM HWC iterates through the layers and finds that Layer composition
        // type in sf_type_ is "device"  so thinks it is fine to calls
        // importBuffer() but this Layer now has an invalid pointer as the
        // setLayerBuffer() was ignored.
        validateDisplay()
      
      Thus this patch, changes the logic to always update the
      buffer_handle_t pointer in setLayerBuffer regardless of
      composition type rather than keeping the invalid buffer_handle_t
      in the Layer obect. The composition type may be changed back to
      device composition by setLayerCompositionType at which point the
      Layer object needs to have saved the buffer_handle_t.
      
      Not sure how we could reproduce the same sequence of calls on
      another Android version.
      Signed-off-by: Paul Howgego's avatarPaul Howgego <paul.howgego@arm.com>
      [jstultz: Reword and add context from merge request to the commit message]
      Signed-off-by: John Stultz's avatarJohn Stultz <john.stultz@linaro.org>
      Change-Id: I88a11ee2fee742d6154a482455a8532a95e681d3
      3f17bc09
    • Andrii Chepurnyi's avatar
      drm_hwcomposer: Propagate PLATFORM_SDK_VERSION to cflags · a63d66c7
      Andrii Chepurnyi authored
      PLATFORM_SDK_VERSION is needed for already present
      code (GetDisplayIdentificationData/GetDisplayCapabilities),
      which implements some of the android.hardware.graphics.composer@2.3 API.
      Signed-off-by: Andrii Chepurnyi's avatarAndrii Chepurnyi <andrii_chepurnyi@epam.com>
      Signed-off-by: John Stultz's avatarJohn Stultz <john.stultz@linaro.org>
      Change-Id: I1a5019e9d8ae327db41f55cee0ba3636f913928f
      a63d66c7
  11. 14 Apr, 2020 1 commit
  12. 21 Feb, 2020 1 commit
  13. 20 Feb, 2020 1 commit
    • Peter Collingbourne's avatar
      drm_hwcomposer: Improve error messages. · c77052eb
      Peter Collingbourne authored
      - Don't negate errno before passing to strerror, at least on
        bionic this results in "Unknown error -x" instead of the actual
        error.
      - Fix another error message to print strerror(errno) instead of the
        returned fd which will always be -1.
      - Fix another error message to call strerror for consistency.
      Signed-off-by: Peter Collingbourne's avatarPeter Collingbourne <pcc@google.com>
      c77052eb
  14. 19 Feb, 2020 3 commits
  15. 11 Feb, 2020 1 commit
  16. 10 Feb, 2020 1 commit
  17. 04 Feb, 2020 1 commit
  18. 24 Jan, 2020 1 commit
  19. 16 Jan, 2020 2 commits
    • Roman Kovalivskyi's avatar
      drm_hwcomposer: Remove redundant hotplug call · 30957087
      Roman Kovalivskyi authored
      Initial hotplug state is reported back during callback registration,
      but during VTS tests we've noticed error that is caused by calling
      hotplug with same display twice.
      
      HandleInitialHotplugState calls hotplug function for each connected
      display, so it covers HWC_DISPLAY_PRIMARY too, therefore first call
      should be removed, as it is redundant and causes minor error.
      Signed-off-by: Roman Kovalivskyi's avatarRoman Kovalivskyi <roman.kovalivskyi@globallogic.com>
      30957087
    • Roman Kovalivskyi's avatar
      drm_hwcomposer: Add check to vsync routine to avoid crash on callback · 521a4c85
      Roman Kovalivskyi authored
      Vsync could be disabled during routine being running and this could
      potentially lead to crash on callback invocation. Crash happens if
      VSyncControl(false) was called when Routine has cached callback and
      unlocked mutex but haven't callback yet. At this point we can't be
      sure that callback is still valid so invoking it is incorrect
      behaviour.
      
      Second check if vsync is enabled drastically shortens window when we
      could go into invalid state, from the whole vblank invocation to
      several machine instructions between check and invocation.
      
      Please note that we can't check against cached value in this case,
      therefore operations on this flag should be atomic instead.
      Signed-off-by: Roman Kovalivskyi's avatarRoman Kovalivskyi <roman.kovalivskyi@globallogic.com>
      521a4c85
  20. 04 Jan, 2020 1 commit
  21. 19 Dec, 2019 1 commit
  22. 17 Dec, 2019 1 commit
    • Roman Stratiienko's avatar
      drm_hwcomposer: Choose client layer range to achieve minimal GPU load · b7b81cfb
      Roman Stratiienko authored
      1. Allow CLIENT layer at any position.
      2. Check all possible layer combination and choose most efficient
         based on total pixel operations value.
      
      Use case 1 - Layer count is greater than available planes
      Table shows difference before and after this commit for 4 or 2 planes cases:
      
      ```
      z_order   layer      size        pixels  before(4)  after(4) before(2) after(2)
      -
      0         Wallpaper  1960x1080   2MiP    CLIENT     DEVICE   CLIENT    DEVICE
      1         Launcher   1960x1080   2MiP    CLIENT     DEVICE   CLIENT    CLIENT
      2         Status bar 1960x80     0.15MiP DEVICE     DEVICE   CLIENT    CLIENT
      3         Nav. bar   1960x80     0.15MiP DEVICE     CLIENT   CLIENT    CLIENT
      4         Cursor     24x24       576P    DEVICE     CLIENT   DEVICE    CLIENT
      
      Total pixels merged by CLIENT (GPU)      4MiP  ->   0.15MiP  4.3MiP -> 2.3MiP
      ```
      
      Use case 2 - Unsupported layer type in the middle (Dim layer, etc):
      Table shows difference before and after this commit for 4 or 2 planes cases:
      
      ```
      z_order   layer      size        pixels  before(4)  after(4) before(2) after(2)
      -
      0         App        1960x1080   2MiP    CLIENT     DEVICE   CLIENT    DEVICE
      1         Status bar 1960x80     0.15MiP CLIENT     DEVICE   CLIENT    CLIENT
      2         Nav. bar   1960x80     0.15MiP CLIENT     DEVICE   CLIENT    CLIENT
      3         Dim layer  1960x1080   2MiP    CLIENT     CLIENT   CLIENT    CLIENT
      4         Dialog     1000x500    0.5MiP  DEVICE     CLIENT   DEVICE    CLIENT
      
      Total pixels merged by CLIENT (GPU)      4.3MiP ->  2.5MiP   4.3MiP -> 2.8MiP
      ```
      Signed-off-by: default avatarRoman Stratiienko <roman.stratiienko@globallogic.com>
      b7b81cfb
  23. 16 Dec, 2019 2 commits
    • Roman Kovalivskyi's avatar
      drm_hwcomposer: Add simplistic SetColorTransform implementation · 12b91a35
      Roman Kovalivskyi authored
      VTS tests for SET_COLOR_TRANSFORM fails for now since
      SetColorTransform is marked as unsupported function. this commit tries
      to address this issue. We can't make complete implementation of those
      features for our platform for now, so we'd just save arguments for
      future use and force client composition if any color transformation is
      requested. This is perfectly acceptable way to pass VTS testcase for
      SET_COLOR_TRANSFORM.
      
      Commit da5839cf ("drm_hwcomposer: Add support for GetColorModes &
      SetCursorPosition") implements GetColorModes and SetCursorPosition
      simply by adding fields that store this values for future
      uses. Therefore we assume that it is okay to use this approach to at
      least support interface part.
      
      Please note that if transform hint is identity then no
      transformation should be applied. If hint is arbitrary matrix then
      given matrix should be applier after composition, though for now we'd
      just force client composition instead. This behavior is required by
      HAL interface as stated in
      hardware/interfaces/graphics/composer/2.1/IComposerClient.hal, line
      738 from repository
      https://android.googlesource.com/platform/hardware/interfaces, tag
      android-10.0.0_r14
      
      Please note that color transform matrix argument is an array that has
      16 elements by contract, as it is 4x4 matrix. This is why
      MATRIX_SIZE has such value.
      Signed-off-by: Roman Kovalivskyi's avatarRoman Kovalivskyi <roman.kovalivskyi@globallogic.com>
      12b91a35
    • Roman Kovalivskyi's avatar
      drm_hwcomposer: Add simplistic SetLayerColor implementation · bb37569e
      Roman Kovalivskyi authored
      VTS tests for SET_LAYER_COLOR fails for now since SetLayerColor is
      unsupported function. Tis commit tries to address this issue. We can't
      fully implement it for now, therefore simplistic implementation that
      just saves argument for future uses and satisfies the interface could
      be used instead, for now.
      
      Commit da5839cf ("drm_hwcomposer: Add support for GetColorModes &
      SetCursorPosition") implements GetColorModes and SetCursorPosition in
      the same fashion, simply by adding fields that store this values for
      future uses, therefore we assume that it is okay to use this approach
      here too.
      Signed-off-by: Roman Kovalivskyi's avatarRoman Kovalivskyi <roman.kovalivskyi@globallogic.com>
      bb37569e
  24. 09 Dec, 2019 1 commit
    • Vincent Donnefort's avatar
      drm_hwcomposer: Add refcount for GEM handle · f67c365d
      Vincent Donnefort authored
      The linux kernel doesn't provide reference counting for the handle
      returned by FD_TO_HANDLE ioctl. It means that if the same Gralloc buffer
      is imported twice, the first GEM_CLOSE will destroy the handle even if it
      is still in use by another import.
      
      Remedy this issue by doing the reference counting directly in the DRM
      generic platform support: ImportHandle() will increase the reference,
      while ReleaseHandle() will decrease and close it, if necessary.
      Signed-off-by: Vincent Donnefort's avatarVincent Donnefort <vincent.donnefort@arm.com>
      f67c365d