From 91ce4668b8dd0442c1b167149c821267504a42e0 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 27 Jan 2017 10:31:52 -0500 Subject: [PATCH] drm/amdgpu/si: fix crash on headless asics Missing check for crtcs present. Backported fix by Luya Tshimbalanga Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=193341 https://bugs.freedesktop.org/show_bug.cgi?id=99387 Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org diff -ruN linux-4.9.6-20170203.amd.fc25.x86_64.orig/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c linux-4.9.6-20170203.amd.fc25.x86_64/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c --- linux-4.9.6-20170203.amd.fc25.x86_64.orig/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c 2017-02-03 20:22:39.555283318 -0800 +++ linux-4.9.6-20170203.amd.fc25.x86_64/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c 2017-02-03 20:01:40.053298148 -0800 @@ -254,6 +254,10 @@ } WREG32(mmHDP_REG_COHERENCY_FLUSH_CNTL, 0); + + if (adev->mode_info.num_crtc) + amdgpu_display_set_vga_render_state(adev, false); + gmc_v6_0_mc_stop(adev, &save); if (gmc_v6_0_wait_for_idle((void *)adev)) { @@ -283,7 +287,6 @@ dev_warn(adev->dev, "Wait for MC idle timedout !\n"); } gmc_v6_0_mc_resume(adev, &save); - amdgpu_display_set_vga_render_state(adev, false); } static int gmc_v6_0_mc_init(struct amdgpu_device *adev)