]> Git Repo - linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
Merge tag 'parisc-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/delle...
[linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_object.c
index ace837cfa0a6bc850c0c706376194eb2d324d5ad..0dcb6c36b02c0baa29c0c98347724ed0970f2c3a 100644 (file)
@@ -459,7 +459,7 @@ void amdgpu_bo_free_kernel(struct amdgpu_bo **bo, u64 *gpu_addr,
                *cpu_addr = NULL;
 }
 
-/* Validate bo size is bit bigger then the request domain */
+/* Validate bo size is bit bigger than the request domain */
 static bool amdgpu_bo_validate_size(struct amdgpu_device *adev,
                                          unsigned long size, u32 domain)
 {
@@ -469,29 +469,24 @@ static bool amdgpu_bo_validate_size(struct amdgpu_device *adev,
         * If GTT is part of requested domains the check must succeed to
         * allow fall back to GTT.
         */
-       if (domain & AMDGPU_GEM_DOMAIN_GTT) {
+       if (domain & AMDGPU_GEM_DOMAIN_GTT)
                man = ttm_manager_type(&adev->mman.bdev, TTM_PL_TT);
-
-               if (man && size < man->size)
-                       return true;
-               else if (!man)
-                       WARN_ON_ONCE("GTT domain requested but GTT mem manager uninitialized");
-               goto fail;
-       } else if (domain & AMDGPU_GEM_DOMAIN_VRAM) {
+       else if (domain & AMDGPU_GEM_DOMAIN_VRAM)
                man = ttm_manager_type(&adev->mman.bdev, TTM_PL_VRAM);
+       else
+               return true;
 
-               if (man && size < man->size)
-                       return true;
-               goto fail;
+       if (!man) {
+               if (domain & AMDGPU_GEM_DOMAIN_GTT)
+                       WARN_ON_ONCE("GTT domain requested but GTT mem manager uninitialized");
+               return false;
        }
 
        /* TODO add more domains checks, such as AMDGPU_GEM_DOMAIN_CPU, _DOMAIN_DOORBELL */
-       return true;
+       if (size < man->size)
+               return true;
 
-fail:
-       if (man)
-               DRM_DEBUG("BO size %lu > total memory in domain: %llu\n", size,
-                         man->size);
+       DRM_DEBUG("BO size %lu > total memory in domain: %llu\n", size, man->size);
        return false;
 }
 
@@ -1067,6 +1062,9 @@ 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 */
This page took 0.03541 seconds and 4 git commands to generate.