drm_sarea.h revision 139749
1119098Sanholt/** 2119098Sanholt * \file drm_sarea.h 3119098Sanholt * \brief SAREA definitions 4112015Sanholt * 5130331Sanholt * \author Michel D���zer <michel@daenzer.net> 6119098Sanholt */ 7119098Sanholt 8139749Simp/*- 9112015Sanholt * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas. 10112015Sanholt * All Rights Reserved. 11112015Sanholt * 12112015Sanholt * Permission is hereby granted, free of charge, to any person obtaining a 13112015Sanholt * copy of this software and associated documentation files (the "Software"), 14112015Sanholt * to deal in the Software without restriction, including without limitation 15112015Sanholt * the rights to use, copy, modify, merge, publish, distribute, sublicense, 16112015Sanholt * and/or sell copies of the Software, and to permit persons to whom the 17112015Sanholt * Software is furnished to do so, subject to the following conditions: 18112015Sanholt * 19112015Sanholt * The above copyright notice and this permission notice (including the next 20112015Sanholt * paragraph) shall be included in all copies or substantial portions of the 21112015Sanholt * Software. 22112015Sanholt * 23112015Sanholt * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24112015Sanholt * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25112015Sanholt * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 26112015Sanholt * TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 27112015Sanholt * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 28112015Sanholt * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 29112015Sanholt * OTHER DEALINGS IN THE SOFTWARE. 30112015Sanholt * 31112015Sanholt * $FreeBSD: head/sys/dev/drm/drm_sarea.h 139749 2005-01-06 01:43:34Z imp $ 32112015Sanholt */ 33112015Sanholt 34112015Sanholt#ifndef _DRM_SAREA_H_ 35112015Sanholt#define _DRM_SAREA_H_ 36112015Sanholt 37130331Sanholt#include "dev/drm/drm.h" 38130331Sanholt 39130331Sanholt/* SAREA area needs to be at least a page */ 40130331Sanholt#if defined(__alpha__) 41130331Sanholt#define SAREA_MAX 0x2000 42130331Sanholt#elif defined(__ia64__) 43130331Sanholt#define SAREA_MAX 0x10000 /* 64kB */ 44130331Sanholt#else 45130331Sanholt/* Intel 830M driver needs at least 8k SAREA */ 46130331Sanholt#define SAREA_MAX 0x2000 47130331Sanholt#endif 48130331Sanholt 49119098Sanholt/** Maximum number of drawables in the SAREA */ 50112015Sanholt#define SAREA_MAX_DRAWABLES 256 51112015Sanholt 52130331Sanholt#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000 53130331Sanholt 54119098Sanholt/** SAREA drawable */ 55119098Sanholttypedef struct drm_sarea_drawable { 56112015Sanholt unsigned int stamp; 57112015Sanholt unsigned int flags; 58112015Sanholt} drm_sarea_drawable_t; 59112015Sanholt 60119098Sanholt/** SAREA frame */ 61119098Sanholttypedef struct drm_sarea_frame { 62112015Sanholt unsigned int x; 63112015Sanholt unsigned int y; 64112015Sanholt unsigned int width; 65112015Sanholt unsigned int height; 66112015Sanholt unsigned int fullscreen; 67112015Sanholt} drm_sarea_frame_t; 68112015Sanholt 69119098Sanholt/** SAREA */ 70119098Sanholttypedef struct drm_sarea { 71119098Sanholt /** first thing is always the DRM locking structure */ 72112015Sanholt drm_hw_lock_t lock; 73119098Sanholt /** \todo Use readers/writer lock for drm_sarea::drawable_lock */ 74112015Sanholt drm_hw_lock_t drawable_lock; 75119098Sanholt drm_sarea_drawable_t drawableTable[SAREA_MAX_DRAWABLES]; /**< drawables */ 76119098Sanholt drm_sarea_frame_t frame; /**< frame */ 77112015Sanholt drm_context_t dummy_context; 78112015Sanholt} drm_sarea_t; 79112015Sanholt 80112015Sanholt#endif /* _DRM_SAREA_H_ */ 81