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