1. 02 Jun, 2018 4 commits
    • John Stultz's avatar
      drm_hwcomposer: Add Importer CheckBuffer to validate buffers aren't larger... · ed829d43
      John Stultz authored
      
      drm_hwcomposer: Add Importer CheckBuffer to validate buffers aren't larger then max resolution sizes
      
      When doing a test composition CreateComposition(), goes on to
      call ImportBuffer(), for each layer which in may include large
      (2880x2560) sized buffer (I'm guessing this is the full res
      background image).
      
      Then in HisiImporter::ImportBuffer() we try to call the kernel
      via drmModeAddFB2(), but that bombs out in
      drm_internal_framebuffer_create() due to:
      "bad framebuffer width 2880, should be >= 0 && <= 2048"
      
      Which is due to the mode_config.max_width/height values in the
      kirin drivers being limited to 2048 (which while not really
      appropriate for the HiKey960 is reasonable for the HiKey and
      other more limited hardware).
      
      Stefan Schake suggested we use the max resolution values already
      read from drmModeGetResources and skip adding layers to the zmap
      when they are too big. So this patch tries to implement that.
      
      The one gotcha is the the gralloc handle structures are opaque
      in the common code, so we have to do the resolution check in
      Importer specific code, thus this patch adds a CheckBuffer()
      method to the Importer.
      
      This CheckBuffer method allows us to pre-check the buffers
      before we try to import them, and we can likely grow what is
      checked in future patches as resolution issues are only one of
      many potential errors.
      
      Change-Id: I9671670b20d9daacff3238286b5b95586b4565b7
      Signed-off-by: John Stultz's avatarJohn Stultz <john.stultz@linaro.org>
      ed829d43
    • John Stultz's avatar
      drm_hwcomposer: Avoid filling the log with warnings when test compositions fail · 083587f0
      John Stultz authored
      
      
      We frequently test compositions that might fail due to various
      reasons, so lets not fill the log with errors when those test
      compsitions don't work out.
      
      Change-Id: Iab19628bd7488c7d104e2c775310989bb59e140d
      Signed-off-by: John Stultz's avatarJohn Stultz <john.stultz@linaro.org>
      083587f0
    • John Stultz's avatar
      drm_hwcomposer: platformhisi: Add support for importing DRM_FORMAT_YVU420 buffers · 259e6aef
      John Stultz authored
      
      
      When trying to play fullscreen video, I started seeing import
      errors, which were caused by us trying to call drmModeAddFB2()
      with fmt DRM_FORMAT_YVU420 but only setting the a single set of
      handle/pitch/offset values.
      
      In the kernel, the framebuffer_check() function would then fail
      with "no buffer object handle for plane 1" since we only passed
      one plane in.
      
      Thus this patch calculates and sets the pitch/offset values for
      the separate planes in the single gem_handle buffer.
      
      Many thanks to Stefan Schake and Rob Herring for helping me
      understand some of the subtleties of image plans vs display
      planes, etc.
      
      Change-Id: I2d9bdfc66c504e6446a4f9c6287ab675201afa30
      Signed-off-by: John Stultz's avatarJohn Stultz <john.stultz@linaro.org>
      259e6aef
    • John Stultz's avatar
      drm_hwcomposer: platformdrmgeneric: Handle closing gem_handles if we have duplicate handles · 20087972
      John Stultz authored
      In some cases some multi-plane bo's may have multiple
      gem_handles/offsets/pitches set. And its possible to have
      multiple planes that use the same gem_handle with different
      offsets/pitches.
      
      Thus, when closing the gem_handles, if we're not careful
      we could close the same handle multiple times. So this
      patch avoids this by taking some old code from the nv
      importer:
      https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/blob/aeccd89eaafec467cb9449cce5c64152a240c138/platformnv.cpp#L176
      
      
      
      Many thanks to Stefan Schake for pointing me to that code.
      
      Change-Id: Ifecd0f95de5ada5280a0af807005d0b0186a068c
      Signed-off-by: John Stultz's avatarJohn Stultz <john.stultz@linaro.org>
      20087972
  2. 30 May, 2018 6 commits
  3. 17 May, 2018 2 commits
  4. 10 May, 2018 1 commit
  5. 08 May, 2018 1 commit
  6. 07 May, 2018 2 commits
  7. 04 May, 2018 5 commits
  8. 03 May, 2018 4 commits
  9. 27 Apr, 2018 4 commits
    • John Stultz's avatar
      drm_hwcomposer: Fall back to client compositon if the gl precompostior fails · acc4dcf1
      John Stultz authored
      
      
      If the gl precompositor isn't being used, we cannot accept
      every layer as a device composited layer.
      
      Thus this patch adds some extra logic in the validate function
      to fall back to client side compositing if the gl precompositor
      did not initialize properly.
      
      This does force everything to a single plane even if we have
      a few available, but a deeper rework of the validate step
      planning is needed before we can reliably make use of them.
      
      Credit to Rob Herring, who's single plane patch was what this
      was originally based on.
      
      Cc: Marissa Wall <marissaw@google.com>
      Cc: Sean Paul <seanpaul@google.com>
      Cc: Dmitry Shmidt <dimitrysh@google.com>
      Cc: Robert Foss <robert.foss@collabora.com>
      Cc: Matt Szczesiak <matt.szczesiak@arm.com>
      Cc: Liviu Dudau <Liviu.Dudau@arm.com>
      Cc: David Hanna <david.hanna11@gmail.com>
      Cc: Rob Herring <rob.herring@linaro.org>
      Cc: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
      Cc: Alistair Strachan <astrachan@google.com>
      Reviewed-by: Rob Herring's avatarRob Herring <robh@kernel.org>
      Signed-off-by: John Stultz's avatarJohn Stultz <john.stultz@linaro.org>
      acc4dcf1
    • John Stultz's avatar
      drm_hwcomposer: Cleanup gl precompositor init and provide uses_GL flag · 3b0c69d3
      John Stultz authored
      
      
      The drm_hwcomposer has its own GL pre-compositor which is used
      to squish layers when there are more layers then planes on the
      display hardware. In many ways this duplicates the client-side
      GL compositing that is done in SurfaceFlinger, but in theory can
      be more highly optimized for the hardware.
      
      Unfortunately, due to these optimizations, the drm_hwcomposer's
      pre-compositor becomes somewhat hardware specific (originally
      targeting nvidia hardware, I believe).
      
      So on some hardware, the gl precompositor may not actually
      initialize due to hardware missing features, or the hardware
      supporting different shader APIs.
      
      Rather then try to rework the drm_hwcomposers precompositor
      to be more generic, I instead suggest that when the
      precompositor fails to initialize, we simply fall back to the
      already more widely compatible client compositor in
      SurfaceFlinger.
      
      Thus, this patch cleans up some of the precompositor
      initialization, which didn't handle failures well.
      
      Cc: Marissa Wall <marissaw@google.com>
      Cc: Sean Paul <seanpaul@google.com>
      Cc: Dmitry Shmidt <dimitrysh@google.com>
      Cc: Robert Foss <robert.foss@collabora.com>
      Cc: Matt Szczesiak <matt.szczesiak@arm.com>
      Cc: Liviu Dudau <Liviu.Dudau@arm.com>
      Cc: David Hanna <david.hanna11@gmail.com>
      Cc: Rob Herring <rob.herring@linaro.org>
      Cc: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
      Cc: Alistair Strachan <astrachan@google.com>
      Reviewed-by: Rob Herring's avatarRob Herring <robh@kernel.org>
      Signed-off-by: John Stultz's avatarJohn Stultz <john.stultz@linaro.org>
      3b0c69d3
    • John Stultz's avatar
      drm_hwcomposer: Use log/log.h instead of cutils/log.h · 9057a6fc
      John Stultz authored
      
      
      When enabling Treble, Android builds are complaining about using
      cutils/log.h so instead use log/log.h
      
      Cc: Marissa Wall <marissaw@google.com>
      Cc: Sean Paul <seanpaul@google.com>
      Cc: Dmitry Shmidt <dimitrysh@google.com>
      Cc: Robert Foss <robert.foss@collabora.com>
      Cc: Matt Szczesiak <matt.szczesiak@arm.com>
      Cc: Liviu Dudau <Liviu.Dudau@arm.com>
      Cc: David Hanna <david.hanna11@gmail.com>
      Cc: Rob Herring <rob.herring@linaro.org>
      Cc: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
      Cc: Alistair Strachan <astrachan@google.com>
      Signed-off-by: John Stultz's avatarJohn Stultz <john.stultz@linaro.org>
      9057a6fc
    • Sumit Semwal's avatar
      drm_hwcomposer: Andorid.mk : Mark libdrmhwc_utils as vendor module · 94bb596e
      Sumit Semwal authored
      
      
      To allow drm_hwcomposer to build with Treble, set
      the libdrmhwc_utils library as a vendor module.
      
      Cc: Marissa Wall <marissaw@google.com>
      Cc: Sean Paul <seanpaul@google.com>
      Cc: Dmitry Shmidt <dimitrysh@google.com>
      Cc: Robert Foss <robert.foss@collabora.com>
      Cc: Matt Szczesiak <matt.szczesiak@arm.com>
      Cc: Liviu Dudau <Liviu.Dudau@arm.com>
      Cc: David Hanna <david.hanna11@gmail.com>
      Cc: Rob Herring <rob.herring@linaro.org>
      Cc: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
      Cc: Alistair Strachan <astrachan@google.com>
      Signed-off-by: Sumit Semwal's avatarSumit Semwal <sumit.semwal@linaro.org>
      [jstultz: commit message tweaks]
      Signed-off-by: John Stultz's avatarJohn Stultz <john.stultz@linaro.org>
      94bb596e
  10. 17 Apr, 2018 2 commits
  11. 04 Apr, 2018 1 commit
  12. 22 Mar, 2018 1 commit
  13. 14 Mar, 2018 1 commit
    • John Stultz's avatar
      drm_hwcomposer: Add platformhisi buffer importer for hikey and hikey960 · 499db604
      John Stultz authored
      
      
      This allows for importing buffers allocated from the
      hikey and hikey960 gralloc implementations.
      
      Cc: Marissa Wall <marissaw@google.com>
      Cc: Sean Paul <seanpaul@google.com>
      Cc: Dmitry Shmidt <dimitrysh@google.com>
      Cc: Robert Foss <robert.foss@collabora.com>
      Cc: Matt Szczesiak <matt.szczesiak@arm.com>
      Cc: Liviu Dudau <Liviu.Dudau@arm.com>
      Cc: David Hanna <david.hanna11@gmail.com>
      Cc: Rob Herring <rob.herring@linaro.org>
      Cc: Alexandru-Cosmin Gheorghe <Alexandru-Cosmin.Gheorghe@arm.com>
      Cc: Alistair Strachan <astrachan@google.com>
      Acked-by: default avatarRobert Foss <robert.foss@collabora.com>
      Signed-off-by: John Stultz's avatarJohn Stultz <john.stultz@linaro.org>
      499db604
  14. 28 Feb, 2018 2 commits
  15. 14 Feb, 2018 1 commit
  16. 24 Jan, 2018 1 commit
    • John Stultz's avatar
      drm_hwcomposer: Make sure we set the active state when doing modesets · b365b792
      John Stultz authored and Sean Paul's avatar Sean Paul committed
      
      
      In trying to use drm_hwcomposer with HiKey/HiKey960 boards, I
      found that the crtc wouldn't intitalize and the atomic commit
      calls were failing.
      
      I initially chased this down to following check in the kernel
      drm_atomic_crtc_check() function failing:
      
       if (state->event && !state->active && !crtc->state->active) {
           DRM_DEBUG_ATOMIC("[CRTC:%d:%s] requesting event but off\n",
                            crtc->base.id, crtc->name);
           return -EINVAL;
       }
      
      Where because a fence was submitted state->event was set, but
      the crtc state was not active. This results in the atomic commit
      to fail and no mode to be set.
      
      After hacking around this in the kernel, Sean Paul helped me
      understand that it was the kernel complaining about the crtc
      state being provided in the atomic commit which did not have the
      active flag set.
      
      Thus, the proper fix is to make sure when we do the modesetting
      that we also set the crtc state active flag in property set.
      
      With this change, the kernel no longer rejects the atomic commit
      and the crtc initializes properly.
      
      Cc: Marissa Wall <marissaw@google.com>
      Cc: Sean Paul <seanpaul@google.com>
      Cc: Dmitry Shmidt <dimitrysh@google.com>
      Cc: Robert Foss <robert.foss@collabora.com>
      Cc: Matt Szczesiak <matt.szczesiak@arm.com>
      Cc: Liviu Dudau <Liviu.Dudau@arm.com>
      Cc: David Hanna <david.hanna11@gmail.com>
      Cc: Rob Herring <rob.herring@linaro.org>
      Signed-off-by: John Stultz's avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: Sean Paul's avatarSean Paul <seanpaul@chromium.org>
      b365b792
  17. 09 Jan, 2018 1 commit
  18. 30 Nov, 2017 1 commit