160405de4Skz151634 /* 260405de4Skz151634 * \file drm_sarea.h 360405de4Skz151634 * \brief SAREA definitions 460405de4Skz151634 * 560405de4Skz151634 * \author Michel D�zer <michel@daenzer.net> 660405de4Skz151634 */ 760405de4Skz151634 860405de4Skz151634 /* 960405de4Skz151634 * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas. 1060405de4Skz151634 * All Rights Reserved. 1160405de4Skz151634 * 1260405de4Skz151634 * Permission is hereby granted, free of charge, to any person obtaining a 1360405de4Skz151634 * copy of this software and associated documentation files (the "Software"), 1460405de4Skz151634 * to deal in the Software without restriction, including without limitation 1560405de4Skz151634 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 1660405de4Skz151634 * and/or sell copies of the Software, and to permit persons to whom the 1760405de4Skz151634 * Software is furnished to do so, subject to the following conditions: 1860405de4Skz151634 * 1960405de4Skz151634 * The above copyright notice and this permission notice (including the next 2060405de4Skz151634 * paragraph) shall be included in all copies or substantial portions of the 2160405de4Skz151634 * Software. 2260405de4Skz151634 * 2360405de4Skz151634 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 2460405de4Skz151634 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 2560405de4Skz151634 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 2660405de4Skz151634 * TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 2760405de4Skz151634 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 2860405de4Skz151634 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 2960405de4Skz151634 * OTHER DEALINGS IN THE SOFTWARE. 3060405de4Skz151634 */ 3160405de4Skz151634 /* BEGIN CSTYLED */ 3260405de4Skz151634 #ifndef _DRM_SAREA_H 3360405de4Skz151634 #define _DRM_SAREA_H 3460405de4Skz151634 3560405de4Skz151634 #pragma ident "%Z%%M% %I% %E% SMI" 3660405de4Skz151634 3760405de4Skz151634 #include "drm.h" 3860405de4Skz151634 3960405de4Skz151634 /* SAREA area needs to be at least a page */ 4060405de4Skz151634 #if defined(__alpha__) 4160405de4Skz151634 #define SAREA_MAX 0x2000 4260405de4Skz151634 #elif defined(__ia64__) 4360405de4Skz151634 #define SAREA_MAX 0x10000 /* 64kB */ 4460405de4Skz151634 #else 4560405de4Skz151634 /* Intel 830M driver needs at least 8k SAREA */ 46*e92e3a86Szw161486 #define SAREA_MAX 0x2000UL 4760405de4Skz151634 #endif 4860405de4Skz151634 4960405de4Skz151634 /** Maximum number of drawables in the SAREA */ 5060405de4Skz151634 #define SAREA_MAX_DRAWABLES 256 5160405de4Skz151634 5260405de4Skz151634 #define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000 5360405de4Skz151634 5460405de4Skz151634 /** SAREA drawable */ 5560405de4Skz151634 typedef struct drm_sarea_drawable { 5660405de4Skz151634 unsigned int stamp; 5760405de4Skz151634 unsigned int flags; 5860405de4Skz151634 } drm_sarea_drawable_t; 5960405de4Skz151634 6060405de4Skz151634 /** SAREA frame */ 6160405de4Skz151634 typedef struct drm_sarea_frame { 6260405de4Skz151634 unsigned int x; 6360405de4Skz151634 unsigned int y; 6460405de4Skz151634 unsigned int width; 6560405de4Skz151634 unsigned int height; 6660405de4Skz151634 unsigned int fullscreen; 6760405de4Skz151634 } drm_sarea_frame_t; 6860405de4Skz151634 6960405de4Skz151634 /** SAREA */ 7060405de4Skz151634 typedef struct drm_sarea { 7160405de4Skz151634 /** first thing is always the DRM locking structure */ 7260405de4Skz151634 drm_hw_lock_t lock; 7360405de4Skz151634 /** \todo Use readers/writer lock for drm_sarea::drawable_lock */ 7460405de4Skz151634 drm_hw_lock_t drawable_lock; 7560405de4Skz151634 drm_sarea_drawable_t drawableTable[SAREA_MAX_DRAWABLES]; /**< drawables */ 7660405de4Skz151634 drm_sarea_frame_t frame; /**< frame */ 7760405de4Skz151634 drm_context_t dummy_context; 7860405de4Skz151634 } drm_sarea_t; 7960405de4Skz151634 8060405de4Skz151634 /* END CSTYLED */ 8160405de4Skz151634 #endif /* _DRM_SAREA_H */ 82