OSDN Git Service

drm_hwcomposer: platformdrmgeneric: Handle closing gem_handles if we have duplicate...
authorJohn Stultz <john.stultz@linaro.org>
Fri, 1 Jun 2018 00:46:50 +0000 (17:46 -0700)
committerJohn Stultz <john.stultz@linaro.org>
Thu, 14 Jun 2018 17:47:14 +0000 (10:47 -0700)
commit53cb4ef4da1ad4c3cb1d138cf8d05f988b304a0d
treecfb12aa40bd64d73b322c30ea4b34be73cf331df
parent1542d29a538683250b818922527aec33774c793b
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>
platformdrmgeneric.cpp