DRI3000 Status and Discussion
Total Page:16
File Type:pdf, Size:1020Kb
DRI3000 Status and Discussion Keith Packard Intel Open Source Technology Center [email protected] Discussion Areas ● DRI3 design and status ● Present status ● Synchronization between X and DRM ● Present Redirection DRI3 Requirements ● Share DMA bufs as X pixmaps ● Share synchronization objects ● Provide access to correct DRM device DRI3 Status ● Finished – X Protocol, XCB binding – Mesa DRI3 loader, GLX API – X server – Intel Mesa and 2D driver ● To Do – EGL API – X server GL loader ● Needs more test cases DRI3 Extension ● Open – X server opens DRM device – Prepares for rendering – Passes resulting FD back to client – Can transparently c!ange to using Render "odes ● Pix#apFro#$uffer – Client creates DRM ob%ect – Maps to DM&$uf – Passes DM&$uf FD to X server – X server creates pixmap referencing sa#e DRM ob%ect ● $ufferFro#Pix#ap – X server #aps Pixmap DRM ob%ect to DM&$uf – Passes DM&$uf FD to client – Client unwraps DM&$uf to get DRM ob%ect ● FenceFro#FD – Client allocates anon #ous file 'it! a single page containing futex – Passes FD to X server – X server #aps (le and creates an XSyncFence ob%ect pointing at it* Present Extension ● PresentPixmap – Provide ne' content for windo' in a pixmap ● PresentNotifyMSC – Returns current media counters in an event ● PresentSelectInput – )elects for Present events ● PresentIdle"otify – Event sent w!en pixmap is free for re+use ● PresentCon(gure"otify – Event sent w!en 'indow si,e changes ● PresentComplete"otify – Event sent w!en PresentRegion operation completes PresentPixmap ● Para#eters- – serial – client+provided nu#ber returned in matc!ing PresentCo#plete"otif – valid+area – Region of pix#ap containing correct pixels – update+area – Region of pix#ap containing c!anged pixels – x+off, y+off – offset wit!in windo' for operation – 'ait+fence – S ncFence w!ic! blocks execution – options – Set of flags to control execution – target+#sc, divisor, re#ainder – para#eters de(ning displa time – options – cut+t!roug!, force cop – 1ist of windo'/serial to notif ● )upports vblank sync!ronized sub-window updates* ● &llow flips even for s#all updates ● )eparate out completion event from buffer idle event Previous “PresentRegion” ● 5!at's in git toda ● "o 6wait_fence6 – Re8uires i#plicit s nc!roni,ation bet'een DRM client and X server ● 'idle7fence6 – )ee discussion on dealing 'it! idle buffers ● "o options – force applications to support 0ipping ● "o list of windo'2serial for noti(cation – "eeded for redirection XCB changes ● FD passing – use recv#sg ever '!ere – Stick incoming Fds in reply structure ● 3Special” event 8ueues – Split off Present events to special queue – Bu#p pointer to integer to make c!ecking for events c!eap (and Mesa compatible) Media Stream Counters ● Monotonic fra#e counter ● C!allenges- – )'itc!ing monitors – DPM) off – )uspend2resu#e – ;< s'itc! ● Current design – Pick a counter for eac! 'indo' – Create a fake counter as needed – Per+'indo' counter is offset fro# underl ing counter – Counters ad%usted on transition ● Not 'orking 'it! DPM)2suspend et – events 8ueued to kernel never !appen – redesign to ignore 8ueued events ● Ho' fast s!ould t!e fake counter run> – <!inking about ?=,> Present Status ● First protocol version finished – Initial protocol, XCB and Xlib bindings – Mesa loader, GLX API, various GL/GLX extensions – X server DIX – Intel Mesa, 2D driver ● Second protocol proposal – Adds wait-fence – Adds options ● To Do – Add more synchronization – Add redirect – Think about YUV? DRM SyncFences ● Currently implemented with futexes – X/DRM details are hidden in video driver ● Not select/poll friendly – X server cannot be awoken when fence is signaled via futex API. SyncFence adventures ● Original design included per-pixmap idle fence ● Client wants to wait for any idle fence ● Current implementation guesses which is likely to become idle. ● Can cause deadlocks ● Need to wait for one of a set of fences somehow ● Plan to use events instead of fences Present Redirection ● Busy implementing simplest possible plan – Effectively forward PresentPixmap request and let compositor sort it out. ● Want more complicated mechanism (I think) – Over-allocate to page-align – What about auto-painting window manager frames? .