1Name 2 3 INTEL_swap_event 4 5Name Strings 6 7 GLX_INTEL_swap_event 8 9Contact 10 11 Jesse Barnes, Intel Corporation (jesse.barnes 'at' intel.com) 12 13Contributors 14 15 Kristian Høgsberg (kristian.h.kristensen 'at' intel.com) 16 Ian Romanick (ian.d.romanick 'at' intel.com) 17 18Status 19 20 Proof of concept implementation available for the Intel stack. 21 22Version 23 24 Last Modified Date: May 3, 2011 25 26Number 27 28 384 29 30Dependencies 31 32 GLX 1.3 is required. 33 OML_sync_control affects the definition of this extension. 34 35Overview 36 37 This extension adds a new event type, GLX_BUFFER_SWAP_COMPLETE_INTEL, 38 which is sent to the client via the X11 event stream and 39 selected/consumed by the normal GLX event mask mechanisms, to indicate 40 when a previously queued swap has completed. 41 42New Procedures and Functions 43 44 None 45 46New Tokens 47 48 Accepted by the <mask> parameter of glXSelectEvent and returned 49 in the <mask> parameter of glXGetSelectedEvent: 50 51 GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 52 53 Returned in the <event_type> field of a "swap complete" event: 54 55 GLX_EXCHANGE_COMPLETE_INTEL 0x8180 56 GLX_COPY_COMPLETE_INTEL 0x8181 57 GLX_FLIP_COMPLETE_INTEL 0x8182 58 59Additions to Chapter 2 of the 1.4 Specification (OpenGL Operation) 60 61 None 62 63Additions to Chapter 3 of the 1.4 Specification (Rasterization) 64 65 None 66 67Additions to Chapter 4 of the 1.4 Specification (Per-Fragment Operations 68and the Frame buffer) 69 70 None 71 72Additions to Chapter 5 of the 1.4 Specification (Special Functions) 73 74 None 75 76Additions to Chapter 6 of the 1.4 Specification (State and State Requests) 77 78 None 79 80Additions to the GLX Specification 81 82 [Add to section 3.3.8, Events] 83 84 A client can ask to receive swap complete GLX events on a window. 85 86 A swap buffer event has the following format: 87 88 typdef struct { 89 int event_type; /* GLX_EXCHANGE_COMPLETE_INTEL, 90 GLX_COPY_COMPLETE, GLX_FLIP_COMPLETE */ 91 unsigned long serial; /* # of last request processed by server */ 92 Bool send_event; /* event was generated by a SendEvent request */ 93 Display *display; /* display the event was read from */ 94 GLXDrawable drawable; /* i.d. of Drawable */ 95 CARD64 ust; /* UST from when the swap occurred */ 96 CARD64 msc; /* MSC from when the swap occurred */ 97 CARD64 sbc; /* SBC from when the swap occurred */ 98 } GLXBufferSwapEventINTEL; 99 100 When an event is received, the caller can determine what kind of swap 101 occurred by checking the event_type field. Simple pixmap exchanges are 102 reported with the GLX_EXCHANGE_COMPLETE_INTEL event type. If the swap 103 caused was performed with a blit from back to front, the event type will 104 be GLX_COPY_COMPLETE_INTEL. Finally, if the implementation was able to 105 perform a full screen page flip, GLX_FLIP_COMPLETE_INTEL is returned. 106 107 The mask field indicates which of the buffers in the drawable were swapped. 108 109 The MSC, SBC and UST are the OML triple indicating information about 110 when the swap occurred. 111 112GLX Protocol 113 114 One new event is added: 115 116 BEC is the base event code for the extension, as returned by 117 QueryExtension. 118 119 GLX_BUFFER_SWAP_COMPLETE_INTEL_INTEL 120 1 BEC+15 code 121 1 unused 122 2 CARD16 sequence number 123 2 CARD16 event_type 124 0x8180 GLX_EXCHANGE_COMPLETE_INTEL 125 0x8181 GLX_COPY_COMPLETE_INTEL 126 0x8182 GLX_FLIP_COMPLETE_INTEL 127 2 CARD16 unused 128 4 GLX_DRAWABLE drawable 129 8 CARD64 UST 130 8 CARD64 MSC 131 4 CARD32 SBC 132 133Errors 134 135 None 136 137New State 138 139 None 140 141New Implementation Dependent State 142 143 None 144 145Issues 146 147 1. Should the event return the frame and swap count for the last swap? 148 149 RESOLVED: YES. Also return a timestamp from when the swap occurred. 150 151 2. What is the difference between GLX_EXCHANGE_COMPLETE_INTEL, 152 GLX_COPY_COMPLETE_INTEL and GLX_FLIP_COMPLETE_INTEL from an app 153 perspective? 154 155 RESOLVED: Semantically, none. The fbconfig should describe whether 156 back buffer contents is preserved or not. These completion types are 157 purely informational and can be used in debugging new event based 158 code. 159 160Revision History 161 162 Version 1, 2009/11/10 - Initial spec 163 164 Version 2, 2009/11/16 - Fix reply size (should be 32 bytes to match X 165 replies), move issue list to end, change BLIT to COPY, return enum values 166 167 Version 3, 2010/1/6 - Fix reply to include padding to 32 bytes. Correct 168 replies to include _INTEL suffix to match extension name. Fix 'code' 169 portion of reply to be BEC+15. Remove open issue regarding mask and types. 170 Leave sbc in GLXBufferSwapEventINTEL as 64 bits to make interoperability 171 easier. 172 173 Version 4, 2010/1/11 - Number issues. Added issue #2 from James 174 Jones (Nvidia). 175 176 Version 5, 2010/1/14 - Word-wrap to 80-colums. Fix enum values and 177 mask value. (idr) 178 179 Version 6, 2010/1/20 - Update extension number and publish to the 180 Registry. 181 182 Version 7, 2011/5/3 - Update GLX protocol with correct enums and correct 183 location of padding. GLX protocol requires that CARD32 (and larger) be 184 4-byte aligned. Previously the drawable (and all later fields) were only 185 2-byte aligned. Most compilers would generally add padding in the correct 186 place anyway. (idr) 187