105b261ecSmrg/**
235c4bbdfSmrg * \file sarea.h
305b261ecSmrg * SAREA definitions.
435c4bbdfSmrg *
505b261ecSmrg * \author Kevin E. Martin <kevin@precisioninsight.com>
605b261ecSmrg * \author Jens Owen <jens@tungstengraphics.com>
705b261ecSmrg * \author Rickard E. (Rik) Faith <faith@valinux.com>
805b261ecSmrg */
905b261ecSmrg
1005b261ecSmrg/*
1105b261ecSmrg * Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
1205b261ecSmrg * Copyright 2000 VA Linux Systems, Inc.
1305b261ecSmrg * All Rights Reserved.
1435c4bbdfSmrg *
1505b261ecSmrg * Permission is hereby granted, free of charge, to any person obtaining a
1605b261ecSmrg * copy of this software and associated documentation files (the
1705b261ecSmrg * "Software"), to deal in the Software without restriction, including
1805b261ecSmrg * without limitation the rights to use, copy, modify, merge, publish,
1905b261ecSmrg * distribute, sub license, and/or sell copies of the Software, and to
2005b261ecSmrg * permit persons to whom the Software is furnished to do so, subject to
2105b261ecSmrg * the following conditions:
2235c4bbdfSmrg *
2305b261ecSmrg * The above copyright notice and this permission notice (including the
2405b261ecSmrg * next paragraph) shall be included in all copies or substantial portions
2505b261ecSmrg * of the Software.
2635c4bbdfSmrg *
2705b261ecSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2805b261ecSmrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2905b261ecSmrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
3005b261ecSmrg * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
3105b261ecSmrg * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
3205b261ecSmrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
3305b261ecSmrg * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3405b261ecSmrg */
3505b261ecSmrg
3605b261ecSmrg#ifndef _SAREA_H_
3705b261ecSmrg#define _SAREA_H_
3805b261ecSmrg
3905b261ecSmrg#include "xf86drm.h"
4005b261ecSmrg
4105b261ecSmrg/* SAREA area needs to be at least a page */
4205b261ecSmrg#if defined(__alpha__)
4305b261ecSmrg#define SAREA_MAX 			0x2000
4405b261ecSmrg#elif defined(__ia64__)
4535c4bbdfSmrg#define SAREA_MAX			0x10000 /* 64kB */
4605b261ecSmrg#else
4705b261ecSmrg/* Intel 830M driver needs at least 8k SAREA */
4805b261ecSmrg#define SAREA_MAX			0x2000
4905b261ecSmrg#endif
5005b261ecSmrg
5105b261ecSmrg#define SAREA_MAX_DRAWABLES 		256
5205b261ecSmrg
5305b261ecSmrg#define SAREA_DRAWABLE_CLAIMED_ENTRY	0x80000000
5405b261ecSmrg
5505b261ecSmrg/**
5605b261ecSmrg * SAREA per drawable information.
5705b261ecSmrg *
5805b261ecSmrg * \sa _XF86DRISAREA.
5905b261ecSmrg */
6005b261ecSmrgtypedef struct _XF86DRISAREADrawable {
6135c4bbdfSmrg    unsigned int stamp;
6235c4bbdfSmrg    unsigned int flags;
6305b261ecSmrg} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr;
6405b261ecSmrg
6505b261ecSmrg/**
6605b261ecSmrg * SAREA frame information.
6705b261ecSmrg *
6805b261ecSmrg * \sa  _XF86DRISAREA.
6905b261ecSmrg */
7005b261ecSmrgtypedef struct _XF86DRISAREAFrame {
7135c4bbdfSmrg    unsigned int x;
7235c4bbdfSmrg    unsigned int y;
7335c4bbdfSmrg    unsigned int width;
7435c4bbdfSmrg    unsigned int height;
7535c4bbdfSmrg    unsigned int fullscreen;
7605b261ecSmrg} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr;
7705b261ecSmrg
7805b261ecSmrg/**
7905b261ecSmrg * SAREA definition.
8005b261ecSmrg */
8105b261ecSmrgtypedef struct _XF86DRISAREA {
8205b261ecSmrg    /** first thing is always the DRM locking structure */
8335c4bbdfSmrg    drmLock lock;
8405b261ecSmrg    /** \todo Use readers/writer lock for drawable_lock */
8535c4bbdfSmrg    drmLock drawable_lock;
8635c4bbdfSmrg    XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
8735c4bbdfSmrg    XF86DRISAREAFrameRec frame;
8835c4bbdfSmrg    drm_context_t dummy_context;
8905b261ecSmrg} XF86DRISAREARec, *XF86DRISAREAPtr;
9005b261ecSmrg
9135c4bbdfSmrgtypedef struct _XF86DRILSAREA {
9235c4bbdfSmrg    drmLock lock;
9335c4bbdfSmrg    drmLock otherLocks[31];
9405b261ecSmrg} XF86DRILSAREARec, *XF86DRILSAREAPtr;
9505b261ecSmrg
9605b261ecSmrg#endif
97