Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d54fbd49 authored by Jerome Glisse's avatar Jerome Glisse Committed by Dave Airlie
Browse files

drm/radeon: silence out possible lock dependency warning



Silence out the lock dependency warning by moving bo allocation out
of ib mutex protected section. Might lead to useless temporary
allocation but it's not harmful as such things only happen at
initialization.

Signed-off-by: default avatarJerome Glisse <jglisse@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 598781d7
Loading
Loading
Loading
Loading
+11 −8
Original line number Original line Diff line number Diff line
@@ -204,22 +204,25 @@ int radeon_ib_schedule(struct radeon_device *rdev, struct radeon_ib *ib)


int radeon_ib_pool_init(struct radeon_device *rdev)
int radeon_ib_pool_init(struct radeon_device *rdev)
{
{
	struct radeon_sa_manager tmp;
	int i, r;
	int i, r;


	mutex_lock(&rdev->ib_pool.mutex);
	r = radeon_sa_bo_manager_init(rdev, &tmp,
	if (rdev->ib_pool.ready) {
		mutex_unlock(&rdev->ib_pool.mutex);
		return 0;
	}

	r = radeon_sa_bo_manager_init(rdev, &rdev->ib_pool.sa_manager,
				      RADEON_IB_POOL_SIZE*64*1024,
				      RADEON_IB_POOL_SIZE*64*1024,
				      RADEON_GEM_DOMAIN_GTT);
				      RADEON_GEM_DOMAIN_GTT);
	if (r) {
	if (r) {
		mutex_unlock(&rdev->ib_pool.mutex);
		return r;
		return r;
	}
	}


	mutex_lock(&rdev->ib_pool.mutex);
	if (rdev->ib_pool.ready) {
		mutex_unlock(&rdev->ib_pool.mutex);
		radeon_sa_bo_manager_fini(rdev, &tmp);
		return 0;
	}

	rdev->ib_pool.sa_manager = tmp;
	INIT_LIST_HEAD(&rdev->ib_pool.sa_manager.sa_bo);
	for (i = 0; i < RADEON_IB_POOL_SIZE; i++) {
	for (i = 0; i < RADEON_IB_POOL_SIZE; i++) {
		rdev->ib_pool.ibs[i].fence = NULL;
		rdev->ib_pool.ibs[i].fence = NULL;
		rdev->ib_pool.ibs[i].idx = i;
		rdev->ib_pool.ibs[i].idx = i;