Commit 6b0538da authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge branch 'drm-fixes-5.2' of git://people.freedesktop.org/~agd5f/linux into drm-fixes



Fixes for 5.2:
- Fix for DMCU firmware issues for stable
- Add missing polaris10 pci id to kfd
- Screen corruption fix on picasso
- Fix for driver reload on vega10
- SR-IOV fixes
- Locking fix in new SMU code
- Compute profile switching fix for KFD

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190522205425.3657-1-alexander.deucher@amd.com
parents eab007dd 43d8107f
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -877,6 +877,8 @@ static int psp_load_fw(struct amdgpu_device *adev)
	if (!psp->cmd)
		return -ENOMEM;

	/* this fw pri bo is not used under SRIOV */
	if (!amdgpu_sriov_vf(psp->adev)) {
		ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
					      AMDGPU_GEM_DOMAIN_GTT,
					      &psp->fw_pri_bo,
@@ -884,6 +886,7 @@ static int psp_load_fw(struct amdgpu_device *adev)
					      &psp->fw_pri_buf);
		if (ret)
			goto failed;
	}

	ret = amdgpu_bo_create_kernel(adev, PSP_FENCE_BUFFER_SIZE, PAGE_SIZE,
					AMDGPU_GEM_DOMAIN_VRAM,
+10 −1
Original line number Diff line number Diff line
@@ -626,6 +626,7 @@ static bool gmc_v9_0_keep_stolen_memory(struct amdgpu_device *adev)
	case CHIP_VEGA10:
		return true;
	case CHIP_RAVEN:
		return (adev->pdev->device == 0x15d8);
	case CHIP_VEGA12:
	case CHIP_VEGA20:
	default:
@@ -812,8 +813,16 @@ static int gmc_v9_0_mc_init(struct amdgpu_device *adev)
	int chansize, numchan;
	int r;

	if (amdgpu_emu_mode != 1)
	if (amdgpu_sriov_vf(adev)) {
		/* For Vega10 SR-IOV, vram_width can't be read from ATOM as RAVEN,
		 * and DF related registers is not readable, seems hardcord is the
		 * only way to set the correct vram_width
		 */
		adev->gmc.vram_width = 2048;
	} else if (amdgpu_emu_mode != 1) {
		adev->gmc.vram_width = amdgpu_atomfirmware_get_vram_width(adev);
	}

	if (!adev->gmc.vram_width) {
		/* hbm memory channel size */
		if (adev->flags & AMD_IS_APU)
+5 −0
Original line number Diff line number Diff line
@@ -730,6 +730,11 @@ static bool soc15_need_reset_on_init(struct amdgpu_device *adev)
{
	u32 sol_reg;

	/* Just return false for soc15 GPUs.  Reset does not seem to
	 * be necessary.
	 */
	return false;

	if (adev->flags & AMD_IS_APU)
		return false;

+17 −0
Original line number Diff line number Diff line
@@ -355,6 +355,7 @@ static const struct kfd_deviceid supported_devices[] = {
	{ 0x67CF, &polaris10_device_info },	/* Polaris10 */
	{ 0x67D0, &polaris10_vf_device_info },	/* Polaris10 vf*/
	{ 0x67DF, &polaris10_device_info },	/* Polaris10 */
	{ 0x6FDF, &polaris10_device_info },	/* Polaris10 */
	{ 0x67E0, &polaris11_device_info },	/* Polaris11 */
	{ 0x67E1, &polaris11_device_info },	/* Polaris11 */
	{ 0x67E3, &polaris11_device_info },	/* Polaris11 */
@@ -462,6 +463,7 @@ struct kfd_dev *kgd2kfd_probe(struct kgd_dev *kgd,
	kfd->pdev = pdev;
	kfd->init_complete = false;
	kfd->kfd2kgd = f2g;
	atomic_set(&kfd->compute_profile, 0);

	mutex_init(&kfd->doorbell_mutex);
	memset(&kfd->doorbell_available_index, 0,
@@ -1036,6 +1038,21 @@ void kgd2kfd_set_sram_ecc_flag(struct kfd_dev *kfd)
		atomic_inc(&kfd->sram_ecc_flag);
}

void kfd_inc_compute_active(struct kfd_dev *kfd)
{
	if (atomic_inc_return(&kfd->compute_profile) == 1)
		amdgpu_amdkfd_set_compute_idle(kfd->kgd, false);
}

void kfd_dec_compute_active(struct kfd_dev *kfd)
{
	int count = atomic_dec_return(&kfd->compute_profile);

	if (count == 0)
		amdgpu_amdkfd_set_compute_idle(kfd->kgd, true);
	WARN_ONCE(count < 0, "Compute profile ref. count error");
}

#if defined(CONFIG_DEBUG_FS)

/* This function will send a package to HIQ to hang the HWS
+6 −5
Original line number Diff line number Diff line
@@ -811,8 +811,8 @@ static int register_process(struct device_queue_manager *dqm,

	retval = dqm->asic_ops.update_qpd(dqm, qpd);

	if (dqm->processes_count++ == 0)
		amdgpu_amdkfd_set_compute_idle(dqm->dev->kgd, false);
	dqm->processes_count++;
	kfd_inc_compute_active(dqm->dev);

	dqm_unlock(dqm);

@@ -835,9 +835,8 @@ static int unregister_process(struct device_queue_manager *dqm,
		if (qpd == cur->qpd) {
			list_del(&cur->list);
			kfree(cur);
			if (--dqm->processes_count == 0)
				amdgpu_amdkfd_set_compute_idle(
					dqm->dev->kgd, true);
			dqm->processes_count--;
			kfd_dec_compute_active(dqm->dev);
			goto out;
		}
	}
@@ -1539,6 +1538,7 @@ static int process_termination_nocpsch(struct device_queue_manager *dqm,
			list_del(&cur->list);
			kfree(cur);
			dqm->processes_count--;
			kfd_dec_compute_active(dqm->dev);
			break;
		}
	}
@@ -1626,6 +1626,7 @@ static int process_termination_cpsch(struct device_queue_manager *dqm,
			list_del(&cur->list);
			kfree(cur);
			dqm->processes_count--;
			kfd_dec_compute_active(dqm->dev);
			break;
		}
	}
Loading