drm/amdgpu: only allow scatter/gather display with DC
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 12 Jan 2018 19:56:49 +0000 (14:56 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 19 Feb 2018 19:17:39 +0000 (14:17 -0500)
Check if DC is enabled before allowing scanout buffers
to be pinned in system memory.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

index 8ede2645a06c417b1bc5e8784e042b1d1dce9d47..859942552e9fa9e7d264fbf21a4816673d17d41f 100644 (file)
@@ -507,9 +507,12 @@ uint32_t amdgpu_display_framebuffer_domains(struct amdgpu_device *adev)
 {
        uint32_t domain = AMDGPU_GEM_DOMAIN_VRAM;
 
+#if defined(CONFIG_DRM_AMD_DC)
        if (adev->asic_type >= CHIP_CARRIZO && adev->asic_type < CHIP_RAVEN &&
-           adev->flags & AMD_IS_APU)
+           adev->flags & AMD_IS_APU &&
+           amdgpu_device_asic_has_dc_support(adev->asic_type))
                domain |= AMDGPU_GEM_DOMAIN_GTT;
+#endif
 
        return domain;
 }