deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/**************************************************************************
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncCopyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncAll Rights Reserved.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncPermission is hereby granted, free of charge, to any person obtaining a
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynccopy of this software and associated documentation files (the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync"Software"), to deal in the Software without restriction, including
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncwithout limitation the rights to use, copy, modify, merge, publish,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncdistribute, sub license, and/or sell copies of the Software, and to
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncpermit persons to whom the Software is furnished to do so, subject to
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncthe following conditions:
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncThe above copyright notice and this permission notice (including the
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncnext paragraph) shall be included in all copies or substantial portions
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncof the Software.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncIN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync**************************************************************************/
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync/*
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Authors:
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync * Jens Owen <jens@tungstengraphics.com>
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync *
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#ifndef DRI_STRUCT_H
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define DRI_STRUCT_H
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#include "xf86drm.h"
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ((DRIWindowPrivIndex < 0) ? \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync NULL : \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ((DRIDrawablePrivPtr)((pWin)->devPrivates[DRIWindowPrivIndex].ptr)))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ((DRIPixmapPrivIndex < 0) ? \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync NULL : \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ((DRIDrawablePrivPtr)((pPix)->devPrivates[DRIWindowPrivIndex].ptr)))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct _DRIDrawablePrivRec
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync{
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync drm_drawable_t hwDrawable;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int drawableIndex;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ScreenPtr pScreen;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int refCount;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} DRIDrawablePrivRec, *DRIDrawablePrivPtr;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsyncstruct _DRIContextPrivRec
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync{
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync drm_context_t hwContext;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ScreenPtr pScreen;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool valid3D;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DRIContextFlags flags;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync void** pContextStore;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync};
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define DRI_SCREEN_PRIV(pScreen) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ((DRIScreenPrivIndex < 0) ? \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync NULL : \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync ((DRIScreenPrivPtr)((pScreen)->devPrivates[DRIScreenPrivIndex].ptr)))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync (screenInfo.screens[screenIndex]->devPrivates[DRIScreenPrivIndex].ptr))
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsynctypedef struct _DRIScreenPrivRec
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync{
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool directRenderingSupport;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int drmFD; /* File descriptor for /dev/video/? */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync drm_handle_t hSAREA; /* Handle to SAREA, for mapping */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync XF86DRISAREAPtr pSAREA; /* Mapped pointer to SAREA */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync drm_handle_t hFrameBuffer; /* Handle to framebuffer, for mapping */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync drm_context_t myContext; /* DDX Driver's context */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DRIContextPrivPtr myContextPriv;/* Pointer to server's private area */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DRIContextPrivPtr lastPartial3DContext; /* last one partially saved */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync void** hiddenContextStore; /* hidden X context */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync void** partial3DContextStore; /* parital 3D context */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DRIInfoPtr pDriverInfo;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int nrWindows;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync drm_clip_rect_t private_buffer_rect; /* management of private buffers */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DrawablePtr fullscreen; /* pointer to fullscreen drawable */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync drm_clip_rect_t fullscreen_rect; /* fake rect for fullscreen mode */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DRIWrappedFuncsRec wrap;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DrawablePtr DRIDrawables[SAREA_MAX_DRAWABLES];
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync DRIContextPrivPtr dummyCtxPriv; /* Pointer to dummy context */
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool createDummyCtx;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool createDummyCtxPriv;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool grabbedDRILock;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool drmSIGIOHandlerInstalled;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool wrapped;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync Bool windowsTouched;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync int lockRefCount;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync} DRIScreenPrivRec, *DRIScreenPrivPtr;
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync
deb4998ba50060c48cce222fd18a8eed053918d7vboxsync#endif /* DRI_STRUCT_H */