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

Merge tag 'amd-drm-fixes-6.8-2024-02-22' of...

Merge tag 'amd-drm-fixes-6.8-2024-02-22' of https://gitlab.freedesktop.org/agd5f/linux

 into drm-fixes

amd-drm-fixes-6.8-2024-02-22:

amdgpu:
- Suspend/resume fixes
- Backlight error fix
- DCN 3.5 fixes
- Misc fixes

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

From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240222195338.5809-1-alexander.deucher@amd.com
parents 741922e7 bbfaf2ae
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1528,6 +1528,9 @@ bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
 */
void amdgpu_choose_low_power_state(struct amdgpu_device *adev)
{
	if (adev->in_runpm)
		return;

	if (amdgpu_acpi_is_s0ix_active(adev))
		adev->in_s0ix = true;
	else if (amdgpu_acpi_is_s3_active(adev))
+34 −23
Original line number Diff line number Diff line
@@ -1843,21 +1843,12 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
			DRM_ERROR("amdgpu: fail to register dmub aux callback");
			goto error;
		}
		if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD, dmub_hpd_callback, true)) {
			DRM_ERROR("amdgpu: fail to register dmub hpd callback");
			goto error;
		}
		if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD_IRQ, dmub_hpd_callback, true)) {
			DRM_ERROR("amdgpu: fail to register dmub hpd callback");
			goto error;
		}
	}

		/* Enable outbox notification only after IRQ handlers are registered and DMUB is alive.
	 * It is expected that DMUB will resend any pending notifications at this point, for
	 * example HPD from DPIA.
		 * It is expected that DMUB will resend any pending notifications at this point. Note
		 * that hpd and hpd_irq handler registration are deferred to register_hpd_handlers() to
		 * align legacy interface initialization sequence. Connection status will be proactivly
		 * detected once in the amdgpu_dm_initialize_drm_device.
		 */
	if (dc_is_dmub_outbox_supported(adev->dm.dc)) {
		dc_enable_dmub_outbox(adev->dm.dc);

		/* DPIA trace goes to dmesg logs only if outbox is enabled */
@@ -2287,6 +2278,7 @@ static int dm_sw_fini(void *handle)

	if (adev->dm.dmub_srv) {
		dmub_srv_destroy(adev->dm.dmub_srv);
		kfree(adev->dm.dmub_srv);
		adev->dm.dmub_srv = NULL;
	}

@@ -3536,6 +3528,14 @@ static void register_hpd_handlers(struct amdgpu_device *adev)
	int_params.requested_polarity = INTERRUPT_POLARITY_DEFAULT;
	int_params.current_polarity = INTERRUPT_POLARITY_DEFAULT;

	if (dc_is_dmub_outbox_supported(adev->dm.dc)) {
		if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD, dmub_hpd_callback, true))
			DRM_ERROR("amdgpu: fail to register dmub hpd callback");

		if (!register_dmub_notify_callback(adev, DMUB_NOTIFICATION_HPD_IRQ, dmub_hpd_callback, true))
			DRM_ERROR("amdgpu: fail to register dmub hpd callback");
	}

	list_for_each_entry(connector,
			&dev->mode_config.connector_list, head)	{

@@ -3564,10 +3564,6 @@ static void register_hpd_handlers(struct amdgpu_device *adev)
					handle_hpd_rx_irq,
					(void *) aconnector);
		}

		if (adev->dm.hpd_rx_offload_wq)
			adev->dm.hpd_rx_offload_wq[connector->index].aconnector =
				aconnector;
	}
}

@@ -4561,6 +4557,10 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
			goto fail;
		}

		if (dm->hpd_rx_offload_wq)
			dm->hpd_rx_offload_wq[aconnector->base.index].aconnector =
				aconnector;

		if (!dc_link_detect_connection_type(link, &new_connection_type))
			DRM_ERROR("KMS: Failed to detect connector\n");

