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