]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
drm: simplify authentication management
authorDavid Herrmann <dh.herrmann@gmail.com>
Mon, 4 May 2015 19:01:30 +0000 (21:01 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 5 May 2015 07:45:57 +0000 (09:45 +0200)
commit32e7b94a3fa8e137aab9f2c65dff86be73245fc8
tree9026e7496c09f78bb02d6ea4b67e9ca22cd403f3
parentacab18b5c3a7025640abc84ace5e94c76ebd3d10
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>
drivers/gpu/drm/drm_auth.c
drivers/gpu/drm/drm_drv.c
drivers/gpu/drm/drm_fops.c
drivers/gpu/drm/drm_internal.h
include/drm/drmP.h