egl/android: fix regression in drm_gralloc path (v2)
authorMauro Rossi <issor.oruam@gmail.com>
Tue, 14 Aug 2018 13:10:54 +0000 (15:10 +0200)
committerMauro Rossi <issor.oruam@gmail.com>
Wed, 15 Aug 2018 12:07:49 +0000 (14:07 +0200)
commit73b342c7a52a93d283799800824311639f372de0
tree350a44fca9ed58fdc357a3f5e80e3101bd795c31
parent656ccf4ef890b91debbb72b38957723ca04411d0
egl/android: fix regression in drm_gralloc path (v2)

This patch fixes a regression in mesa 18.2 and mesa-dev branches
for HAVE_DRM_GRALLOC code path which is causing black screen on Android
and prevents boot due to SIGSEGV MAPERR crash related to unproper handling
of drm_gralloc drm FD in new droid_open_device() path.

Problem is due to c7bb82136b ("egl/android: Add DRM node probing and filtering")

To avoid the crash the former existing working droid_open_device() is restored,
renamed droid_open_device_drm_gralloc() and kept within HAVE_DRM_GRALLOC braces.

Tested with mesa-dev and mesa 18.2 branch and oreo-x86 bootanimation
and Androdi GUI booting is fixed with i965, nouveau, radeon.
The changes are compatible with gbm_gralloc, I've tested build with hwc too.

(v2) remove indentation from HAVE_DRM_GRALLOC pre-processor directive

NOTE: Definition of enum{} for GRALLOC_MODULE_PERFORM_GET_DRM_FD
is not necessary and it's actually causing a redefinition building error,
because in HAVE_DRM_GRALLOC path gralloc_drm.h is already exported
by libgralloc_drm which is currently still a dependency.

Fixes: c7bb82136b ("egl/android: Add DRM node probing and filtering")
Cc: "18.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
src/egl/drivers/dri2/platform_android.c