102f4aeb0Sopenharmony_ciName 202f4aeb0Sopenharmony_ci 302f4aeb0Sopenharmony_ci NV_stream_flush 402f4aeb0Sopenharmony_ci 502f4aeb0Sopenharmony_ciName Strings 602f4aeb0Sopenharmony_ci 702f4aeb0Sopenharmony_ci EGL_NV_stream_flush 802f4aeb0Sopenharmony_ci 902f4aeb0Sopenharmony_ciContributors 1002f4aeb0Sopenharmony_ci 1102f4aeb0Sopenharmony_ci Santanu Thangaraj 1202f4aeb0Sopenharmony_ci Daniel Kartch 1302f4aeb0Sopenharmony_ci 1402f4aeb0Sopenharmony_ciContacts 1502f4aeb0Sopenharmony_ci 1602f4aeb0Sopenharmony_ci Santanu Thangaraj, NVIDIA (sthangaraj 'at' nvidia.com) 1702f4aeb0Sopenharmony_ci 1802f4aeb0Sopenharmony_ciStatus 1902f4aeb0Sopenharmony_ci 2002f4aeb0Sopenharmony_ci Draft 2102f4aeb0Sopenharmony_ci 2202f4aeb0Sopenharmony_ciVersion 2302f4aeb0Sopenharmony_ci 2402f4aeb0Sopenharmony_ci Version 3 - April 11, 2018 2502f4aeb0Sopenharmony_ci 2602f4aeb0Sopenharmony_ciNumber 2702f4aeb0Sopenharmony_ci 2802f4aeb0Sopenharmony_ci 127 2902f4aeb0Sopenharmony_ci 3002f4aeb0Sopenharmony_ciExtension Type 3102f4aeb0Sopenharmony_ci 3202f4aeb0Sopenharmony_ci EGL display extension 3302f4aeb0Sopenharmony_ci 3402f4aeb0Sopenharmony_ciDependencies 3502f4aeb0Sopenharmony_ci 3602f4aeb0Sopenharmony_ci Requires the EGL_KHR_stream extension. 3702f4aeb0Sopenharmony_ci 3802f4aeb0Sopenharmony_ci Requires either the EGL_KHR_stream_cross_process_fd or 3902f4aeb0Sopenharmony_ci EGL_NV_stream_remote extensions. 4002f4aeb0Sopenharmony_ci 4102f4aeb0Sopenharmony_ci This extension is written based on the wording of version 27 of 4202f4aeb0Sopenharmony_ci the EGL_KHR_stream extension. 4302f4aeb0Sopenharmony_ci 4402f4aeb0Sopenharmony_ciOverview: 4502f4aeb0Sopenharmony_ci 4602f4aeb0Sopenharmony_ci The EGL_KHR_stream_cross_process_fd and EGL_NV_stream_remote 4702f4aeb0Sopenharmony_ci extensions do not guarantee that when the state of the EGLStream 4802f4aeb0Sopenharmony_ci object representing one endpoint of the stream changes, 4902f4aeb0Sopenharmony_ci the state of the other endpoint will immediately reflect 5002f4aeb0Sopenharmony_ci that change. Depending on the implementation, there may be some 5102f4aeb0Sopenharmony_ci latency in the propagation of state changes. 5202f4aeb0Sopenharmony_ci 5302f4aeb0Sopenharmony_ci This latency will not affect any applications which rely solely 5402f4aeb0Sopenharmony_ci on the stream itself for communication. State changes made on 5502f4aeb0Sopenharmony_ci one side will eventually be visible on the other side, 5602f4aeb0Sopenharmony_ci and can then be responded to. 5702f4aeb0Sopenharmony_ci 5802f4aeb0Sopenharmony_ci This only affects applications which use some additional means of 5902f4aeb0Sopenharmony_ci communication outside of the stream itself, which may encounter 6002f4aeb0Sopenharmony_ci race conditions. In particular, if an application inserts a frame 6102f4aeb0Sopenharmony_ci into a stream, then sends a message to the other side indicating 6202f4aeb0Sopenharmony_ci that the frame is ready, the other side may encounter an error if 6302f4aeb0Sopenharmony_ci it tries to acquire the frame and it is not yet available. 6402f4aeb0Sopenharmony_ci 6502f4aeb0Sopenharmony_ci One solution is to force all operations that change state of one 6602f4aeb0Sopenharmony_ci endpoint to behave synchronously, and not return until the change 6702f4aeb0Sopenharmony_ci is reflected on the other endpoint. However this adds undesirable 6802f4aeb0Sopenharmony_ci delays for the majority of applications and operations where such 6902f4aeb0Sopenharmony_ci synchronization is not required. This extension instead provides 7002f4aeb0Sopenharmony_ci a means for applications to explicitly invoke such 7102f4aeb0Sopenharmony_ci synchronization only where required. 7202f4aeb0Sopenharmony_ci 7302f4aeb0Sopenharmony_ciNew types 7402f4aeb0Sopenharmony_ci 7502f4aeb0Sopenharmony_ci None 7602f4aeb0Sopenharmony_ci 7702f4aeb0Sopenharmony_ciNew Procedures and functions 7802f4aeb0Sopenharmony_ci 7902f4aeb0Sopenharmony_ci EGLBoolean eglStreamFlushNV( 8002f4aeb0Sopenharmony_ci EGLDisplay dpy, 8102f4aeb0Sopenharmony_ci EGLStreamKHR stream); 8202f4aeb0Sopenharmony_ci 8302f4aeb0Sopenharmony_ciNew Tokens 8402f4aeb0Sopenharmony_ci 8502f4aeb0Sopenharmony_ci None 8602f4aeb0Sopenharmony_ci 8702f4aeb0Sopenharmony_ciAdd a new subsection "3.10.x EGLStream flush" at the end of section 8802f4aeb0Sopenharmony_ci"3.10 EGLStreams" in EGL_KHR_stream extension. 8902f4aeb0Sopenharmony_ci 9002f4aeb0Sopenharmony_ci The command 9102f4aeb0Sopenharmony_ci 9202f4aeb0Sopenharmony_ci EGLBoolean eglStreamFlushNV( 9302f4aeb0Sopenharmony_ci EGLDisplay dpy, 9402f4aeb0Sopenharmony_ci EGLStreamKHR stream); 9502f4aeb0Sopenharmony_ci 9602f4aeb0Sopenharmony_ci When called with either producer or consumer endpoint of the 9702f4aeb0Sopenharmony_ci stream, will block until any state changes made to this endpoint 9802f4aeb0Sopenharmony_ci prior to the call are visible on the EGLStream object of the other 9902f4aeb0Sopenharmony_ci endpoint. 10002f4aeb0Sopenharmony_ci 10102f4aeb0Sopenharmony_ci On success, EGL_TRUE will be returned. On failure, EGL_FALSE will 10202f4aeb0Sopenharmony_ci be returned and an error will be generated. 10302f4aeb0Sopenharmony_ci 10402f4aeb0Sopenharmony_ci - EGL_BAD_STREAM_KHR is generated if <stream> is not a valid 10502f4aeb0Sopenharmony_ci EGLStream. 10602f4aeb0Sopenharmony_ci 10702f4aeb0Sopenharmony_ci - EGL_BAD_STATE_KHR is generated if <stream> is in 10802f4aeb0Sopenharmony_ci EGL_STREAM_STATE_DISCONNECTED_KHR state. 10902f4aeb0Sopenharmony_ci 11002f4aeb0Sopenharmony_ci - EGL_BAD_DISPLAY is generated if <dpy> is not a valid 11102f4aeb0Sopenharmony_ci EGLDisplay. 11202f4aeb0Sopenharmony_ci 11302f4aeb0Sopenharmony_ci - EGL_NOT_INITIALIZED is generated if <dpy> is not initialized. 11402f4aeb0Sopenharmony_ci 11502f4aeb0Sopenharmony_ciIssues 11602f4aeb0Sopenharmony_ci 11702f4aeb0Sopenharmony_ci 1. When both producer and consumer are connected to a single 11802f4aeb0Sopenharmony_ci EGLStream object, what happens when eglStreamFlushNV is called? 11902f4aeb0Sopenharmony_ci 12002f4aeb0Sopenharmony_ci RESOLVED: The function returns without any blocking. 12102f4aeb0Sopenharmony_ci 12202f4aeb0Sopenharmony_ciRevision History 12302f4aeb0Sopenharmony_ci 12402f4aeb0Sopenharmony_ci #3 (April 11, 2018) Jon Leech 12502f4aeb0Sopenharmony_ci - Add missing NV suffix to eglStreamFlushNV 12602f4aeb0Sopenharmony_ci 12702f4aeb0Sopenharmony_ci #2 (April 2, 2018) Santanu Thangaraj 12802f4aeb0Sopenharmony_ci - Update based on comments from Daniel Kartch 12902f4aeb0Sopenharmony_ci - General cleanup 13002f4aeb0Sopenharmony_ci 13102f4aeb0Sopenharmony_ci #1 (March 26, 2018) Santanu Thangaraj 13202f4aeb0Sopenharmony_ci - Initial draft 133