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

Commit 53530e16 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

drm/msm: Simplify ringbuffer cleanup



Cleanup and consolidate sanity checking on the ringbuffer
cleanup code.

Change-Id: Ic0dedbad551d36ca8ed3db56a4366a5008768791
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent d8505d83
Loading
Loading
Loading
Loading
+3 −12
Original line number Diff line number Diff line
@@ -935,10 +935,8 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
	return 0;

fail:
	for (i = 0; i < ARRAY_SIZE(gpu->rb); i++) {
		if (gpu->rb[i])
	for (i = 0; i < ARRAY_SIZE(gpu->rb); i++)
		msm_ringbuffer_destroy(gpu->rb[i]);
	}

	pm_runtime_disable(&pdev->dev);
	return ret;
@@ -957,15 +955,8 @@ void msm_gpu_cleanup(struct msm_gpu *gpu)

	bs_fini(gpu);

	for (i = 0; i < ARRAY_SIZE(gpu->rb); i++) {
		if (!gpu->rb[i])
			continue;

		if (gpu->rb[i]->iova)
			msm_gem_put_iova(gpu->rb[i]->bo, gpu->aspace);

	for (i = 0; i < ARRAY_SIZE(gpu->rb); i++)
		msm_ringbuffer_destroy(gpu->rb[i]);
	}

	msm_snapshot_destroy(gpu, gpu->snapshot);
	pm_runtime_disable(&pdev->dev);
+4 −1
Original line number Diff line number Diff line
@@ -60,7 +60,10 @@ fail:

void msm_ringbuffer_destroy(struct msm_ringbuffer *ring)
{
	if (ring->bo)
	if (ring && ring->bo) {
		msm_gem_put_iova(ring->bo, ring->gpu->aspace);
		drm_gem_object_unreference_unlocked(ring->bo);
	}

	kfree(ring);
}