1*592ffb21SWarner Losh /** 2*592ffb21SWarner Losh * \file drm_sarea.h 3*592ffb21SWarner Losh * \brief SAREA definitions 4*592ffb21SWarner Losh * 5*592ffb21SWarner Losh * \author Michel D�zer <michel@daenzer.net> 6*592ffb21SWarner Losh */ 7*592ffb21SWarner Losh 8*592ffb21SWarner Losh /*- 9*592ffb21SWarner Losh * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas. 10*592ffb21SWarner Losh * All Rights Reserved. 11*592ffb21SWarner Losh * 12*592ffb21SWarner Losh * Permission is hereby granted, free of charge, to any person obtaining a 13*592ffb21SWarner Losh * copy of this software and associated documentation files (the "Software"), 14*592ffb21SWarner Losh * to deal in the Software without restriction, including without limitation 15*592ffb21SWarner Losh * the rights to use, copy, modify, merge, publish, distribute, sublicense, 16*592ffb21SWarner Losh * and/or sell copies of the Software, and to permit persons to whom the 17*592ffb21SWarner Losh * Software is furnished to do so, subject to the following conditions: 18*592ffb21SWarner Losh * 19*592ffb21SWarner Losh * The above copyright notice and this permission notice (including the next 20*592ffb21SWarner Losh * paragraph) shall be included in all copies or substantial portions of the 21*592ffb21SWarner Losh * Software. 22*592ffb21SWarner Losh * 23*592ffb21SWarner Losh * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24*592ffb21SWarner Losh * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25*592ffb21SWarner Losh * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 26*592ffb21SWarner Losh * TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 27*592ffb21SWarner Losh * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 28*592ffb21SWarner Losh * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 29*592ffb21SWarner Losh * OTHER DEALINGS IN THE SOFTWARE. 30*592ffb21SWarner Losh */ 31*592ffb21SWarner Losh 32*592ffb21SWarner Losh #include <sys/cdefs.h> 33*592ffb21SWarner Losh #ifndef _DRM_SAREA_H_ 34*592ffb21SWarner Losh #define _DRM_SAREA_H_ 35*592ffb21SWarner Losh 36*592ffb21SWarner Losh #include <dev/drm2/drm.h> 37*592ffb21SWarner Losh 38*592ffb21SWarner Losh /* Intel 830M driver needs at least 8k SAREA */ 39*592ffb21SWarner Losh #define SAREA_MAX 0x2000U 40*592ffb21SWarner Losh 41*592ffb21SWarner Losh /** Maximum number of drawables in the SAREA */ 42*592ffb21SWarner Losh #define SAREA_MAX_DRAWABLES 256 43*592ffb21SWarner Losh 44*592ffb21SWarner Losh #define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000 45*592ffb21SWarner Losh 46*592ffb21SWarner Losh /** SAREA drawable */ 47*592ffb21SWarner Losh struct drm_sarea_drawable { 48*592ffb21SWarner Losh unsigned int stamp; 49*592ffb21SWarner Losh unsigned int flags; 50*592ffb21SWarner Losh }; 51*592ffb21SWarner Losh 52*592ffb21SWarner Losh /** SAREA frame */ 53*592ffb21SWarner Losh struct drm_sarea_frame { 54*592ffb21SWarner Losh unsigned int x; 55*592ffb21SWarner Losh unsigned int y; 56*592ffb21SWarner Losh unsigned int width; 57*592ffb21SWarner Losh unsigned int height; 58*592ffb21SWarner Losh unsigned int fullscreen; 59*592ffb21SWarner Losh }; 60*592ffb21SWarner Losh 61*592ffb21SWarner Losh /** SAREA */ 62*592ffb21SWarner Losh struct drm_sarea { 63*592ffb21SWarner Losh /** first thing is always the DRM locking structure */ 64*592ffb21SWarner Losh struct drm_hw_lock lock; 65*592ffb21SWarner Losh /** \todo Use readers/writer lock for drm_sarea::drawable_lock */ 66*592ffb21SWarner Losh struct drm_hw_lock drawable_lock; 67*592ffb21SWarner Losh struct drm_sarea_drawable drawableTable[SAREA_MAX_DRAWABLES]; /**< drawables */ 68*592ffb21SWarner Losh struct drm_sarea_frame frame; /**< frame */ 69*592ffb21SWarner Losh drm_context_t dummy_context; 70*592ffb21SWarner Losh }; 71*592ffb21SWarner Losh 72*592ffb21SWarner Losh #ifndef __KERNEL__ 73*592ffb21SWarner Losh typedef struct drm_sarea_drawable drm_sarea_drawable_t; 74*592ffb21SWarner Losh typedef struct drm_sarea_frame drm_sarea_frame_t; 75*592ffb21SWarner Losh typedef struct drm_sarea drm_sarea_t; 76*592ffb21SWarner Losh #endif 77*592ffb21SWarner Losh 78*592ffb21SWarner Losh #endif /* _DRM_SAREA_H_ */ 79