OSDN Git Service

minigbm: Make sure no mappings remain when closing a GEM handle
authorTomasz Figa <tfiga@chromium.org>
Tue, 8 Aug 2017 08:59:41 +0000 (17:59 +0900)
committerchrome-bot <chrome-bot@chromium.org>
Thu, 10 Aug 2017 12:16:23 +0000 (05:16 -0700)
commit27a7e6a24709564e18c3382d0aeda0b40c7ae03b
tree82545acb10637ea852f561cbabdcd95f672a4671
parent4df286c26c38888fdc39d705bc5499a92d56d3a4
minigbm: Make sure no mappings remain when closing a GEM handle

If we release the last reference and close the GEM handle, but we still
have an entry in the mapping map with such handle as the key, we can
experience a case when a new GEM is obtains the handle we just released
and next map attempt for the new GEM leads to the map entry for the old
buffer being used and wrong mappings being returned.

We ignore the nonsense gralloc API requirement to avoid crashing the
process in such case and simply assert() no mappings remaining when
last reference to the GEM is being dropped.

BUG=b:38250067
TEST=run cts -m CtsMediaTestCases on veyron_minnie without CL:*426529

Change-Id: Id36f55292bbded626af8cba56f4d8bf0603742fb
Reviewed-on: https://chromium-review.googlesource.com/605339
Commit-Ready: Tomasz Figa <tfiga@chromium.org>
Tested-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
drv.c