@@ -6534,10 +6534,15 @@ amdgpu_dm_connector_late_register(struct drm_connector *connector)
static void amdgpu_dm_connector_funcs_force(struct drm_connector *connector)
{
	struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
	struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector);
	struct dc_link *dc_link = aconnector->dc_link;
	struct dc_sink *dc_em_sink = aconnector->dc_em_sink;
	struct edid *edid;
	struct i2c_adapter *ddc;

	if (dc_link->aux_mode)
		ddc = &aconnector->dm_dp_aux.aux.ddc;
	else
		ddc = &aconnector->i2c->base;

	/*
	 * Note: drm_get_edid gets edid in the following order:
@@ -6545,7 +6550,7 @@ static void amdgpu_dm_connector_funcs_force(struct drm_connector *connector)
	 * 2) firmware EDID if set via edid_firmware module parameter
	 * 3) regular DDC read.
	 */
	edid = drm_get_edid(connector, &amdgpu_connector->ddc_bus->aux.ddc);
	edid = drm_get_edid(connector, ddc);
	if (!edid) {
		DRM_ERROR("No EDID found on connector: %s.\n", connector->name);
		return;
@@ -6586,12 +6591,18 @@ static int get_modes(struct drm_connector *connector)
static void create_eml_sink(struct amdgpu_dm_connector *aconnector)
{
	struct drm_connector *connector = &aconnector->base;
	struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(&aconnector->base);
	struct dc_link *dc_link = aconnector->dc_link;
	struct dc_sink_init_data init_params = {
			.link = aconnector->dc_link,
			.sink_signal = SIGNAL_TYPE_VIRTUAL
	};
	struct edid *edid;
	struct i2c_adapter *ddc;

	if (dc_link->aux_mode)
		ddc = &aconnector->dm_dp_aux.aux.ddc;
	else
		ddc = &aconnector->i2c->base;

	/*
	 * Note: drm_get_edid gets edid in the following order:
@@ -6599,7 +6610,7 @@ static void create_eml_sink(struct amdgpu_dm_connector *aconnector)
	 * 2) firmware EDID if set via edid_firmware module parameter
	 * 3) regular DDC read.
	 */
	edid = drm_get_edid(connector, &amdgpu_connector->ddc_bus->aux.ddc);
	edid = drm_get_edid(connector, ddc);
	if (!edid) {
		DRM_ERROR("No EDID found on connector: %s.\n", connector->name);
		return;
+5 −2
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ bool dc_dmub_srv_cmd_list_queue_execute(struct dc_dmub_srv *dc_dmub_srv,
		unsigned int count,
		union dmub_rb_cmd *cmd_list)
{
	struct dc_context *dc_ctx = dc_dmub_srv->ctx;
	struct dc_context *dc_ctx;
	struct dmub_srv *dmub;
	enum dmub_status status;
	int i;
@@ -133,6 +133,7 @@ bool dc_dmub_srv_cmd_list_queue_execute(struct dc_dmub_srv *dc_dmub_srv,
	if (!dc_dmub_srv || !dc_dmub_srv->dmub)
		return false;

	dc_ctx = dc_dmub_srv->ctx;
	dmub = dc_dmub_srv->dmub;

	for (i = 0 ; i < count; i++) {
@@ -1161,7 +1162,7 @@ void dc_dmub_srv_subvp_save_surf_addr(const struct dc_dmub_srv *dc_dmub_srv, con

bool dc_dmub_srv_is_hw_pwr_up(struct dc_dmub_srv *dc_dmub_srv, bool wait)
{
	struct dc_context *dc_ctx = dc_dmub_srv->ctx;
	struct dc_context *dc_ctx;
	enum dmub_status status;

	if (!dc_dmub_srv || !dc_dmub_srv->dmub)
@@ -1170,6 +1171,8 @@ bool dc_dmub_srv_is_hw_pwr_up(struct dc_dmub_srv *dc_dmub_srv, bool wait)
	if (dc_dmub_srv->ctx->dc->debug.dmcub_emulation)
		return true;

	dc_ctx = dc_dmub_srv->ctx;

	if (wait) {
		if (dc_dmub_srv->ctx->dc->debug.disable_timeout) {
			do {
+1 −0
Original line number Diff line number Diff line
@@ -290,4 +290,5 @@ void dce_panel_cntl_construct(
	dce_panel_cntl->base.funcs = &dce_link_panel_cntl_funcs;
	dce_panel_cntl->base.ctx = init_data->ctx;
	dce_panel_cntl->base.inst = init_data->inst;
	dce_panel_cntl->base.pwrseq_inst = 0;
}
+1 −0
Original line number Diff line number Diff line
@@ -215,4 +215,5 @@ void dcn301_panel_cntl_construct(
	dcn301_panel_cntl->base.funcs = &dcn301_link_panel_cntl_funcs;
	dcn301_panel_cntl->base.ctx = init_data->ctx;
	dcn301_panel_cntl->base.inst = init_data->inst;
	dcn301_panel_cntl->base.pwrseq_inst = 0;
}
Loading