Commit a2a8fb51 authored by Emily Deng's avatar Emily Deng Committed by Alex Deucher
Browse files

drm/amdgpu/sriov: Correct the setting about sdma doorbell offset of Vega10



Correct the format

For vega10 sriov, the sdma doorbell must be fixed as follow to keep the
same setting with host driver, or it will happen conflicts.

Signed-off-by: default avatarEmily Deng <Emily.Deng@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c5892230
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -420,6 +420,15 @@ typedef enum _AMDGPU_DOORBELL64_ASSIGNMENT
	AMDGPU_DOORBELL64_sDMA_ENGINE1            = 0xE8,
	AMDGPU_DOORBELL64_sDMA_HI_PRI_ENGINE1     = 0xE9,

	/* For vega10 sriov, the sdma doorbell must be fixed as follow
	 * to keep the same setting with host driver, or it will
	 * happen conflicts
	 */
	AMDGPU_VEGA10_DOORBELL64_sDMA_ENGINE0            = 0xF0,
	AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE0     = 0xF1,
	AMDGPU_VEGA10_DOORBELL64_sDMA_ENGINE1            = 0xF2,
	AMDGPU_VEGA10_DOORBELL64_sDMA_HI_PRI_ENGINE1     = 0xF3,

	/* Interrupt handler */
	AMDGPU_DOORBELL64_IH                      = 0xF4,  /* For legacy interrupt ring buffer */
	AMDGPU_DOORBELL64_IH_RING1                = 0xF5,  /* For page migration request log */
+19 −8
Original line number Diff line number Diff line
@@ -178,6 +178,16 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev)
			 * process in case of 64-bit doorbells so we
			 * can use each doorbell assignment twice.
			 */
			if (adev->asic_type == CHIP_VEGA10) {
				gpu_resources.sdma_doorbell[0][i] =
					AMDGPU_VEGA10_DOORBELL64_sDMA_ENGINE0 + (i >> 1);
				gpu_resources.sdma_doorbell[0][i+1] =
					AMDGPU_VEGA10_DOORBELL64_sDMA_ENGINE0 + 0x200 + (i >> 1);
				gpu_resources.sdma_doorbell[1][i] =
					AMDGPU_VEGA10_DOORBELL64_sDMA_ENGINE1 + (i >> 1);
				gpu_resources.sdma_doorbell[1][i+1] =
					AMDGPU_VEGA10_DOORBELL64_sDMA_ENGINE1 + 0x200 + (i >> 1);
			} else {
				gpu_resources.sdma_doorbell[0][i] =
					AMDGPU_DOORBELL64_sDMA_ENGINE0 + (i >> 1);
				gpu_resources.sdma_doorbell[0][i+1] =
@@ -187,6 +197,7 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev)
				gpu_resources.sdma_doorbell[1][i+1] =
					AMDGPU_DOORBELL64_sDMA_ENGINE1 + 0x200 + (i >> 1);
			}
		}
		/* Doorbells 0x0e0-0ff and 0x2e0-2ff are reserved for
		 * SDMA, IH and VCN. So don't use them for the CP.
		 */
+9 −3
Original line number Diff line number Diff line
@@ -1320,10 +1320,16 @@ static int sdma_v4_0_sw_init(void *handle)
		DRM_INFO("use_doorbell being set to: [%s]\n",
				ring->use_doorbell?"true":"false");

		if (adev->asic_type == CHIP_VEGA10)
			ring->doorbell_index = (i == 0) ?
				(AMDGPU_VEGA10_DOORBELL64_sDMA_ENGINE0 << 1) //get DWORD offset
				: (AMDGPU_VEGA10_DOORBELL64_sDMA_ENGINE1 << 1); // get DWORD offset
		else
			ring->doorbell_index = (i == 0) ?
				(AMDGPU_DOORBELL64_sDMA_ENGINE0 << 1) //get DWORD offset
				: (AMDGPU_DOORBELL64_sDMA_ENGINE1 << 1); // get DWORD offset


		sprintf(ring->name, "sdma%d", i);
		r = amdgpu_ring_init(adev, ring, 1024,
				     &adev->sdma.trap_irq,