| 1 | /* SPDX-License-Identifier: MIT */ |
| 2 | /** |
| 3 | * \file drm_sarea.h |
| 4 | * \brief SAREA definitions |
| 5 | * |
| 6 | * \author Michel Dänzer <michel@daenzer.net> |
| 7 | */ |
| 8 | |
| 9 | /* |
| 10 | * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas. |
| 11 | * All Rights Reserved. |
| 12 | */ |
| 13 | |
| 14 | #ifndef _DRM_SAREA_H_ |
| 15 | #define _DRM_SAREA_H_ |
| 16 | |
| 17 | #include "drm.h" |
| 18 | |
| 19 | #if defined(__cplusplus) |
| 20 | extern "C" { |
| 21 | #endif |
| 22 | |
| 23 | /* SAREA area needs to be at least a page */ |
| 24 | #if defined(__alpha__) |
| 25 | #define SAREA_MAX 0x2000U |
| 26 | #elif defined(__mips__) |
| 27 | #define SAREA_MAX 0x4000U |
| 28 | #elif defined(__ia64__) |
| 29 | #define SAREA_MAX 0x10000U	/* 64kB */ |
| 30 | #else |
| 31 | /* Intel 830M driver needs at least 8k SAREA */ |
| 32 | #define SAREA_MAX 0x2000U |
| 33 | #endif |
| 34 | |
| 35 | /** Maximum number of drawables in the SAREA */ |
| 36 | #define SAREA_MAX_DRAWABLES		256 |
| 37 | |
| 38 | #define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000 |
| 39 | |
| 40 | /** SAREA drawable */ |
| 41 | struct drm_sarea_drawable { |
| 42 | 	unsigned int stamp; |
| 43 | 	unsigned int flags; |
| 44 | }; |
| 45 | |
| 46 | /** SAREA frame */ |
| 47 | struct drm_sarea_frame { |
| 48 | 	unsigned int x; |
| 49 | 	unsigned int y; |
| 50 | 	unsigned int width; |
| 51 | 	unsigned int height; |
| 52 | 	unsigned int fullscreen; |
| 53 | }; |
| 54 | |
| 55 | /** SAREA */ |
| 56 | struct drm_sarea { |
| 57 | /** first thing is always the DRM locking structure */ |
| 58 | 	struct drm_hw_lock lock; |
| 59 | /** \todo Use readers/writer lock for drm_sarea::drawable_lock */ |
| 60 | 	struct drm_hw_lock drawable_lock; |
| 61 | 	struct drm_sarea_drawable drawableTable[SAREA_MAX_DRAWABLES];	/**< drawables */ |
| 62 | 	struct drm_sarea_frame frame;	/**< frame */ |
| 63 | 	drm_context_t dummy_context; |
| 64 | }; |
| 65 | |
| 66 | typedef struct drm_sarea_drawable drm_sarea_drawable_t; |
| 67 | typedef struct drm_sarea_frame drm_sarea_frame_t; |
| 68 | typedef struct drm_sarea drm_sarea_t; |
| 69 | |
| 70 | #if defined(__cplusplus) |
| 71 | } |
| 72 | #endif |
| 73 | |
| 74 | #endif				/* _DRM_SAREA_H_ */ |