OSDN Git Service

drm/amdgpu: reserved buffer is not needed with ip discovery enabled
authorAaron Liu <aaron.liu@amd.com>
Wed, 13 Jan 2021 09:14:02 +0000 (17:14 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 4 Jun 2021 20:03:12 +0000 (16:03 -0400)
When IP discovery enabled, the reserved buffer has been alloacted.

Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c

index 86d28dc..4fc1515 100644 (file)
@@ -790,14 +790,17 @@ void amdgpu_gmc_get_reserved_allocation(struct amdgpu_device *adev)
 {
        /* Some ASICs need to reserve a region of video memory to avoid access
         * from driver */
+       adev->mman.stolen_reserved_offset = 0;
+       adev->mman.stolen_reserved_size = 0;
+
        switch (adev->asic_type) {
        case CHIP_YELLOW_CARP:
-               adev->mman.stolen_reserved_offset = 0x1ffb0000;
-               adev->mman.stolen_reserved_size = 64 * PAGE_SIZE;
+               if (amdgpu_discovery == 0) {
+                       adev->mman.stolen_reserved_offset = 0x1ffb0000;
+                       adev->mman.stolen_reserved_size = 64 * PAGE_SIZE;
+               }
                break;
        default:
-               adev->mman.stolen_reserved_offset = 0;
-               adev->mman.stolen_reserved_size = 0;
                break;
        }
 }