• Michał Winiarski's avatar
    drm/i915/gtt: Avoid calling kcalloc in a loop when allocating temp bitmaps · 3a41a05d
    Michał Winiarski authored
    On each call to gen8_alloc_va_range_3lvl we're allocating temporary
    bitmaps needed for error handling. Unfortunately, when we increase
    address space size (48b ppgtt) we do additional (512 - 4) calls to
    kcalloc, increasing latency between exec and actual start of execution
    on the GPU. Let's just do a single kcalloc, we can also drop the size
    from free_gen8_temp_bitmaps since it's no longer used.
    
    v2: Use GFP_TEMPORARY to make the allocations reclaimable.
    v3: Drop the 2D array, just allocate a single block.
    v4: Rebase to handle gen8_preallocate_top_level_pdps.
    v5: Align misaligned bracket.
    
    Cc: Chris Wilson <chris@chris-wilson.co.uk>
    Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
    Cc: Michel Thierry <michel.thierry@intel.com>
    Signed-off-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
    Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    [danvet: Correct kcalloc arguments as suggested by Chris.]
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    3a41a05d
i915_gem_gtt.c 89.8 KB