• David Herrmann's avatar
    drm: simplify authentication management · 32e7b94a
    David Herrmann authored
    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: default avatarDavid Herrmann <dh.herrmann@gmail.com>
    Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    32e7b94a
drm_auth.c 3.1 KB