Commit 01541a87 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'amd-drm-fixes-6.12-2024-10-16' of...

Merge tag 'amd-drm-fixes-6.12-2024-10-16' of https://gitlab.freedesktop.org/agd5f/linux

 into drm-fixes

amd-drm-fixes-6.12-2024-10-16:

amdgpu:
- SR-IOV fix
- CS chunk handling fix
- MES fixes
- SMU13 fixes

amdkfd:
- VRAM usage reporting fix

radeon:
- Fix possible_clones handling

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241016200514.3520286-1-alexander.deucher@amd.com
parents 4cd33d97 ec1aab78
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -265,7 +265,7 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p,

			/* Only a single BO list is allowed to simplify handling. */
			if (p->bo_list)
				ret = -EINVAL;
				goto free_partial_kdata;

			ret = amdgpu_cs_p1_bo_handles(p, p->chunks[i].kdata);
			if (ret)
+4 −7
Original line number Diff line number Diff line
@@ -1635,11 +1635,9 @@ int amdgpu_gfx_sysfs_isolation_shader_init(struct amdgpu_device *adev)
{
	int r;

	if (!amdgpu_sriov_vf(adev)) {
	r = device_create_file(adev->dev, &dev_attr_enforce_isolation);
	if (r)
		return r;
	}

	r = device_create_file(adev->dev, &dev_attr_run_cleaner_shader);
	if (r)
@@ -1650,7 +1648,6 @@ int amdgpu_gfx_sysfs_isolation_shader_init(struct amdgpu_device *adev)

void amdgpu_gfx_sysfs_isolation_shader_fini(struct amdgpu_device *adev)
{
	if (!amdgpu_sriov_vf(adev))
	device_remove_file(adev->dev, &dev_attr_enforce_isolation);
	device_remove_file(adev->dev, &dev_attr_run_cleaner_shader);
}
+3 −2
Original line number Diff line number Diff line
@@ -1203,8 +1203,10 @@ int amdgpu_mes_add_ring(struct amdgpu_device *adev, int gang_id,

	r = amdgpu_ring_init(adev, ring, 1024, NULL, 0,
			     AMDGPU_RING_PRIO_DEFAULT, NULL);
	if (r)
	if (r) {
		amdgpu_mes_unlock(&adev->mes);
		goto clean_up_memory;
	}

	amdgpu_mes_ring_to_queue_props(adev, ring, &qprops);

@@ -1237,7 +1239,6 @@ int amdgpu_mes_add_ring(struct amdgpu_device *adev, int gang_id,
	amdgpu_ring_fini(ring);
clean_up_memory:
	kfree(ring);
	amdgpu_mes_unlock(&adev->mes);
	return r;
}

+2 −2
Original line number Diff line number Diff line
@@ -621,7 +621,7 @@ static int mes_v12_0_set_hw_resources(struct amdgpu_mes *mes, int pipe)

	if (amdgpu_mes_log_enable) {
		mes_set_hw_res_pkt.enable_mes_event_int_logging = 1;
		mes_set_hw_res_pkt.event_intr_history_gpu_mc_ptr = mes->event_log_gpu_addr;
		mes_set_hw_res_pkt.event_intr_history_gpu_mc_ptr = mes->event_log_gpu_addr + pipe * AMDGPU_MES_LOG_BUFFER_SIZE;
	}

	return mes_v12_0_submit_pkt_and_poll_completion(mes, pipe,
@@ -1336,7 +1336,7 @@ static int mes_v12_0_sw_init(void *handle)
	adev->mes.kiq_hw_fini = &mes_v12_0_kiq_hw_fini;
	adev->mes.enable_legacy_queue_map = true;

	adev->mes.event_log_size = AMDGPU_MES_LOG_BUFFER_SIZE;
	adev->mes.event_log_size = adev->enable_uni_mes ? (AMDGPU_MAX_MES_PIPES * AMDGPU_MES_LOG_BUFFER_SIZE) : AMDGPU_MES_LOG_BUFFER_SIZE;

	r = amdgpu_mes_init(adev);
	if (r)
+3 −3
Original line number Diff line number Diff line
@@ -1148,7 +1148,7 @@ static int kfd_ioctl_alloc_memory_of_gpu(struct file *filep,

		if (flags & KFD_IOC_ALLOC_MEM_FLAGS_AQL_QUEUE_MEM)
			size >>= 1;
		WRITE_ONCE(pdd->vram_usage, pdd->vram_usage + PAGE_ALIGN(size));
		atomic64_add(PAGE_ALIGN(size), &pdd->vram_usage);
	}

	mutex_unlock(&p->mutex);
@@ -1219,7 +1219,7 @@ static int kfd_ioctl_free_memory_of_gpu(struct file *filep,
		kfd_process_device_remove_obj_handle(
			pdd, GET_IDR_HANDLE(args->handle));

	WRITE_ONCE(pdd->vram_usage, pdd->vram_usage - size);
	atomic64_sub(size, &pdd->vram_usage);

err_unlock:
err_pdd:
@@ -2347,7 +2347,7 @@ static int criu_restore_memory_of_gpu(struct kfd_process_device *pdd,
	} else if (bo_bucket->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_VRAM) {
		bo_bucket->restored_offset = offset;
		/* Update the VRAM usage count */
		WRITE_ONCE(pdd->vram_usage, pdd->vram_usage + bo_bucket->size);
		atomic64_add(bo_bucket->size, &pdd->vram_usage);
	}
	return 0;
}
Loading