]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
Merge tag 'kvm-x86-fixes-6.7-rcN' of https://github.com/kvm-x86/linux into kvm-master
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_object.c
index 0dcb6c36b02c0baa29c0c98347724ed0970f2c3a..d79b4ca1ecfc4a0028bceb48703ea2cf3d989067 100644 (file)
@@ -1062,9 +1062,6 @@ static const char * const amdgpu_vram_names[] = {
  */
 int amdgpu_bo_init(struct amdgpu_device *adev)
 {
-       /* set the default AGP aperture state */
-       amdgpu_gmc_set_agp_default(adev, &adev->gmc);
-
        /* On A+A platform, VRAM can be mapped as WB */
        if (!adev->gmc.xgmi.connected_to_cpu && !adev->gmc.is_app_apu) {
                /* reserve PAT memory space to WC for VRAM */
@@ -1530,10 +1527,14 @@ u64 amdgpu_bo_gpu_offset(struct amdgpu_bo *bo)
 u64 amdgpu_bo_gpu_offset_no_check(struct amdgpu_bo *bo)
 {
        struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
-       uint64_t offset;
+       uint64_t offset = AMDGPU_BO_INVALID_OFFSET;
+
+       if (bo->tbo.resource->mem_type == TTM_PL_TT)
+               offset = amdgpu_gmc_agp_addr(&bo->tbo);
 
-       offset = (bo->tbo.resource->start << PAGE_SHIFT) +
-                amdgpu_ttm_domain_start(adev, bo->tbo.resource->mem_type);
+       if (offset == AMDGPU_BO_INVALID_OFFSET)
+               offset = (bo->tbo.resource->start << PAGE_SHIFT) +
+                       amdgpu_ttm_domain_start(adev, bo->tbo.resource->mem_type);
 
        return amdgpu_gmc_sign_extend(offset);
 }
This page took 0.033728 seconds and 4 git commands to generate.