Import into mapper and native_handle_t life-cycle management issue.
According to https://source.android.com/devices/architecture/hidl/types#ownership we should clone native_handle_t in the hook callback to use outside the callback. In drm_hwc this doesn't happen at least explicitly.
PS: Another piece of the puzzle: https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/graphics/composer/2.1/utils/hal/include/composer-hal/2.1/ComposerCommandEngine.h;l=370;drc=bc51e0859645e71c399059e5db745b6e80e289f2
Also according to https://cs.android.com/android/platform/superproject/+/master:hardware/interfaces/graphics/mapper/2.0/IMapper.hal;l=85 we need to import_buffer into mapper only to it by mapper or by libraries which may use mapper.
In our case we do not use mapper and related libraries, and we have to import it only for metadata4_bufferinfo getter and libdrm_bufferinfo getter.