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

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
...@@ -770,6 +770,12 @@ static void dmub_hpd_callback(struct amdgpu_device *adev, ...@@ -770,6 +770,12 @@ static void dmub_hpd_callback(struct amdgpu_device *adev,
return; 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_index = notify->link_index;
link = adev->dm.dc->links[link_index]; link = adev->dm.dc->links[link_index];
dev = adev->dm.ddev; dev = adev->dm.ddev;
...@@ -2026,7 +2032,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) ...@@ -2026,7 +2032,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
DRM_ERROR("amdgpu: failed to initialize vblank_workqueue.\n"); 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); adev->dm.idle_workqueue = idle_create_workqueue(adev);
if (adev->dm.dc->caps.max_links > 0 && adev->family >= AMDGPU_FAMILY_RV) { 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, ...@@ -6735,12 +6742,21 @@ create_stream_for_sink(struct drm_connector *connector,
if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT || if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT ||
stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST || stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST ||
stream->signal == SIGNAL_TYPE_EDP) { 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 // should decide stream support vsc sdp colorimetry capability
// before building vsc info packet // before building vsc info packet
// //
stream->use_vsc_sdp_for_colorimetry = stream->link->dpcd_caps.dpcd_rev.raw >= 0x14 && 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) if (stream->out_transfer_func.tf == TRANSFER_FUNCTION_GAMMA22)
tf = TRANSFER_FUNC_GAMMA_22; tf = TRANSFER_FUNC_GAMMA_22;
......
...@@ -73,6 +73,10 @@ static void apply_edid_quirks(struct edid *edid, struct dc_edid_caps *edid_caps) ...@@ -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); DRM_DEBUG_DRIVER("Clearing DPCD 0x317 on monitor with panel id %X\n", panel_id);
edid_caps->panel_patch.remove_sink_ext_caps = true; edid_caps->panel_patch.remove_sink_ext_caps = true;
break; 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: default:
return; return;
} }
......
...@@ -1027,6 +1027,7 @@ static int try_disable_dsc(struct drm_atomic_state *state, ...@@ -1027,6 +1027,7 @@ static int try_disable_dsc(struct drm_atomic_state *state,
int remaining_to_try = 0; int remaining_to_try = 0;
int ret; int ret;
uint16_t fec_overhead_multiplier_x1000 = get_fec_overhead_multiplier(dc_link); uint16_t fec_overhead_multiplier_x1000 = get_fec_overhead_multiplier(dc_link);
int var_pbn;
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
if (vars[i + k].dsc_enabled if (vars[i + k].dsc_enabled
...@@ -1057,13 +1058,18 @@ static int try_disable_dsc(struct drm_atomic_state *state, ...@@ -1057,13 +1058,18 @@ static int try_disable_dsc(struct drm_atomic_state *state,
break; break;
DRM_DEBUG_DRIVER("MST_DSC index #%d, try no compression\n", next_index); 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); 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, ret = drm_dp_atomic_find_time_slots(state,
params[next_index].port->mgr, params[next_index].port->mgr,
params[next_index].port, params[next_index].port,
vars[next_index].pbn); 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; return ret;
}
ret = drm_dp_mst_atomic_check(state); ret = drm_dp_mst_atomic_check(state);
if (ret == 0) { if (ret == 0) {
...@@ -1071,15 +1077,18 @@ static int try_disable_dsc(struct drm_atomic_state *state, ...@@ -1071,15 +1077,18 @@ static int try_disable_dsc(struct drm_atomic_state *state,
vars[next_index].dsc_enabled = false; vars[next_index].dsc_enabled = false;
vars[next_index].bpp_x16 = 0; vars[next_index].bpp_x16 = 0;
} else { } else {
DRM_DEBUG_DRIVER("MST_DSC index #%d, restore minimum compression\n", next_index); DRM_DEBUG_DRIVER("MST_DSC index #%d, restore optimized pbn value\n", next_index);
vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.max_kbps, fec_overhead_multiplier_x1000); vars[next_index].pbn = var_pbn;
ret = drm_dp_atomic_find_time_slots(state, ret = drm_dp_atomic_find_time_slots(state,
params[next_index].port->mgr, params[next_index].port->mgr,
params[next_index].port, params[next_index].port,
vars[next_index].pbn); 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; return ret;
} }
}
tried[next_index] = true; tried[next_index] = true;
remaining_to_try--; remaining_to_try--;
......
...@@ -178,6 +178,7 @@ struct dc_panel_patch { ...@@ -178,6 +178,7 @@ struct dc_panel_patch {
unsigned int skip_avmute; unsigned int skip_avmute;
unsigned int mst_start_top_delay; unsigned int mst_start_top_delay;
unsigned int remove_sink_ext_caps; unsigned int remove_sink_ext_caps;
unsigned int disable_colorimetry;
}; };
struct dc_edid_caps { struct dc_edid_caps {
......
...@@ -303,7 +303,6 @@ void build_unoptimized_policy_settings(enum dml_project_id project, struct dml_m ...@@ -303,7 +303,6 @@ void build_unoptimized_policy_settings(enum dml_project_id project, struct dml_m
if (project == dml_project_dcn35 || if (project == dml_project_dcn35 ||
project == dml_project_dcn351) { project == dml_project_dcn351) {
policy->DCCProgrammingAssumesScanDirectionUnknownFinal = false; policy->DCCProgrammingAssumesScanDirectionUnknownFinal = false;
policy->EnhancedPrefetchScheduleAccelerationFinal = 0;
policy->AllowForPStateChangeOrStutterInVBlankFinal = dml_prefetch_support_uclk_fclk_and_stutter_if_possible; /*new*/ policy->AllowForPStateChangeOrStutterInVBlankFinal = dml_prefetch_support_uclk_fclk_and_stutter_if_possible; /*new*/
policy->UseOnlyMaxPrefetchModes = 1; policy->UseOnlyMaxPrefetchModes = 1;
} }
......
...@@ -766,6 +766,7 @@ static const struct dc_debug_options debug_defaults_drv = { ...@@ -766,6 +766,7 @@ static const struct dc_debug_options debug_defaults_drv = {
.disable_dmub_reallow_idle = false, .disable_dmub_reallow_idle = false,
.static_screen_wait_frames = 2, .static_screen_wait_frames = 2,
.notify_dpia_hr_bw = true, .notify_dpia_hr_bw = true,
.min_disp_clk_khz = 50000,
}; };
static const struct dc_panel_config panel_config_defaults = { static const struct dc_panel_config panel_config_defaults = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment