a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/**
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * \file sarea.h
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * SAREA definitions.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * \author Kevin E. Martin <kevin@precisioninsight.com>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * \author Jens Owen <jens@tungstengraphics.com>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * \author Rickard E. (Rik) Faith <faith@valinux.com>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright 2000 VA Linux Systems, Inc.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * All Rights Reserved.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * copy of this software and associated documentation files (the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * "Software"), to deal in the Software without restriction, including
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * without limitation the rights to use, copy, modify, merge, publish,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * distribute, sub license, and/or sell copies of the Software, and to
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * permit persons to whom the Software is furnished to do so, subject to
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the following conditions:
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * The above copyright notice and this permission notice (including the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * next paragraph) shall be included in all copies or substantial portions
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * of the Software.
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
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifndef _SAREA_H_
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define _SAREA_H_
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include "xf86drm.h"
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* SAREA area needs to be at least a page */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#if defined(__alpha__)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define SAREA_MAX 0x2000
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#elif defined(__ia64__)
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define SAREA_MAX 0x10000 /* 64kB */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#else
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/* Intel 830M driver needs at least 8k SAREA */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define SAREA_MAX 0x2000
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define SAREA_MAX_DRAWABLES 256
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/**
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * SAREA per drawable information.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * \sa _XF86DRISAREA.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef struct _XF86DRISAREADrawable {
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int stamp;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int flags;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/**
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * SAREA frame information.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * \sa _XF86DRISAREA.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef struct _XF86DRISAREAFrame {
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int x;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int y;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int width;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int height;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync unsigned int fullscreen;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/**
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * SAREA definition.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef struct _XF86DRISAREA {
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /** first thing is always the DRM locking structure */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync drmLock lock;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /** \todo Use readers/writer lock for drawable_lock */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync drmLock drawable_lock;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync XF86DRISAREAFrameRec frame;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync drm_context_t dummy_context;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync} XF86DRISAREARec, *XF86DRISAREAPtr;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef struct _XF86DRILSAREA {
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync drmLock lock;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync drmLock otherLocks[31];
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync} XF86DRILSAREARec, *XF86DRILSAREAPtr;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif