|
@@ -1833,6 +1833,43 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int amdgpu_device_enable_mgpu_fan_boost(void)
|
|
|
|
+{
|
|
|
|
+ struct amdgpu_gpu_instance *gpu_ins;
|
|
|
|
+ struct amdgpu_device *adev;
|
|
|
|
+ int i, ret = 0;
|
|
|
|
+
|
|
|
|
+ mutex_lock(&mgpu_info.mutex);
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * MGPU fan boost feature should be enabled
|
|
|
|
+ * only when there are two or more dGPUs in
|
|
|
|
+ * the system
|
|
|
|
+ */
|
|
|
|
+ if (mgpu_info.num_dgpu < 2)
|
|
|
|
+ goto out;
|
|
|
|
+
|
|
|
|
+ for (i = 0; i < mgpu_info.num_dgpu; i++) {
|
|
|
|
+ gpu_ins = &(mgpu_info.gpu_ins[i]);
|
|
|
|
+ adev = gpu_ins->adev;
|
|
|
|
+ if (!(adev->flags & AMD_IS_APU) &&
|
|
|
|
+ !gpu_ins->mgpu_fan_enabled &&
|
|
|
|
+ adev->powerplay.pp_funcs &&
|
|
|
|
+ adev->powerplay.pp_funcs->enable_mgpu_fan_boost) {
|
|
|
|
+ ret = amdgpu_dpm_enable_mgpu_fan_boost(adev);
|
|
|
|
+ if (ret)
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
+ gpu_ins->mgpu_fan_enabled = 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+out:
|
|
|
|
+ mutex_unlock(&mgpu_info.mutex);
|
|
|
|
+
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* amdgpu_device_ip_late_init_func_handler - work handler for ib test
|
|
* amdgpu_device_ip_late_init_func_handler - work handler for ib test
|
|
*
|
|
*
|
|
@@ -1847,6 +1884,10 @@ static void amdgpu_device_ip_late_init_func_handler(struct work_struct *work)
|
|
r = amdgpu_ib_ring_tests(adev);
|
|
r = amdgpu_ib_ring_tests(adev);
|
|
if (r)
|
|
if (r)
|
|
DRM_ERROR("ib ring test failed (%d).\n", r);
|
|
DRM_ERROR("ib ring test failed (%d).\n", r);
|
|
|
|
+
|
|
|
|
+ r = amdgpu_device_enable_mgpu_fan_boost();
|
|
|
|
+ if (r)
|
|
|
|
+ DRM_ERROR("enable mgpu fan boost failed (%d).\n", r);
|
|
}
|
|
}
|
|
|
|
|
|
static void amdgpu_device_delay_enable_gfx_off(struct work_struct *work)
|
|
static void amdgpu_device_delay_enable_gfx_off(struct work_struct *work)
|