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