6d393ef5ff
As we shrink an object, also see if we can prune the dma-resv of idle fences it is maintaining a reference to. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201223122051.4624-2-chris@chris-wilson.co.uk
18 lines
329 B
C
18 lines
329 B
C
// SPDX-License-Identifier: MIT
|
|
/*
|
|
* Copyright © 2020 Intel Corporation
|
|
*/
|
|
|
|
#include <linux/dma-resv.h>
|
|
|
|
#include "dma_resv_utils.h"
|
|
|
|
void dma_resv_prune(struct dma_resv *resv)
|
|
{
|
|
if (dma_resv_trylock(resv)) {
|
|
if (dma_resv_test_signaled_rcu(resv, true))
|
|
dma_resv_add_excl_fence(resv, NULL);
|
|
dma_resv_unlock(resv);
|
|
}
|
|
}
|