summaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-05-04 21:01:30 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-05-05 09:45:57 +0200
commit32e7b94a3fa8e137aab9f2c65dff86be73245fc8 (patch)
tree9026e7496c09f78bb02d6ea4b67e9ca22cd403f3 /include/drm
parentacab18b5c3a7025640abc84ace5e94c76ebd3d10 (diff)
downloadblackbird-obmc-linux-32e7b94a3fa8e137aab9f2c65dff86be73245fc8.tar.gz
blackbird-obmc-linux-32e7b94a3fa8e137aab9f2c65dff86be73245fc8.zip
drm: simplify authentication management
The magic auth tokens we have are a simple map from cyclic IDs to drm_file objects. Remove all the old bulk of code and replace it with a simple, direct IDR. The previous behavior is kept. Especially calling authmagic multiple times on the same magic results in EINVAL except on the first call. The only difference in behavior is that we never allocate IDs multiple times as long as a client has its FD open. v2: - Fix return code of GetMagic() - Use non-cyclic IDR allocator - fix off-by-one in "magic > INT_MAX" sanity check v3: - drop redundant "magic > INT_MAX" check Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drmP.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index e2b101b49112..df6d9970d9a4 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -355,7 +355,7 @@ struct drm_lock_data {
* @minor: Link back to minor char device we are master for. Immutable.
* @unique: Unique identifier: e.g. busid. Protected by drm_global_mutex.
* @unique_len: Length of unique field. Protected by drm_global_mutex.
- * @magiclist: Hash of used authentication tokens. Protected by struct_mutex.
+ * @magic_map: Map of used authentication tokens. Protected by struct_mutex.
* @lock: DRI lock information.
* @driver_priv: Pointer to driver-private information.
*/
@@ -364,7 +364,7 @@ struct drm_master {
struct drm_minor *minor;
char *unique;
int unique_len;
- struct drm_open_hash magiclist;
+ struct idr magic_map;
struct drm_lock_data lock;
void *driver_priv;
};
OpenPOWER on IntegriCloud