| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: drmP.h,v 1.54 2021/12/19 01:56:42 riastradh Exp $ */ | | 1 | /* $NetBSD: drmP.h,v 1.55 2021/12/19 01:56:50 riastradh Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Internal Header for the Direct Rendering Manager | | 4 | * Internal Header for the Direct Rendering Manager |
5 | * | | 5 | * |
6 | * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. | | 6 | * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. |
7 | * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. | | 7 | * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. |
8 | * Copyright (c) 2009-2010, Code Aurora Forum. | | 8 | * Copyright (c) 2009-2010, Code Aurora Forum. |
9 | * All rights reserved. | | 9 | * All rights reserved. |
10 | * | | 10 | * |
11 | * Author: Rickard E. (Rik) Faith <faith@valinux.com> | | 11 | * Author: Rickard E. (Rik) Faith <faith@valinux.com> |
12 | * Author: Gareth Hughes <gareth@valinux.com> | | 12 | * Author: Gareth Hughes <gareth@valinux.com> |
13 | * | | 13 | * |
14 | * Permission is hereby granted, free of charge, to any person obtaining a | | 14 | * Permission is hereby granted, free of charge, to any person obtaining a |
| @@ -149,109 +149,26 @@ struct drm_pending_event { | | | @@ -149,109 +149,26 @@ struct drm_pending_event { |
149 | struct list_head link; | | 149 | struct list_head link; |
150 | struct drm_file *file_priv; | | 150 | struct drm_file *file_priv; |
151 | pid_t pid; /* pid of requester, no guarantee it's valid by the time | | 151 | pid_t pid; /* pid of requester, no guarantee it's valid by the time |
152 | we deliver the event, for tracing only */ | | 152 | we deliver the event, for tracing only */ |
153 | void (*destroy)(struct drm_pending_event *event); | | 153 | void (*destroy)(struct drm_pending_event *event); |
154 | }; | | 154 | }; |
155 | | | 155 | |
156 | /* initial implementaton using a linked list - todo hashtab */ | | 156 | /* initial implementaton using a linked list - todo hashtab */ |
157 | struct drm_prime_file_private { | | 157 | struct drm_prime_file_private { |
158 | struct list_head head; | | 158 | struct list_head head; |
159 | struct mutex lock; | | 159 | struct mutex lock; |
160 | }; | | 160 | }; |
161 | | | 161 | |
162 | /** File private data */ | | | |
163 | struct drm_file { | | | |
164 | unsigned authenticated :1; | | | |
165 | /* Whether we're master for a minor. Protected by master_mutex */ | | | |
166 | unsigned is_master :1; | | | |
167 | /* true when the client has asked us to expose stereo 3D mode flags */ | | | |
168 | unsigned stereo_allowed :1; | | | |
169 | /* | | | |
170 | * true if client understands CRTC primary planes and cursor planes | | | |
171 | * in the plane list | | | |
172 | */ | | | |
173 | unsigned universal_planes:1; | | | |
174 | /* true if client understands atomic properties */ | | | |
175 | unsigned atomic:1; | | | |
176 | /* | | | |
177 | * This client is allowed to gain master privileges for @master. | | | |
178 | * Protected by struct drm_device::master_mutex. | | | |
179 | */ | | | |
180 | unsigned allowed_master:1; | | | |
181 | | | | |
182 | #ifndef __NetBSD__ | | | |
183 | struct pid *pid; | | | |
184 | kuid_t uid; | | | |
185 | #endif | | | |
186 | drm_magic_t magic; | | | |
187 | struct list_head lhead; | | | |
188 | struct drm_minor *minor; | | | |
189 | unsigned long lock_count; | | | |
190 | | | | |
191 | /** Mapping of mm object handles to object pointers. */ | | | |
192 | struct idr object_idr; | | | |
193 | /** Lock for synchronization of access to object_idr. */ | | | |
194 | spinlock_t table_lock; | | | |
195 | | | | |
196 | struct file *filp; | | | |
197 | void *driver_priv; | | | |
198 | | | | |
199 | struct drm_master *master; /* master this node is currently associated with | | | |
200 | N.B. not always minor->master */ | | | |
201 | /** | | | |
202 | * fbs - List of framebuffers associated with this file. | | | |
203 | * | | | |
204 | * Protected by fbs_lock. Note that the fbs list holds a reference on | | | |
205 | * the fb object to prevent it from untimely disappearing. | | | |
206 | */ | | | |
207 | struct list_head fbs; | | | |
208 | struct mutex fbs_lock; | | | |
209 | | | | |
210 | /** User-created blob properties; this retains a reference on the | | | |
211 | * property. */ | | | |
212 | struct list_head blobs; | | | |
213 | | | | |
214 | #ifdef __NetBSD__ | | | |
215 | drm_waitqueue_t event_wait; | | | |
216 | struct selinfo event_selq; | | | |
217 | #else | | | |
218 | wait_queue_head_t event_wait; | | | |
219 | #endif | | | |
220 | struct list_head event_list; | | | |
221 | int event_space; | | | |
222 | | | | |
223 | struct drm_prime_file_private prime; | | | |
224 | }; | | | |
225 | | | | |
226 | /** | | | |
227 | * Lock data. | | | |
228 | */ | | | |
229 | struct drm_lock_data { | | | |
230 | struct drm_hw_lock *hw_lock; /**< Hardware lock */ | | | |
231 | /** Private of lock holder's file (NULL=kernel) */ | | | |
232 | struct drm_file *file_priv; | | | |
233 | #ifdef __NetBSD__ | | | |
234 | drm_waitqueue_t lock_queue; /**< Queue of blocked processes */ | | | |
235 | #else | | | |
236 | wait_queue_head_t lock_queue; /**< Queue of blocked processes */ | | | |
237 | #endif | | | |
238 | unsigned long lock_time; /**< Time of last lock in jiffies */ | | | |
239 | spinlock_t spinlock; | | | |
240 | uint32_t kernel_waiters; | | | |
241 | uint32_t user_waiters; | | | |
242 | int idle_has_lock; | | | |
243 | }; | | | |
244 | | | | |
245 | /** | | 162 | /** |
246 | * struct drm_master - drm master structure | | 163 | * struct drm_master - drm master structure |
247 | * | | 164 | * |
248 | * @refcount: Refcount for this master object. | | 165 | * @refcount: Refcount for this master object. |
249 | * @minor: Link back to minor char device we are master for. Immutable. | | 166 | * @minor: Link back to minor char device we are master for. Immutable. |
250 | * @unique: Unique identifier: e.g. busid. Protected by drm_global_mutex. | | 167 | * @unique: Unique identifier: e.g. busid. Protected by drm_global_mutex. |
251 | * @unique_len: Length of unique field. Protected by drm_global_mutex. | | 168 | * @unique_len: Length of unique field. Protected by drm_global_mutex. |
252 | * @magic_map: Map of used authentication tokens. Protected by struct_mutex. | | 169 | * @magic_map: Map of used authentication tokens. Protected by struct_mutex. |
253 | * @lock: DRI lock information. | | 170 | * @lock: DRI lock information. |
254 | * @driver_priv: Pointer to driver-private information. | | 171 | * @driver_priv: Pointer to driver-private information. |
255 | */ | | 172 | */ |
256 | struct drm_master { | | 173 | struct drm_master { |
257 | struct kref refcount; | | 174 | struct kref refcount; |