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