040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync/*
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * Copyright © 2007 Red Hat, Inc.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * Permission is hereby granted, free of charge, to any person obtaining a
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * copy of this software and associated documentation files (the "Soft-
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * ware"), to deal in the Software without restriction, including without
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * limitation the rights to use, copy, modify, merge, publish, distribute,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * and/or sell copies of the Software, and to permit persons to whom the
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * Software is furnished to do so, provided that the above copyright
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * notice(s) and this permission notice appear in all copies of the Soft-
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * ware and that both the above copyright notice(s) and this permission
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * notice appear in supporting documentation.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR-
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * MANCE OF THIS SOFTWARE.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * Except as contained in this notice, the name of a copyright holder shall
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * not be used in advertising or otherwise to promote the sale, use or
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * other dealings in this Software without prior written authorization of
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * the copyright holder.
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync *
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * Authors:
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync * Kristian Høgsberg (krh@redhat.com)
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#ifndef _DRI2_H_
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#define _DRI2_H_
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef unsigned int (*DRI2GetPixmapHandleProcPtr)(PixmapPtr p,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync unsigned int *flags);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef void (*DRI2BeginClipNotifyProcPtr)(ScreenPtr pScreen);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef void (*DRI2EndClipNotifyProcPtr)(ScreenPtr pScreen);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsynctypedef struct {
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync unsigned int version; /* Version of this struct */
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int fd;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync size_t driverSareaSize;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync const char *driverName;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync DRI2GetPixmapHandleProcPtr getPixmapHandle;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync DRI2BeginClipNotifyProcPtr beginClipNotify;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync DRI2EndClipNotifyProcPtr endClipNotify;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync} DRI2InfoRec, *DRI2InfoPtr;
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncvoid *DRI2ScreenInit(ScreenPtr pScreen,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync DRI2InfoPtr info);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncvoid DRI2CloseScreen(ScreenPtr pScreen);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncBool DRI2Connect(ScreenPtr pScreen,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync int *fd,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync const char **driverName,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync unsigned int *sareaHandle);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncBool DRI2AuthConnection(ScreenPtr pScreen, drm_magic_t magic);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncunsigned int DRI2GetPixmapHandle(PixmapPtr pPixmap,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync unsigned int *flags);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncvoid DRI2Lock(ScreenPtr pScreen);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncvoid DRI2Unlock(ScreenPtr pScreen);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncBool DRI2CreateDrawable(DrawablePtr pDraw,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync unsigned int *handle,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync unsigned int *head);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncvoid DRI2DestroyDrawable(DrawablePtr pDraw);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncvoid DRI2ReemitDrawableInfo(DrawablePtr pDraw,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync unsigned int *head);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsyncBool DRI2PostDamage(DrawablePtr pDrawable,
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync struct drm_clip_rect *rects, int numRects);
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync
040abec2534dadc53ebc8fa378ef03f4feecb7dbvboxsync#endif