Commit fc4d2627 authored by Dave Airlie's avatar Dave Airlie
Browse files

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

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

 into drm-fixes

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

amdgpu:
- Fix invalid UBSAN warnings
- Fix artifacts in MPO transitions
- Hibernation fix

amdkfd:
- Fix an eviction fence leak

radeon:
- Add late register for connectors
- Always set GEM function pointers

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

From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241008142831.3739244-1-alexander.deucher@amd.com
parents 8cf0b939 32fda565
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1439,7 +1439,7 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info,
	list_add_tail(&vm->vm_list_node,
			&(vm->process_info->vm_list_head));
	vm->process_info->n_vms++;

	if (ef)
		*ef = dma_fence_get(&vm->process_info->eviction_fence->base);
	mutex_unlock(&vm->process_info->lock);

+5 −2
Original line number Diff line number Diff line
@@ -1702,12 +1702,15 @@ int kfd_process_device_init_vm(struct kfd_process_device *pdd,

	ret = amdgpu_amdkfd_gpuvm_acquire_process_vm(dev->adev, avm,
						     &p->kgd_process_info,
						     &ef);
						     p->ef ? NULL : &ef);
	if (ret) {
		dev_err(dev->adev->dev, "Failed to create process VM object\n");
		return ret;
	}

	if (!p->ef)
		RCU_INIT_POINTER(p->ef, ef);

	pdd->drm_priv = drm_file->private_data;

	ret = kfd_process_device_reserve_ib_mem(pdd);
+4 −3
Original line number Diff line number Diff line
@@ -2972,10 +2972,11 @@ static int dm_suspend(void *handle)

	hpd_rx_irq_work_suspend(dm);

	if (adev->dm.dc->caps.ips_support)
		dc_allow_idle_optimizations(adev->dm.dc, true);

	dc_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D3);

	if (dm->dc->caps.ips_support && adev->in_s0ix)
		dc_allow_idle_optimizations(dm->dc, true);

	dc_dmub_srv_set_power_state(dm->dc->ctx->dmub_srv, DC_ACPI_CM_POWER_STATE_D3);

	return 0;
+34 −11
Original line number Diff line number Diff line
@@ -5065,11 +5065,26 @@ static bool update_planes_and_stream_v3(struct dc *dc,
	return true;
}

static void clear_update_flags(struct dc_surface_update *srf_updates,
	int surface_count, struct dc_stream_state *stream)
{
	int i;

	if (stream)
		stream->update_flags.raw = 0;

	for (i = 0; i < surface_count; i++)
		if (srf_updates[i].surface)
			srf_updates[i].surface->update_flags.raw = 0;
}

bool dc_update_planes_and_stream(struct dc *dc,
		struct dc_surface_update *srf_updates, int surface_count,
		struct dc_stream_state *stream,
		struct dc_stream_update *stream_update)
{
	bool ret = false;

