Commit fd546bc5 authored by Alex Deucher's avatar Alex Deucher
Browse files

drm/amdgpu/display: split dmcu and gpuvm handling logic



Separate the logic for each of these features to make the
code easier to understand and update in the future.

Acked-by: default avatarYifan Zhang <yifan1.zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent b784f42c
Loading
Loading
Loading
Loading
+20 −15
Original line number Diff line number Diff line
@@ -1443,15 +1443,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)

	init_data.dce_environment = DCE_ENV_PRODUCTION_DRV;

	switch (adev->asic_type) {
	case CHIP_CARRIZO:
	case CHIP_STONEY:
		init_data.flags.gpu_vm_support = true;
		break;
	default:
	switch (adev->ip_versions[DCE_HWIP][0]) {
	case IP_VERSION(2, 1, 0):
			init_data.flags.gpu_vm_support = true;
		switch (adev->dm.dmcub_fw_version) {
		case 0: /* development */
		case 0x1: /* linux-firmware.git hash 6d9f399 */
@@ -1462,17 +1455,29 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
			init_data.flags.disable_dmcu = true;
		}
		break;
	case IP_VERSION(2, 0, 3):
		init_data.flags.disable_dmcu = true;
		break;
	default:
		break;
	}

	switch (adev->asic_type) {
	case CHIP_CARRIZO:
	case CHIP_STONEY:
		init_data.flags.gpu_vm_support = true;
		break;
	default:
		switch (adev->ip_versions[DCE_HWIP][0]) {
		case IP_VERSION(1, 0, 0):
		case IP_VERSION(1, 0, 1):
		case IP_VERSION(2, 1, 0):
		case IP_VERSION(3, 0, 1):
		case IP_VERSION(3, 1, 2):
		case IP_VERSION(3, 1, 3):
		case IP_VERSION(3, 1, 5):
			init_data.flags.gpu_vm_support = true;
			break;
		case IP_VERSION(2, 0, 3):
			init_data.flags.disable_dmcu = true;
			break;
		default:
			break;
		}