From c10c8f7c27103bd7ac02d041d9d6e97296d48fc1 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deucher@amd.com>
Date: Fri, 10 Feb 2017 18:09:32 -0500
Subject: [PATCH] drm/amdgpu/pm: check for headless before calling
 compute_clocks

Don't update display bandwidth on headless asics.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=99387

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index 95e026a..346e80a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -1283,7 +1283,9 @@ void amdgpu_pm_compute_clocks(struct amd
 	if (adev->pp_enabled) {
 		int i = 0;
 
-		amdgpu_display_bandwidth_update(adev);
+		if (adev->mode_info.num_crtc)
+			amdgpu_display_bandwidth_update(adev);
+
 		for (i = 0; i < AMDGPU_MAX_RINGS; i++) {
 			struct amdgpu_ring *ring = adev->rings[i];
 			if (ring && ring->ready)
