• Chris Wilson's avatar
    drm/i915: Store a direct lookup from object handle to vma · 4ff4b44c
    Chris Wilson authored
    The advent of full-ppgtt lead to an extra indirection between the object
    and its binding. That extra indirection has a noticeable impact on how
    fast we can convert from the user handles to our internal vma for
    execbuffer. In order to bypass the extra indirection, we use a
    resizable hashtable to jump from the object to the per-ctx vma.
    rhashtable was considered but we don't need the online resizing feature
    and the extra complexity proved to undermine its usefulness. Instead, we
    simply reallocate the hastable on demand in a background task and
    serialize it before iterating.
    
    In non-full-ppgtt modes, multiple files and multiple contexts can share
    the same vma. This leads to having multiple possible handle->vma links,
    so we only use the first to establish the fast path. The majority of
    buffers are not shared and so we should still be able to realise
    speedups with multiple clients.
    
    v2: Prettier names, more magic.
    v3: Many style tweaks, most notably hiding the misuse of execobj[].rsvd2
    Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
    4ff4b44c
mock_context.c 2.3 KB