Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /** |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 2 | * \file drm_sarea.h |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * \brief SAREA definitions |
| 4 | * |
Jan Engelhardt | 96de0e2 | 2007-10-19 23:21:04 +0200 | [diff] [blame] | 5 | * \author Michel Dänzer <michel@daenzer.net> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas. |
| 10 | * All Rights Reserved. |
| 11 | * |
| 12 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 13 | * copy of this software and associated documentation files (the "Software"), |
| 14 | * to deal in the Software without restriction, including without limitation |
| 15 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 16 | * and/or sell copies of the Software, and to permit persons to whom the |
| 17 | * Software is furnished to do so, subject to the following conditions: |
| 18 | * |
| 19 | * The above copyright notice and this permission notice (including the next |
| 20 | * paragraph) shall be included in all copies or substantial portions of the |
| 21 | * Software. |
| 22 | * |
| 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 26 | * TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 27 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 28 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 29 | * OTHER DEALINGS IN THE SOFTWARE. |
| 30 | */ |
| 31 | |
| 32 | #ifndef _DRM_SAREA_H_ |
| 33 | #define _DRM_SAREA_H_ |
| 34 | |
Gabriel Laskar | c6da66d | 2015-11-30 15:10:44 +0100 | [diff] [blame] | 35 | #include "drm.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | |
Emil Velikov | ebbb0e5 | 2016-04-07 18:49:00 +0100 | [diff] [blame] | 37 | #if defined(__cplusplus) |
| 38 | extern "C" { |
| 39 | #endif |
| 40 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | /* SAREA area needs to be at least a page */ |
| 42 | #if defined(__alpha__) |
Dave Airlie | 7c1c287 | 2008-11-28 14:22:24 +1000 | [diff] [blame] | 43 | #define SAREA_MAX 0x2000U |
Huacai Chen | fc7b812 | 2012-08-11 09:32:18 +0000 | [diff] [blame] | 44 | #elif defined(__mips__) |
| 45 | #define SAREA_MAX 0x4000U |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | #elif defined(__ia64__) |
Dave Airlie | 7c1c287 | 2008-11-28 14:22:24 +1000 | [diff] [blame] | 47 | #define SAREA_MAX 0x10000U /* 64kB */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | #else |
| 49 | /* Intel 830M driver needs at least 8k SAREA */ |
Dave Airlie | 7c1c287 | 2008-11-28 14:22:24 +1000 | [diff] [blame] | 50 | #define SAREA_MAX 0x2000U |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | #endif |
| 52 | |
| 53 | /** Maximum number of drawables in the SAREA */ |
Dave Airlie | bc5f452 | 2007-11-05 12:50:58 +1000 | [diff] [blame] | 54 | #define SAREA_MAX_DRAWABLES 256 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | |
| 56 | #define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000 |
| 57 | |
| 58 | /** SAREA drawable */ |
Dave Airlie | bd63cb5 | 2007-07-12 10:35:02 +1000 | [diff] [blame] | 59 | struct drm_sarea_drawable { |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 60 | unsigned int stamp; |
| 61 | unsigned int flags; |
Dave Airlie | bd63cb5 | 2007-07-12 10:35:02 +1000 | [diff] [blame] | 62 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | |
| 64 | /** SAREA frame */ |
Dave Airlie | bd63cb5 | 2007-07-12 10:35:02 +1000 | [diff] [blame] | 65 | struct drm_sarea_frame { |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 66 | unsigned int x; |
| 67 | unsigned int y; |
| 68 | unsigned int width; |
| 69 | unsigned int height; |
| 70 | unsigned int fullscreen; |
Dave Airlie | bd63cb5 | 2007-07-12 10:35:02 +1000 | [diff] [blame] | 71 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | |
| 73 | /** SAREA */ |
Dave Airlie | bd63cb5 | 2007-07-12 10:35:02 +1000 | [diff] [blame] | 74 | struct drm_sarea { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | /** first thing is always the DRM locking structure */ |
Dave Airlie | c60ce62 | 2007-07-11 15:27:12 +1000 | [diff] [blame] | 76 | struct drm_hw_lock lock; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | /** \todo Use readers/writer lock for drm_sarea::drawable_lock */ |
Dave Airlie | c60ce62 | 2007-07-11 15:27:12 +1000 | [diff] [blame] | 78 | struct drm_hw_lock drawable_lock; |
Dave Airlie | bd63cb5 | 2007-07-12 10:35:02 +1000 | [diff] [blame] | 79 | struct drm_sarea_drawable drawableTable[SAREA_MAX_DRAWABLES]; /**< drawables */ |
| 80 | struct drm_sarea_frame frame; /**< frame */ |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 81 | drm_context_t dummy_context; |
Dave Airlie | bd63cb5 | 2007-07-12 10:35:02 +1000 | [diff] [blame] | 82 | }; |
| 83 | |
| 84 | #ifndef __KERNEL__ |
| 85 | typedef struct drm_sarea_drawable drm_sarea_drawable_t; |
| 86 | typedef struct drm_sarea_frame drm_sarea_frame_t; |
| 87 | typedef struct drm_sarea drm_sarea_t; |
| 88 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | |
Emil Velikov | ebbb0e5 | 2016-04-07 18:49:00 +0100 | [diff] [blame] | 90 | #if defined(__cplusplus) |
| 91 | } |
| 92 | #endif |
| 93 | |
Dave Airlie | b5e89ed | 2005-09-25 14:28:13 +1000 | [diff] [blame] | 94 | #endif /* _DRM_SAREA_H_ */ |