The source project of this merge request has been removed.
panfrost: Fix Bo imports to not take the process down if fd is invalid
If the calling process happens to use an invalid bo (e.g. fd has been closed), this led to lseek() returning -1 and this mmap trying to mmap a buffer of size -1 (0xffffffffffffffff ...) which led to mmap failing, which led to munmap failing which then led to the process aborting.
This fixes that to gracefully handle the mmap failures and percolate the failures back up through the API so eglCreateImage will not return a valid image anymore, thus the error is detectable in the caller process too.
Edited by Carsten Haitzler