[Mesa-dev] [PATCH v5 2/2] i965: Queue the buffer with a sync fence for Android OS

Tomasz Figa tfiga at chromium.org
Fri Aug 4 13:10:08 UTC 2017


On Fri, Aug 4, 2017 at 12:21 PM, Marathe, Yogesh
<yogesh.marathe at intel.com> wrote:
>> >> >>  - version check (2+) the fence extension, calling
>> >> >> .create_fence_fd() only when
>> >> >> .get_capabilities() advertises __DRI_FENCE_CAP_NATIVE_FD
>> >
>> > The check looks like below now, this is in dri2_surf_update_fence_fd() before
>> create_fence_fd is called.
>> >
>> > if (dri2_surf->enable_out_fence && dri2_dpy->fence) {
>> >        if(__DRI_FENCE_CAP_NATIVE_FD |
>> > dri2_dpy->fence->get_capabilities(dri2_dpy->dri_screen)) {
>>
>> This doesn't make any sense, because non-zero OR whatever is always true. Did
>> you by any chance meant to use AND instead? Also please just extend the
>> condition of the first if, instead of nesting another under it for no reason.
>>
>
> Right. It must be '&', thanks for pointing out.
>
> On the nesting, I want to check dri2_dpy->fence is valid first before dri2_dpy->fence->(anything())
> can be called, so I believe that nesting can still be there. Rafael had that review comment.
> Do you still want to combine conditions in a single 'if'?

I'm not sure what's the problem with single if. The order of
evaluating conditions is strictly defined by C standard.

Best regards,
Tomasz


More information about the mesa-dev mailing list