On 2/19/26 01:15, Yicong Hui wrote:
>> Instead add some additional flag to DRM_SYNCOBJ_WAIT_FLAGS_* so that the 
>> IOCTL aborts the wait and returns an error as soon as it sees any fence with 
>> an error.
> 
>> Another DRM_SYNCOBJ_QUERY_FLAGS_* is potentially also useful to query the 
>> error on a number of drm_syncobjs at the same time.
> 
>> Using a new DRM_SYNCOBJ_QUERY_FLAGS_ERROR on all signaled syncobj as 
>> separate way to query if there was an error should work for you in the 
>> meantime?
> 
>> @Yicong any more questions or do you got the idea?
> 
> So to confirm, I should implement a flag DRM_SYNCOBJ_WAIT_FLAGS_ERROR which 
> would make the DRM_IOCTL_SYNCOBJ_WAIT ioctl just wait until any fence returns 
> an error, then return the error code of that syncobj/fence's first error, and 
> then return 0 if everything completes without any errors?

Correct, yes. I mean the name of the flag can probably be improved, my 
suggestion is DRM_SYNCOBJ_WAIT_FLAGS_ABORT_ON_ERROR, but in general you seem to 
got the idea.

> and add flag DRM_SYNCOBJ_QUERY_FLAGS_ERROR which would make the 
> DRM_IOCTL_SYNCOBJ_QUERY ioctl fill out the points array with the error codes 
> of each syncobj instead of the latest timeline point? Should it leave the 
> entry as 0 for syncobjs with no error or leave it as it would be without the 
> flag? And if it has multiple fences with errors it should just return the 
> latest error right?

Well I would fill in the handles array with the error codes, this way you can 
return both the signaled point as well as the error at the same time. For this 
you would just need to document very clearly that the handles array now has a 
double functionality.

I think it is sufficient to return the first error found. We don't need to make 
it to complicated.

>> Good point, poll() has a POLLERR flag for that but I have no idea if eventfd 
>> supports that in any way. So potentially doable as well but a bit more work.
> Okay, that sounds like somewhere I could potentially implement similar 
> functionality for poll() in a follow-up patch later in the future

Yeah, agree. That is a nice to have functionality to allow mutter to avoid an 
extra IOCTL to check for errors in the most common case, but it is certainly a 
second step and a bit more complicated than the initial task.

Regards,
Christian.

> 
> Thank you!
> - Yicong
>  

Reply via email to