Commit 156cc376 authored by Dave Airlie's avatar Dave Airlie
Browse files

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

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

 into drm-fixes

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

amdgpu:
- DML2 fix
- DSC fix
- Dispclk fix
- eDP HDR fix
- IPS fix
- TBT fix

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

From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241002135831.2510790-1-alexander.deucher@amd.com
parents 43102a20 52d4e3fb
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -770,6 +770,12 @@ static void dmub_hpd_callback(struct amdgpu_device *adev,
		return;
	}

	/* Skip DMUB HPD IRQ in suspend/resume. We will probe them later. */
	if (notify->type == DMUB_NOTIFICATION_HPD && adev->in_suspend) {
		DRM_INFO("Skip DMUB HPD IRQ callback in suspend/resume\n");
		return;
	}

	link_index = notify->link_index;
	link = adev->dm.dc->links[link_index];
	dev = adev->dm.ddev;
@@ -2026,7 +2032,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
			DRM_ERROR("amdgpu: failed to initialize vblank_workqueue.\n");
	}

	if (adev->dm.dc->caps.ips_support && adev->dm.dc->config.disable_ips == DMUB_IPS_ENABLE)
	if (adev->dm.dc->caps.ips_support &&
	    adev->dm.dc->config.disable_ips != DMUB_IPS_DISABLE_ALL)
		adev->dm.idle_workqueue = idle_create_workqueue(adev);

	if (adev->dm.dc->caps.max_links > 0 && adev->family >= AMDGPU_FAMILY_RV) {
@@ -6735,12 +6742,21 @@ create_stream_for_sink(struct drm_connector *connector,
	if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT ||
	    stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST ||
	    stream->signal == SIGNAL_TYPE_EDP) {
		const struct dc_edid_caps *edid_caps;
		unsigned int disable_colorimetry = 0;

		if (aconnector->dc_sink) {
			edid_caps = &aconnector->dc_sink->edid_caps;
			disable_colorimetry = edid_caps->panel_patch.disable_colorimetry;
		}

		//
		// should decide stream support vsc sdp colorimetry capability
		// before building vsc info packet
		//
		stream->use_vsc_sdp_for_colorimetry = stream->link->dpcd_caps.dpcd_rev.raw >= 0x14 &&
						      stream->link->dpcd_caps.dprx_feature.bits.VSC_SDP_COLORIMETRY_SUPPORTED;
						      stream->link->dpcd_caps.dprx_feature.bits.VSC_SDP_COLORIMETRY_SUPPORTED &&
						      !disable_colorimetry;

		if (stream->out_transfer_func.tf == TRANSFER_FUNCTION_GAMMA22)
			tf = TRANSFER_FUNC_GAMMA_22;
+4 −0
Original line number Diff line number Diff line
@@ -73,6 +73,10 @@ static void apply_edid_quirks(struct edid *edid, struct dc_edid_caps *edid_caps)
		DRM_DEBUG_DRIVER("Clearing DPCD 0x317 on monitor with panel id %X\n", panel_id);
		edid_caps->panel_patch.remove_sink_ext_caps = true;
		break;
	case drm_edid_encode_panel_id('S', 'D', 'C', 0x4154):
		DRM_DEBUG_DRIVER("Disabling VSC on monitor with panel id %X\n", panel_id);
		edid_caps->panel_patch.disable_colorimetry = true;
		break;
	default:
		return;
	}
+13 −4
Original line number Diff line number Diff line
@@ -1027,6 +1027,7 @@ static int try_disable_dsc(struct drm_atomic_state *state,
	int remaining_to_try = 0;
	int ret;
	uint16_t fec_overhead_multiplier_x1000 = get_fec_overhead_multiplier(dc_link);
	int var_pbn;

	for (i = 0; i < count; i++) {
		if (vars[i + k].dsc_enabled
@@ -1057,13 +1058,18 @@ static int try_disable_dsc(struct drm_atomic_state *state,
			break;

		DRM_DEBUG_DRIVER("MST_DSC index #%d, try no compression\n", next_index);
		var_pbn = vars[next_index].pbn;
		vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.stream_kbps, fec_overhead_multiplier_x1000);
		ret = drm_dp_atomic_find_time_slots(state,
						    params[next_index].port->mgr,
						    params[next_index].port,
						    vars[next_index].pbn);
		if (ret < 0)
		if (ret < 0) {
			DRM_DEBUG_DRIVER("%s:%d MST_DSC index #%d, failed to set pbn to the state, %d\n",
						__func__, __LINE__, next_index, ret);
			vars[next_index].pbn = var_pbn;
			return ret;
		}

		ret = drm_dp_mst_atomic_check(state);
		if (ret == 0) {
@@ -1071,15 +1077,18 @@ static int try_disable_dsc(struct drm_atomic_state *state,
			vars[next_index].dsc_enabled = false;
			vars[next_index].bpp_x16 = 0;
		} else {
			DRM_DEBUG_DRIVER("MST_DSC index #%d, restore minimum compression\n", next_index);
			vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.max_kbps, fec_overhead_multiplier_x1000);
			DRM_DEBUG_DRIVER("MST_DSC index #%d, restore optimized pbn value\n", next_index);
			vars[next_index].pbn = var_pbn;
			ret = drm_dp_atomic_find_time_slots(state,
							    params[next_index].port->mgr,
							    params[next_index].port,
							    vars[next_index].pbn);
			if (ret < 0)
			if (ret < 0) {
				DRM_DEBUG_DRIVER("%s:%d MST_DSC index #%d, failed to set pbn to the state, %d\n",
							__func__, __LINE__, next_index, ret);
				return ret;
			}
		}

		tried[next_index] = true;
		remaining_to_try--;
+1 −0
Original line number Diff line number Diff line
@@ -178,6 +178,7 @@ struct dc_panel_patch {
	unsigned int skip_avmute;
	unsigned int mst_start_top_delay;
	unsigned int remove_sink_ext_caps;
	unsigned int disable_colorimetry;
};

struct dc_edid_caps {
+0 −1
Original line number Diff line number Diff line
@@ -303,7 +303,6 @@ void build_unoptimized_policy_settings(enum dml_project_id project, struct dml_m
	if (project == dml_project_dcn35 ||
		project == dml_project_dcn351) {
		policy->DCCProgrammingAssumesScanDirectionUnknownFinal = false;
		policy->EnhancedPrefetchScheduleAccelerationFinal = 0;
		policy->AllowForPStateChangeOrStutterInVBlankFinal = dml_prefetch_support_uclk_fclk_and_stutter_if_possible; /*new*/
		policy->UseOnlyMaxPrefetchModes = 1;
	}
Loading