mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
dri3: Add DRI3 extension
Adds DRM compatible fences using futexes. Uses FD passing to get pixmaps from DRM applications. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
32
Xext/sync.c
32
Xext/sync.c
@@ -141,7 +141,7 @@ SyncCheckWarnIsCounter(const SyncObject * pSync, const char *warning)
|
||||
* interested in the counter. The two functions below are used to
|
||||
* delete and add triggers on this list.
|
||||
*/
|
||||
static void
|
||||
void
|
||||
SyncDeleteTriggerFromSyncObject(SyncTrigger * pTrigger)
|
||||
{
|
||||
SyncTriggerList *pCur;
|
||||
@@ -184,7 +184,7 @@ SyncDeleteTriggerFromSyncObject(SyncTrigger * pTrigger)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
int
|
||||
SyncAddTriggerToSyncObject(SyncTrigger * pTrigger)
|
||||
{
|
||||
SyncTriggerList *pCur;
|
||||
@@ -916,6 +916,34 @@ SyncCreate(ClientPtr client, XID id, unsigned char type)
|
||||
return pSync;
|
||||
}
|
||||
|
||||
int
|
||||
SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL initially_triggered)
|
||||
{
|
||||
SyncFence *pFence;
|
||||
int status;
|
||||
|
||||
pFence = (SyncFence *) SyncCreate(client, id, SYNC_FENCE);
|
||||
if (!pFence)
|
||||
return BadAlloc;
|
||||
|
||||
status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered);
|
||||
if (status != Success) {
|
||||
miSyncDestroyFence(pFence);
|
||||
return status;
|
||||
}
|
||||
|
||||
if (!AddResource(id, RTFence, (pointer) pFence))
|
||||
return BadAlloc;
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
int
|
||||
SyncFDFromFence(ClientPtr client, DrawablePtr pDraw, SyncFence *pFence)
|
||||
{
|
||||
return miSyncFDFromFence(pDraw, pFence);
|
||||
}
|
||||
|
||||
static SyncCounter *
|
||||
SyncCreateCounter(ClientPtr client, XSyncCounter id, CARD64 initialvalue)
|
||||
{
|
||||
|
||||
@@ -136,4 +136,17 @@ extern void SyncDestroySystemCounter(pointer pCounter);
|
||||
|
||||
extern SyncCounter *SyncInitDeviceIdleTime(DeviceIntPtr dev);
|
||||
extern void SyncRemoveDeviceIdleTime(SyncCounter *counter);
|
||||
|
||||
int
|
||||
SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL initially_triggered);
|
||||
|
||||
int
|
||||
SyncFDFromFence(ClientPtr client, DrawablePtr pDraw, SyncFence *fence);
|
||||
|
||||
void
|
||||
SyncDeleteTriggerFromSyncObject(SyncTrigger * pTrigger);
|
||||
|
||||
int
|
||||
SyncAddTriggerToSyncObject(SyncTrigger * pTrigger);
|
||||
|
||||
#endif /* _SYNCSRV_H_ */
|
||||
|
||||
Reference in New Issue
Block a user