drm_hwcomposer: platformdrmgeneric: Handle closing gem_handles if we have duplicate handles

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 <john.stultz@linaro.org>
1 file changed
tree: cfb12aa40bd64d73b322c30ea4b34be73cf331df
  1. tests/
  2. .clang-format
  3. .gitlab-ci.yml
  4. Android.mk
  5. autofd.h
  6. autolock.cpp
  7. autolock.h
  8. drmconnector.cpp
  9. drmconnector.h
  10. drmcrtc.cpp
  11. drmcrtc.h
  12. drmdisplaycomposition.cpp
  13. drmdisplaycomposition.h
  14. drmdisplaycompositor.cpp
  15. drmdisplaycompositor.h
  16. drmencoder.cpp
  17. drmencoder.h
  18. drmeventlistener.cpp
  19. drmeventlistener.h
  20. drmframebuffer.h
  21. drmhwcgralloc.h
  22. drmhwcomposer.h
  23. drmhwctwo.cpp
  24. drmhwctwo.h
  25. drmmode.cpp
  26. drmmode.h
  27. drmplane.cpp
  28. drmplane.h
  29. drmproperty.cpp
  30. drmproperty.h
  31. drmresources.cpp
  32. drmresources.h
  33. hwcutils.cpp
  34. MODULE_LICENSE_APACHE2
  35. NOTICE
  36. platform.cpp
  37. platform.h
  38. platformdrmgeneric.cpp
  39. platformdrmgeneric.h
  40. platformhisi.cpp
  41. platformhisi.h
  42. platformminigbm.cpp
  43. platformminigbm.h
  44. README.md
  45. vsyncworker.cpp
  46. vsyncworker.h
  47. worker.cpp
  48. worker.h
README.md

drm_hwcomposer

Patches to drm_hwcomposer are very much welcome, we really want this to be the universal HW composer implementation for Android and similar platforms So please bring on porting patches, bugfixes, improvements for documentation and new features.

A short list of contribution guidelines:

  • Submit changes via gitlab merge requests on gitlab.freedesktop.org

  • drm_hwcomposer is Apache 2.0 Licensed and we require contributions to follow the developer's certificate of origin: http://developercertificate.org/

  • When submitting new code please follow the naming conventions documented in the generated documentation. Also please make full use of all the helpers and convenience macros provided by drm_hwcomposer. The below command can help you with formatting of your patches:

    `git diff | clang-format-diff-3.5 -p 1 -style=file`
    
  • Hardware specific changes should be tested on relevant platforms before committing.

If you need inspiration, please checkout our TODO issues

Happy hacking!