xref: /openbmc/linux/include/uapi/drm/drm_sarea.h (revision ebbb0e5c)
1718dceddSDavid Howells /**
2718dceddSDavid Howells  * \file drm_sarea.h
3718dceddSDavid Howells  * \brief SAREA definitions
4718dceddSDavid Howells  *
5718dceddSDavid Howells  * \author Michel Dänzer <michel@daenzer.net>
6718dceddSDavid Howells  */
7718dceddSDavid Howells 
8718dceddSDavid Howells /*
9718dceddSDavid Howells  * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
10718dceddSDavid Howells  * All Rights Reserved.
11718dceddSDavid Howells  *
12718dceddSDavid Howells  * Permission is hereby granted, free of charge, to any person obtaining a
13718dceddSDavid Howells  * copy of this software and associated documentation files (the "Software"),
14718dceddSDavid Howells  * to deal in the Software without restriction, including without limitation
15718dceddSDavid Howells  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16718dceddSDavid Howells  * and/or sell copies of the Software, and to permit persons to whom the
17718dceddSDavid Howells  * Software is furnished to do so, subject to the following conditions:
18718dceddSDavid Howells  *
19718dceddSDavid Howells  * The above copyright notice and this permission notice (including the next
20718dceddSDavid Howells  * paragraph) shall be included in all copies or substantial portions of the
21718dceddSDavid Howells  * Software.
22718dceddSDavid Howells  *
23718dceddSDavid Howells  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24718dceddSDavid Howells  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25718dceddSDavid Howells  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
26718dceddSDavid Howells  * TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
27718dceddSDavid Howells  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
28718dceddSDavid Howells  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
29718dceddSDavid Howells  * OTHER DEALINGS IN THE SOFTWARE.
30718dceddSDavid Howells  */
31718dceddSDavid Howells 
32718dceddSDavid Howells #ifndef _DRM_SAREA_H_
33718dceddSDavid Howells #define _DRM_SAREA_H_
34718dceddSDavid Howells 
35c6da66dfSGabriel Laskar #include "drm.h"
36718dceddSDavid Howells 
37ebbb0e5cSEmil Velikov #if defined(__cplusplus)
38ebbb0e5cSEmil Velikov extern "C" {
39ebbb0e5cSEmil Velikov #endif
40ebbb0e5cSEmil Velikov 
41718dceddSDavid Howells /* SAREA area needs to be at least a page */
42718dceddSDavid Howells #if defined(__alpha__)
43718dceddSDavid Howells #define SAREA_MAX                       0x2000U
44718dceddSDavid Howells #elif defined(__mips__)
45718dceddSDavid Howells #define SAREA_MAX                       0x4000U
46718dceddSDavid Howells #elif defined(__ia64__)
47718dceddSDavid Howells #define SAREA_MAX                       0x10000U	/* 64kB */
48718dceddSDavid Howells #else
49718dceddSDavid Howells /* Intel 830M driver needs at least 8k SAREA */
50718dceddSDavid Howells #define SAREA_MAX                       0x2000U
51718dceddSDavid Howells #endif
52718dceddSDavid Howells 
53718dceddSDavid Howells /** Maximum number of drawables in the SAREA */
54718dceddSDavid Howells #define SAREA_MAX_DRAWABLES		256
55718dceddSDavid Howells 
56718dceddSDavid Howells #define SAREA_DRAWABLE_CLAIMED_ENTRY    0x80000000
57718dceddSDavid Howells 
58718dceddSDavid Howells /** SAREA drawable */
59718dceddSDavid Howells struct drm_sarea_drawable {
60718dceddSDavid Howells 	unsigned int stamp;
61718dceddSDavid Howells 	unsigned int flags;
62718dceddSDavid Howells };
63718dceddSDavid Howells 
64718dceddSDavid Howells /** SAREA frame */
65718dceddSDavid Howells struct drm_sarea_frame {
66718dceddSDavid Howells 	unsigned int x;
67718dceddSDavid Howells 	unsigned int y;
68718dceddSDavid Howells 	unsigned int width;
69718dceddSDavid Howells 	unsigned int height;
70718dceddSDavid Howells 	unsigned int fullscreen;
71718dceddSDavid Howells };
72718dceddSDavid Howells 
73718dceddSDavid Howells /** SAREA */
74718dceddSDavid Howells struct drm_sarea {
75718dceddSDavid Howells     /** first thing is always the DRM locking structure */
76718dceddSDavid Howells 	struct drm_hw_lock lock;
77718dceddSDavid Howells     /** \todo Use readers/writer lock for drm_sarea::drawable_lock */
78718dceddSDavid Howells 	struct drm_hw_lock drawable_lock;
79718dceddSDavid Howells 	struct drm_sarea_drawable drawableTable[SAREA_MAX_DRAWABLES];	/**< drawables */
80718dceddSDavid Howells 	struct drm_sarea_frame frame;	/**< frame */
81718dceddSDavid Howells 	drm_context_t dummy_context;
82718dceddSDavid Howells };
83718dceddSDavid Howells 
84718dceddSDavid Howells #ifndef __KERNEL__
85718dceddSDavid Howells typedef struct drm_sarea_drawable drm_sarea_drawable_t;
86718dceddSDavid Howells typedef struct drm_sarea_frame drm_sarea_frame_t;
87718dceddSDavid Howells typedef struct drm_sarea drm_sarea_t;
88718dceddSDavid Howells #endif
89718dceddSDavid Howells 
90ebbb0e5cSEmil Velikov #if defined(__cplusplus)
91ebbb0e5cSEmil Velikov }
92ebbb0e5cSEmil Velikov #endif
93ebbb0e5cSEmil Velikov 
94718dceddSDavid Howells #endif				/* _DRM_SAREA_H_ */
95