[Mesa-dev] egl/android: fence_fd being forced to -1

Eric Engestrom eric.engestrom at imgtec.com
Thu Jun 15 13:59:48 UTC 2017


On Thursday, 2017-06-15 13:27:06 +0000, Marathe, Yogesh wrote:
> Hello,
> 
> I'm tyring to run flatland native app on android. It apparantly fails because of a fence issue. 
> while debuging further it is observed that droid_window_enqueue_buffer() is forcing 
> fence_fd =-1.

I assume you've read the comment on the line above the one you mentioned?

   /* Queue the buffer without a sync fence. This informs the ANativeWindow
    * that it may access the buffer immediately.
    *
    * From ANativeWindow::dequeueBuffer:
    *
    *    The fenceFd argument specifies a libsync fence file descriptor for
    *    a fence that must signal before the buffer can be accessed.  If
    *    the buffer can be accessed immediately then a value of -1 should
    *    be used.  The caller must not use the file descriptor after it
    *    is passed to queueBuffer, and the ANativeWindow implementation
    *    is responsible for closing it.
    */
   int fence_fd = -1;
   dri2_surf->window->queueBuffer(dri2_surf->window, dri2_surf->buffer,
                                  fence_fd);

> Whats the expectation here if app wants to use fence sync? 
> 
> If we want to have this native app working with the lib where exactly fence should be 
> created / populated, it should be with buffer producer, right?

I don't know this code personally, so I Cc'ed Chad, who wrote this code
in commit bfe28b8d93 (albeit 5 years ago, so he might not remember all
of it) and Tapani who reviewed it.

> 
> BTW, We can't/ don't want to change the flatland app!
> 
> Regards,
> Yogesh.
> 


More information about the mesa-dev mailing list