drm/amdgpu: use SDMA round robin for VM updates v3
[deliverable/linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_device.c
index 65531463f88e5b9eb736fdd5e9df357f2f191680..6bdb891b9ddc2e1433c42850794ff9245ad95c03 100644 (file)
@@ -635,31 +635,6 @@ bool amdgpu_card_posted(struct amdgpu_device *adev)
 
 }
 
-/**
- * amdgpu_boot_test_post_card - check and possibly initialize the hw
- *
- * @adev: amdgpu_device pointer
- *
- * Check if the asic is initialized and if not, attempt to initialize
- * it (all asics).
- * Returns true if initialized or false if not.
- */
-bool amdgpu_boot_test_post_card(struct amdgpu_device *adev)
-{
-       if (amdgpu_card_posted(adev))
-               return true;
-
-       if (adev->bios) {
-               DRM_INFO("GPU not posted. posting now...\n");
-               if (adev->is_atom_bios)
-                       amdgpu_atom_asic_init(adev->mode_info.atom_context);
-               return true;
-       } else {
-               dev_err(adev->dev, "Card not posted and no BIOS - ignoring\n");
-               return false;
-       }
-}
-
 /**
  * amdgpu_dummy_page_init - init dummy page used by the driver
  *
@@ -959,12 +934,6 @@ static void amdgpu_check_arguments(struct amdgpu_device *adev)
                         amdgpu_sched_jobs);
                amdgpu_sched_jobs = roundup_pow_of_two(amdgpu_sched_jobs);
        }
-       /* vramlimit must be a power of two */
-       if (!amdgpu_check_pot_argument(amdgpu_vram_limit)) {
-               dev_warn(adev->dev, "vram limit (%d) must be a power of 2\n",
-                               amdgpu_vram_limit);
-               amdgpu_vram_limit = 0;
-       }
 
        if (amdgpu_gart_size != -1) {
                /* gtt size must be power of two and greater or equal to 32M */
@@ -1434,7 +1403,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
        adev->mman.buffer_funcs = NULL;
        adev->mman.buffer_funcs_ring = NULL;
        adev->vm_manager.vm_pte_funcs = NULL;
-       adev->vm_manager.vm_pte_funcs_ring = NULL;
+       adev->vm_manager.vm_pte_num_rings = 0;
        adev->gart.gart_funcs = NULL;
        adev->fence_context = fence_context_alloc(AMDGPU_MAX_RINGS);
 
@@ -1455,7 +1424,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 
        /* mutex initialization are all done here so we
         * can recall function without having locking issues */
-       mutex_init(&adev->ring_lock);
+       mutex_init(&adev->vm_manager.lock);
        atomic_set(&adev->irq.ih.lock, 0);
        mutex_init(&adev->gem.mutex);
        mutex_init(&adev->pm.mutex);
@@ -1531,8 +1500,13 @@ int amdgpu_device_init(struct amdgpu_device *adev,
                return r;
        }
 
+       /* See if the asic supports SR-IOV */
+       adev->virtualization.supports_sr_iov =
+               amdgpu_atombios_has_gpu_virtualization_table(adev);
+
        /* Post card if necessary */
-       if (!amdgpu_card_posted(adev)) {
+       if (!amdgpu_card_posted(adev) ||
+           adev->virtualization.supports_sr_iov) {
                if (!adev->bios) {
                        dev_err(adev->dev, "Card not posted and no BIOS - ignoring\n");
                        return -EINVAL;
@@ -1889,6 +1863,9 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev)
 
 retry:
        r = amdgpu_asic_reset(adev);
+       /* post card */
+       amdgpu_atom_asic_init(adev->mode_info.atom_context);
+
        if (!r) {
                dev_info(adev->dev, "GPU reset succeeded, trying to resume\n");
                r = amdgpu_resume(adev);
This page took 0.031973 seconds and 5 git commands to generate.