	dc_exit_ips_for_hw_access(dc);
	/*
	 * update planes and stream version 3 separates FULL and FAST updates
@@ -5086,10 +5101,16 @@ bool dc_update_planes_and_stream(struct dc *dc,
	 * features as they are now transparent to the new sequence.
	 */
	if (dc->ctx->dce_version >= DCN_VERSION_4_01)
		return update_planes_and_stream_v3(dc, srf_updates,
		ret = update_planes_and_stream_v3(dc, srf_updates,
				surface_count, stream, stream_update);
	return update_planes_and_stream_v2(dc, srf_updates,
	else
		ret = update_planes_and_stream_v2(dc, srf_updates,
			surface_count, stream, stream_update);

	if (ret)
		clear_update_flags(srf_updates, surface_count, stream);

	return ret;
}

void dc_commit_updates_for_stream(struct dc *dc,
@@ -5099,6 +5120,8 @@ void dc_commit_updates_for_stream(struct dc *dc,
		struct dc_stream_update *stream_update,
		struct dc_state *state)
{
	bool ret = false;

	dc_exit_ips_for_hw_access(dc);
	/* TODO: Since change commit sequence can have a huge impact,
	 * we decided to only enable it for DCN3x. However, as soon as
@@ -5106,17 +5129,17 @@ void dc_commit_updates_for_stream(struct dc *dc,
	 * the new sequence for all ASICs.
	 */
	if (dc->ctx->dce_version >= DCN_VERSION_4_01) {
		update_planes_and_stream_v3(dc, srf_updates, surface_count,
		ret = update_planes_and_stream_v3(dc, srf_updates, surface_count,
				stream, stream_update);
		return;
	}
	if (dc->ctx->dce_version >= DCN_VERSION_3_2) {
		update_planes_and_stream_v2(dc, srf_updates, surface_count,
	} else if (dc->ctx->dce_version >= DCN_VERSION_3_2) {
		ret = update_planes_and_stream_v2(dc, srf_updates, surface_count,
				stream, stream_update);
		return;
	}
	update_planes_and_stream_v1(dc, srf_updates, surface_count, stream,
	} else
		ret = update_planes_and_stream_v1(dc, srf_updates, surface_count, stream,
				stream_update, state);

	if (ret)
		clear_update_flags(srf_updates, surface_count, stream);
}

uint8_t dc_get_current_stream_count(struct dc *dc)
+13 −13
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ struct vi_dpm_level {

struct vi_dpm_table {
	uint32_t count;
	struct vi_dpm_level dpm_level[] __counted_by(count);
	struct vi_dpm_level dpm_level[];
};

#define PCIE_PERF_REQ_REMOVE_REGISTRY   0
@@ -91,7 +91,7 @@ struct phm_set_power_state_input {

struct phm_clock_array {
	uint32_t count;
	uint32_t values[] __counted_by(count);
	uint32_t values[];
};

struct phm_clock_voltage_dependency_record {
@@ -123,7 +123,7 @@ struct phm_acpclock_voltage_dependency_record {

struct phm_clock_voltage_dependency_table {
	uint32_t count;
	struct phm_clock_voltage_dependency_record entries[] __counted_by(count);
	struct phm_clock_voltage_dependency_record entries[];
};

struct phm_phase_shedding_limits_record {
@@ -140,7 +140,7 @@ struct phm_uvd_clock_voltage_dependency_record {

struct phm_uvd_clock_voltage_dependency_table {
	uint8_t count;
	struct phm_uvd_clock_voltage_dependency_record entries[] __counted_by(count);
	struct phm_uvd_clock_voltage_dependency_record entries[];
};

struct phm_acp_clock_voltage_dependency_record {
@@ -150,7 +150,7 @@ struct phm_acp_clock_voltage_dependency_record {

struct phm_acp_clock_voltage_dependency_table {
	uint32_t count;
	struct phm_acp_clock_voltage_dependency_record entries[] __counted_by(count);
	struct phm_acp_clock_voltage_dependency_record entries[];
};

struct phm_vce_clock_voltage_dependency_record {
@@ -161,32 +161,32 @@ struct phm_vce_clock_voltage_dependency_record {

struct phm_phase_shedding_limits_table {
	uint32_t count;
	struct phm_phase_shedding_limits_record  entries[] __counted_by(count);
	struct phm_phase_shedding_limits_record  entries[];
};

struct phm_vceclock_voltage_dependency_table {
	uint8_t count;
	struct phm_vceclock_voltage_dependency_record entries[] __counted_by(count);
	struct phm_vceclock_voltage_dependency_record entries[];
};

struct phm_uvdclock_voltage_dependency_table {
	uint8_t count;
	struct phm_uvdclock_voltage_dependency_record entries[] __counted_by(count);
	struct phm_uvdclock_voltage_dependency_record entries[];
};

struct phm_samuclock_voltage_dependency_table {
	uint8_t count;
	struct phm_samuclock_voltage_dependency_record entries[] __counted_by(count);
	struct phm_samuclock_voltage_dependency_record entries[];
};

struct phm_acpclock_voltage_dependency_table {
	uint32_t count;
	struct phm_acpclock_voltage_dependency_record entries[] __counted_by(count);
	struct phm_acpclock_voltage_dependency_record entries[];
};

struct phm_vce_clock_voltage_dependency_table {
	uint8_t count;
	struct phm_vce_clock_voltage_dependency_record entries[] __counted_by(count);
	struct phm_vce_clock_voltage_dependency_record entries[];
};


@@ -393,7 +393,7 @@ union phm_cac_leakage_record {

struct phm_cac_leakage_table {
	uint32_t count;
	union phm_cac_leakage_record entries[] __counted_by(count);
	union phm_cac_leakage_record entries[];
};

struct phm_samu_clock_voltage_dependency_record {
@@ -404,7 +404,7 @@ struct phm_samu_clock_voltage_dependency_record {

struct phm_samu_clock_voltage_dependency_table {
	uint8_t count;
	struct phm_samu_clock_voltage_dependency_record entries[] __counted_by(count);
	struct phm_samu_clock_voltage_dependency_record entries[];
};

struct phm_cac_tdp_table {
Loading