f78b12e570284aa8291f4ca1add24937fd107403vboxsync/*
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Copyright © 2007 Red Hat, Inc.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * copy of this software and associated documentation files (the "Soft-
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * ware"), to deal in the Software without restriction, including without
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * limitation the rights to use, copy, modify, merge, publish, distribute,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * and/or sell copies of the Software, and to permit persons to whom the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Software is furnished to do so, provided that the above copyright
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * notice(s) and this permission notice appear in all copies of the Soft-
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * ware and that both the above copyright notice(s) and this permission
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * notice appear in supporting documentation.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR-
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * MANCE OF THIS SOFTWARE.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Except as contained in this notice, the name of a copyright holder shall
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * not be used in advertising or otherwise to promote the sale, use or
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * other dealings in this Software without prior written authorization of
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * the copyright holder.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Authors:
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Kristian Høgsberg (krh@redhat.com)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#ifndef _DRI2_H_
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define _DRI2_H_
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#include <X11/extensions/dri2tokens.h>
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/* Version 2 structure (with format at the end) */
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int attachment;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int name;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int pitch;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int cpp;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int flags;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int format;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync void *driverPrivate;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} DRI2BufferRec, *DRI2BufferPtr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern CARD8 dri2_major; /* version of DRI2 supported by DDX */
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern CARD8 dri2_minor;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef DRI2BufferRec DRI2Buffer2Rec, *DRI2Buffer2Ptr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef void (*DRI2SwapEventPtr)(ClientPtr client, void *data, int type,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD64 ust, CARD64 msc, CARD32 sbc);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef DRI2BufferPtr (*DRI2CreateBuffersProcPtr)(DrawablePtr pDraw,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int *attachments,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int count);
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef void (*DRI2DestroyBuffersProcPtr)(DrawablePtr pDraw,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2BufferPtr buffers,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int count);
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef void (*DRI2CopyRegionProcPtr)(DrawablePtr pDraw,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RegionPtr pRegion,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2BufferPtr pDestBuffer,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2BufferPtr pSrcBuffer);
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef void (*DRI2WaitProcPtr)(WindowPtr pWin,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int sequence);
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef int (*DRI2AuthMagicProcPtr)(int fd, uint32_t magic);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/**
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Schedule a buffer swap
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * This callback is used to support glXSwapBuffers and the OML_sync_control
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * extension (see it for a description of the params).
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Drivers should queue an event for the frame count that satisfies the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * parameters passed in. If the event is in the future (i.e. the conditions
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * aren't currently satisfied), the server may block the client at the next
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * GLX request using DRI2WaitSwap. When the event arrives, drivers should call
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \c DRI2SwapComplete, which will handle waking the client and returning
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * the appropriate data.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * The DDX is responsible for doing a flip, exchange, or blit of the swap
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * when the corresponding event arrives. The \c DRI2CanFlip and
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \c DRI2CanExchange functions can be used as helpers for this purpose.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param client client pointer (used for block/unblock)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param pDraw drawable whose count we want
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param pDestBuffer current front buffer
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param pSrcBuffer current back buffer
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param target_msc frame count to wait for
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param divisor divisor for condition equation
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param remainder remainder for division equation
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param func function to call when the swap completes
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param data data for the callback \p func.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef int (*DRI2ScheduleSwapProcPtr)(ClientPtr client,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DrawablePtr pDraw,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2BufferPtr pDestBuffer,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2BufferPtr pSrcBuffer,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD64 *target_msc,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD64 divisor,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD64 remainder,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2SwapEventPtr func,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync void *data);
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef DRI2BufferPtr (*DRI2CreateBufferProcPtr)(DrawablePtr pDraw,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int attachment,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int format);
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef void (*DRI2DestroyBufferProcPtr)(DrawablePtr pDraw,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2BufferPtr buffer);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/**
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Get current media stamp counter values
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * This callback is used to support the SGI_video_sync and OML_sync_control
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * extensions.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Drivers should return the current frame counter and the timestamp from
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * when the returned frame count was last incremented.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * The count should correspond to the screen where the drawable is currently
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * visible. If the drawable isn't visible (e.g. redirected), the server
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * should return BadDrawable to the client, pending GLX spec updates to
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * define this behavior.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param pDraw drawable whose count we want
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param ust timestamp from when the count was last incremented.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param mst current frame count
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef int (*DRI2GetMSCProcPtr)(DrawablePtr pDraw, CARD64 *ust,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD64 *msc);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/**
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Schedule a frame count related wait
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * This callback is used to support the SGI_video_sync and OML_sync_control
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * extensions. See those specifications for details on how to handle
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * the divisor and remainder parameters.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Drivers should queue an event for the frame count that satisfies the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * parameters passed in. If the event is in the future (i.e. the conditions
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * aren't currently satisfied), the driver should block the client using
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \c DRI2BlockClient. When the event arrives, drivers should call
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \c DRI2WaitMSCComplete, which will handle waking the client and returning
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * the appropriate data.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param client client pointer (used for block/unblock)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param pDraw drawable whose count we want
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param target_msc frame count to wait for
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param divisor divisor for condition equation
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param remainder remainder for division equation
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef int (*DRI2ScheduleWaitMSCProcPtr)(ClientPtr client,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DrawablePtr pDraw,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD64 target_msc,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD64 divisor,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD64 remainder);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef void (*DRI2InvalidateProcPtr)(DrawablePtr pDraw,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync void *data);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/**
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Version of the DRI2InfoRec structure defined in this header
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#define DRI2INFOREC_VERSION 5
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsynctypedef struct {
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int version; /**< Version of this struct */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int fd;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync const char *driverName;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync const char *deviceName;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2CreateBufferProcPtr CreateBuffer;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2DestroyBufferProcPtr DestroyBuffer;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2CopyRegionProcPtr CopyRegion;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2WaitProcPtr Wait;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /* added in version 4 */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2ScheduleSwapProcPtr ScheduleSwap;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2GetMSCProcPtr GetMSC;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /* number of drivers in the driverNames array */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int numDrivers;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /* array of driver names, indexed by DRI2Driver* driver types */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /* a name of NULL means that driver is not supported */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync const char * const *driverNames;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync /* added in version 5 */
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2AuthMagicProcPtr AuthMagic;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync} DRI2InfoRec, *DRI2InfoPtr;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT int DRI2EventBase;
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT Bool DRI2ScreenInit(ScreenPtr pScreen,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2InfoPtr info);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT void DRI2CloseScreen(ScreenPtr pScreen);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT Bool DRI2HasSwapControl(ScreenPtr pScreen);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT Bool DRI2Connect(ScreenPtr pScreen,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int driverType,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int *fd,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync const char **driverName,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync const char **deviceName);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT Bool DRI2Authenticate(ScreenPtr pScreen, uint32_t magic);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT int DRI2CreateDrawable(ClientPtr client,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DrawablePtr pDraw,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync XID id,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2InvalidateProcPtr invalidate,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync void *priv);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT void DRI2DestroyDrawable(DrawablePtr pDraw);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT DRI2BufferPtr *DRI2GetBuffers(DrawablePtr pDraw,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int *width,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int *height,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int *attachments,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int count,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int *out_count);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT int DRI2CopyRegion(DrawablePtr pDraw,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync RegionPtr pRegion,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int dest,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int src);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/**
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Determine the major and minor version of the DRI2 extension.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * Provides a mechanism to other modules (e.g., 2D drivers) to determine the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * version of the DRI2 extension. While it is possible to peek directly at
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * the \c XF86ModuleData from a layered module, such a module will fail to
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * load (due to an unresolved symbol) if the DRI2 extension is not loaded.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param major Location to store the major verion of the DRI2 extension
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \param minor Location to store the minor verion of the DRI2 extension
f78b12e570284aa8291f4ca1add24937fd107403vboxsync *
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * \note
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * This interface was added some time after the initial release of the DRI2
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * module. Layered modules that wish to use this interface must first test
f78b12e570284aa8291f4ca1add24937fd107403vboxsync * its existance by calling \c xf86LoaderCheckSymbol.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync */
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT void DRI2Version(int *major, int *minor);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT DRI2BufferPtr *DRI2GetBuffersWithFormat(DrawablePtr pDraw,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int *width, int *height, unsigned int *attachments, int count,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int *out_count);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT void DRI2SwapInterval(DrawablePtr pDrawable, int interval);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT int DRI2SwapBuffers(ClientPtr client, DrawablePtr pDrawable,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD64 target_msc, CARD64 divisor,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD64 remainder, CARD64 *swap_target,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2SwapEventPtr func, void *data);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT Bool DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT int DRI2GetMSC(DrawablePtr pDrawable, CARD64 *ust,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD64 *msc, CARD64 *sbc);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT int DRI2WaitMSC(ClientPtr client, DrawablePtr pDrawable,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD64 target_msc, CARD64 divisor,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD64 remainder);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT int ProcDRI2WaitMSCReply(ClientPtr client, CARD64 ust,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD64 msc, CARD64 sbc);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT int DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync CARD64 target_sbc);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT Bool DRI2ThrottleClient(ClientPtr client, DrawablePtr pDraw);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT Bool DRI2CanFlip(DrawablePtr pDraw);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT Bool DRI2CanExchange(DrawablePtr pDraw);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync/* Note: use *only* for MSC related waits */
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT void DRI2BlockClient(ClientPtr client, DrawablePtr pDraw);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT void DRI2SwapComplete(ClientPtr client, DrawablePtr pDraw,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int frame, unsigned int tv_sec,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int tv_usec, int type,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync DRI2SwapEventPtr swap_complete,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync void *swap_data);
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncextern _X_EXPORT void DRI2WaitMSCComplete(ClientPtr client, DrawablePtr pDraw,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync int frame, unsigned int tv_sec,
f78b12e570284aa8291f4ca1add24937fd107403vboxsync unsigned int tv_usec);
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#endif