drm/amdgpu: make display pinning more flexible (v2)
authorjsg <jsg@openbsd.org>
Mon, 9 Jan 2023 04:19:25 +0000 (04:19 +0000)
committerjsg <jsg@openbsd.org>
Mon, 9 Jan 2023 04:19:25 +0000 (04:19 +0000)
From Alex Deucher
52beaa0938ad33f3ee848c22935af967e3cce005 in linux-6.1.y/6.1.4
81d0bcf9900932633d270d5bc4a54ff599c6ebdb in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_object.c

index a42253b..7194ff2 100644 (file)
@@ -1532,7 +1532,8 @@ u64 amdgpu_bo_gpu_offset_no_check(struct amdgpu_bo *bo)
 uint32_t amdgpu_bo_get_preferred_domain(struct amdgpu_device *adev,
                                            uint32_t domain)
 {
-       if (domain == (AMDGPU_GEM_DOMAIN_VRAM | AMDGPU_GEM_DOMAIN_GTT)) {
+       if ((domain == (AMDGPU_GEM_DOMAIN_VRAM | AMDGPU_GEM_DOMAIN_GTT)) &&
+           ((adev->asic_type == CHIP_CARRIZO) || (adev->asic_type == CHIP_STONEY))) {
                domain = AMDGPU_GEM_DOMAIN_VRAM;
                if (adev->gmc.real_vram_size <= AMDGPU_SG_THRESHOLD)
                        domain = AMDGPU_GEM_DOMAIN_GTT;