<div dir="auto"><div>Hi Emil,<br><br><div class="gmail_quote"><div dir="ltr">Il Mer 15 Ago 2018, 13:16 Emil Velikov <<a href="mailto:emil.l.velikov@gmail.com">emil.l.velikov@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 15 August 2018 at 09:13, Mauro Rossi <<a href="mailto:issor.oruam@gmail.com" target="_blank" rel="noreferrer">issor.oruam@gmail.com</a>> wrote:<br>
> Hi Robert,<br>
> Il giorno mer 15 ago 2018 alle ore 09:37 Robert Foss<br>
> <<a href="mailto:robert.foss@collabora.com" target="_blank" rel="noreferrer">robert.foss@collabora.com</a>> ha scritto:<br>
>><br>
>> Hey Mauro,<br>
>><br>
>> Thanks for catching this.<br>
>><br>
>> On 14/08/2018 22.27, Mauro Rossi wrote:<br>
>> > This patch fixes a regression in mesa 18.2 and mesa-dev branches<br>
>> > for HAVE_DRM_GRALLOC code path which is causing black screen on Android<br>
>> > and prevents boot due to SIGSEGV MAPERR crash related to unproper<br>
>> > handling<br>
>> > of drm_gralloc drm FD in new droid_open_device() path.<br>
>> ><br>
>> > The problem due to c7bb82136b ("egl/android: Add DRM node probing and<br>
>> > filtering")<br>
>> ><br>
>> > ... 3173 3307 D GRALLOC-DRM: drmOpen radeon: 71<br>
>> > ... 3173 3307 I GRALLOC-RADEON: detected chipset 0x6841 family 0x31<br>
>> > (vram size 238MiB, gart size 1021MiB)<br>
>> > ... 3173 3307 I GRALLOC-DRM: create radeon for driver radeon<br>
>> > ... 3173 3307 W EGL-MAIN: Could not get native buffer FD<br>
>> > --------- beginning of crash<br>
>> > ... 3173 3307 F libc : Fatal signal 11 (SIGSEGV), code 1, fault<br>
>> > addr 0x18 in tid 3307 (RenderThread), pid 3173 (ndroid.systemui)<br>
>> > ... 0 0 D : [drm:radeon_crtc_page_flip_target [radeon]]<br>
>> > flip-ioctl() cur_rbo = 000000003512328a, new_rbo = 000000<br>
>> > ... 3420 3420 I crash_dump64: performing dump of process 3173 (target<br>
>> > tid = 3307)<br>
>> > ... 3420 3420 F DEBUG : *** *** *** *** *** *** *** *** *** *** ***<br>
>> > *** *** *** *** ***<br>
>> > ... 3420 3420 F DEBUG : Build fingerprint:<br>
>> > 'Android-x86/android_x86_64/x86_64:8.1.0/OPM6.171019.030.E1/uten07210645:userdebug/test-keys'<br>
>> > ... 3420 3420 F DEBUG : Revision: '0'<br>
>> > ... 3420 3420 F DEBUG : ABI: 'x86_64'<br>
>> > ... 3420 3420 F DEBUG : pid: 3173, tid: 3307, name: RenderThread<br>
>> > >>> com.android.systemui <<<<br>
>> > ... 3420 3420 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR),<br>
>> > fault addr 0x18<br>
>> > ... 3420 3420 F DEBUG : Cause: null pointer dereference<br>
>> > ... 3420 3420 F DEBUG : rax 0000000000000000 rbx<br>
>> > 00007c6ac3a3eee0 rcx 0000000000000000 rdx 0000000000000038<br>
>> > ... 3420 3420 F DEBUG : rsi 0000000000000000 rdi<br>
>> > 00007c6ab5bfeaa0<br>
>> > ... 3420 3420 F DEBUG : r8 00007c6ab04c16e4 r9<br>
>> > 00007c6b4ee6a220 r10 0000000000000000 r11 0000000000000200<br>
>> > ... 3420 3420 F DEBUG : r12 0000000000000000 r13<br>
>> > 0000000000000000 r14 0000000000000001 r15 00007c6ab04c1600<br>
>> > ... 3420 3420 F DEBUG : cs 0000000000000033 ss<br>
>> > 000000000000002b<br>
>> > ... 3420 3420 F DEBUG : rip 00007c6ab0cee444 rbp<br>
>> > 00007c6ac3ae8400 rsp 00007c6ab5bfea80 eflags 0000000000010246<br>
>> > ... 3420 3420 F DEBUG :<br>
>> > ... 3420 3420 F DEBUG : backtrace:<br>
>> > ... 3420 3420 F DEBUG : #00 pc 000000000056b444<br>
>> > /system/vendor/lib64/dri/gallium_dri.so (st_update_framebuffer_state+660)<br>
>> > ... 3420 3420 F DEBUG : #01 pc 0000000000569d61<br>
>> > /system/vendor/lib64/dri/gallium_dri.so (st_validate_state+561)<br>
>> > ... 3420 3420 F DEBUG : #02 pc 0000000000572374<br>
>> > /system/vendor/lib64/dri/gallium_dri.so (st_Clear+116)<br>
>> > ... 3420 3420 F DEBUG : #03 pc 000000000004a9c0<br>
>> > /android/system/lib64/libhwui.so<br>
>> > ... 3420 3420 F DEBUG : #04 pc 0000000000085cab<br>
>> > /android/system/lib64/libhwui.so<br>
>> > ... 3420 3420 F DEBUG : #05 pc 0000000000085f31<br>
>> > /android/system/lib64/libhwui.so<br>
>> > ... 3420 3420 F DEBUG : #06 pc 000000000006e8c1<br>
>> > /android/system/lib64/libhwui.so<br>
>> > ... 3420 3420 F DEBUG : #07 pc 000000000006e3d9<br>
>> > /android/system/lib64/libhwui.so<br>
>> > ... 3420 3420 F DEBUG : #08 pc 000000000006c4e3<br>
>> > /android/system/lib64/libhwui.so<br>
>> > ... 3420 3420 F DEBUG : #09 pc 00000000000704c8<br>
>> > /android/system/lib64/libhwui.so<br>
>> > ... 3420 3420 F DEBUG : #10 pc 0000000000077fb9<br>
>> > /android/system/lib64/libhwui.so<br>
>> > ... 3420 3420 F DEBUG : #11 pc 00000000000117fa<br>
>> > /android/system/lib64/libutils.so<br>
>> > ... 3420 3420 F DEBUG : #12 pc 00000000000ba193<br>
>> > /android/system/lib64/libandroid_runtime.so<br>
>> > ... 3420 3420 F DEBUG : #13 pc 0000000000079f0b<br>
>> > /android/system/lib64/libc.so<br>
>> > ... 3420 3420 F DEBUG : #14 pc 0000000000028c5d<br>
>> > /android/system/lib64/libc.so<br>
>> > ... 3420 3420 F DEBUG : #15 pc 0000000000027555<br>
>> > /android/system/lib64/libc.so<br>
>> ><br>
>> > To avoid the crash the former existing working droid_open_device() is<br>
>> > restored,<br>
>> > renamed droid_open_device_drm_gralloc() and kept within HAVE_DRM_GRALLOC<br>
>> > braces.<br>
>> ><br>
>> > NOTE: Definition of enum{} for GRALLOC_MODULE_PERFORM_GET_DRM_FD<br>
>> > is not necessary and it is actually causing a redefinition building<br>
>> > error,<br>
>> > because in HAVE_DRM_GRALLOC path gralloc_drm.h is already exported<br>
>> > by libgralloc_drm which is currently still a dependency.<br>
>> ><br>
>> > Tested with mesa-dev and mesa 18.2 branch and oreo-x86 bootanimation<br>
>> > and Androdi GUI booting is fixed with i965, nouveau, radeon.<br>
>> ><br>
>> > The changes are compatible with gbm_gralloc, I've tested build with hwc<br>
>> > too.<br>
>><br>
>> I would maybe consider shortening the commit message a little bit, or at<br>
>> least<br>
>> remove<br>
>> the crash-logs.<br>
><br>
><br>
> Of course, I will reduce the final commit message.<br>
><br>
> The segfault log was provided as a mean to understand what went wrong,<br>
> in case you/other developers will pursue the goal of having one<br>
> droid_open_device() procedure<br>
> applicable to all gralloc implementation<br>
><br>
> and I will be available to test there is no regression on android-x86<br>
> drm_gralloc.<br>
<br>
Good call on having the crash log in the original submission. Extra<br>
information can trivially be removed ;-)<br>
With that and the small nitpick below the patch is:<br>
Reviewed-by: Emil Velikov <<a href="mailto:emil.velikov@collabora.com" target="_blank" rel="noreferrer">emil.velikov@collabora.com</a>><br>
<br>
Personally I won't bother re-sending the patch. Simply fixup locally and commit.<br>
<br>
>> ><br>
>> > + #ifdef HAVE_DRM_GRALLOC<br>
Please move this (and the else/endif) at the start of the line. We<br>
don't indent pre-processor directives in Mesa (modulo odd case that<br>
slipped).<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Thanks, I had the doubt about those indentations.</div><div dir="auto"><br></div><div dir="auto">I will send an additional patch to align HAVE_DRM_GRALLOC directives.</div><div dir="auto"><br></div><div dir="auto">Mauro</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks<br>
Emil<br>
</blockquote></div></div></div>