Skip to content

Commit 156cc37

Browse files
committed
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: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 43102a2 + 52d4e3f commit 156cc37

File tree

6 files changed

+37
-7
lines changed

6 files changed

+37
-7
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,12 @@ static void dmub_hpd_callback(struct amdgpu_device *adev,
770770
return;
771771
}
772772

773+
/* Skip DMUB HPD IRQ in suspend/resume. We will probe them later. */
774+
if (notify->type == DMUB_NOTIFICATION_HPD && adev->in_suspend) {
775+
DRM_INFO("Skip DMUB HPD IRQ callback in suspend/resume\n");
776+
return;
777+
}
778+
773779
link_index = notify->link_index;
774780
link = adev->dm.dc->links[link_index];
775781
dev = adev->dm.ddev;
@@ -2026,7 +2032,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
20262032
DRM_ERROR("amdgpu: failed to initialize vblank_workqueue.\n");
20272033
}
20282034

2029-
if (adev->dm.dc->caps.ips_support && adev->dm.dc->config.disable_ips == DMUB_IPS_ENABLE)
2035+
if (adev->dm.dc->caps.ips_support &&
2036+
adev->dm.dc->config.disable_ips != DMUB_IPS_DISABLE_ALL)
20302037
adev->dm.idle_workqueue = idle_create_workqueue(adev);
20312038

20322039
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,
67356742
if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT ||
67366743
stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST ||
67376744
stream->signal == SIGNAL_TYPE_EDP) {
6745+
const struct dc_edid_caps *edid_caps;
6746+
unsigned int disable_colorimetry = 0;
6747+
6748+
if (aconnector->dc_sink) {
6749+
edid_caps = &aconnector->dc_sink->edid_caps;
6750+
disable_colorimetry = edid_caps->panel_patch.disable_colorimetry;
6751+
}
6752+
67386753
//
67396754
// should decide stream support vsc sdp colorimetry capability
67406755
// before building vsc info packet
67416756
//
67426757
stream->use_vsc_sdp_for_colorimetry = stream->link->dpcd_caps.dpcd_rev.raw >= 0x14 &&
6743-
stream->link->dpcd_caps.dprx_feature.bits.VSC_SDP_COLORIMETRY_SUPPORTED;
6758+
stream->link->dpcd_caps.dprx_feature.bits.VSC_SDP_COLORIMETRY_SUPPORTED &&
6759+
!disable_colorimetry;
67446760

67456761
if (stream->out_transfer_func.tf == TRANSFER_FUNCTION_GAMMA22)
67466762
tf = TRANSFER_FUNC_GAMMA_22;

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ static void apply_edid_quirks(struct edid *edid, struct dc_edid_caps *edid_caps)
7373
DRM_DEBUG_DRIVER("Clearing DPCD 0x317 on monitor with panel id %X\n", panel_id);
7474
edid_caps->panel_patch.remove_sink_ext_caps = true;
7575
break;
76+
case drm_edid_encode_panel_id('S', 'D', 'C', 0x4154):
77+
DRM_DEBUG_DRIVER("Disabling VSC on monitor with panel id %X\n", panel_id);
78+
edid_caps->panel_patch.disable_colorimetry = true;
79+
break;
7680
default:
7781
return;
7882
}

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,7 @@ static int try_disable_dsc(struct drm_atomic_state *state,
10271027
int remaining_to_try = 0;
10281028
int ret;
10291029
uint16_t fec_overhead_multiplier_x1000 = get_fec_overhead_multiplier(dc_link);
1030+
int var_pbn;
10301031

10311032
for (i = 0; i < count; i++) {
10321033
if (vars[i + k].dsc_enabled
@@ -1057,28 +1058,36 @@ static int try_disable_dsc(struct drm_atomic_state *state,
10571058
break;
10581059

10591060
DRM_DEBUG_DRIVER("MST_DSC index #%d, try no compression\n", next_index);
1061+
var_pbn = vars[next_index].pbn;
10601062
vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.stream_kbps, fec_overhead_multiplier_x1000);
10611063
ret = drm_dp_atomic_find_time_slots(state,
10621064
params[next_index].port->mgr,
10631065
params[next_index].port,
10641066
vars[next_index].pbn);
1065-
if (ret < 0)
1067+
if (ret < 0) {
1068+
DRM_DEBUG_DRIVER("%s:%d MST_DSC index #%d, failed to set pbn to the state, %d\n",
1069+
__func__, __LINE__, next_index, ret);
1070+
vars[next_index].pbn = var_pbn;
10661071
return ret;
1072+
}
10671073

10681074
ret = drm_dp_mst_atomic_check(state);
10691075
if (ret == 0) {
10701076
DRM_DEBUG_DRIVER("MST_DSC index #%d, greedily disable dsc\n", next_index);
10711077
vars[next_index].dsc_enabled = false;
10721078
vars[next_index].bpp_x16 = 0;
10731079
} else {
1074-
DRM_DEBUG_DRIVER("MST_DSC index #%d, restore minimum compression\n", next_index);
1075-
vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.max_kbps, fec_overhead_multiplier_x1000);
1080+
DRM_DEBUG_DRIVER("MST_DSC index #%d, restore optimized pbn value\n", next_index);
1081+
vars[next_index].pbn = var_pbn;
10761082
ret = drm_dp_atomic_find_time_slots(state,
10771083
params[next_index].port->mgr,
10781084
params[next_index].port,
10791085
vars[next_index].pbn);
1080-
if (ret < 0)
1086+
if (ret < 0) {
1087+
DRM_DEBUG_DRIVER("%s:%d MST_DSC index #%d, failed to set pbn to the state, %d\n",
1088+
__func__, __LINE__, next_index, ret);
10811089
return ret;
1090+
}
10821091
}
10831092

10841093
tried[next_index] = true;

drivers/gpu/drm/amd/display/dc/dc_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ struct dc_panel_patch {
178178
unsigned int skip_avmute;
179179
unsigned int mst_start_top_delay;
180180
unsigned int remove_sink_ext_caps;
181+
unsigned int disable_colorimetry;
181182
};
182183

183184
struct dc_edid_caps {

drivers/gpu/drm/amd/display/dc/dml2/dml2_policy.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ void build_unoptimized_policy_settings(enum dml_project_id project, struct dml_m
303303
if (project == dml_project_dcn35 ||
304304
project == dml_project_dcn351) {
305305
policy->DCCProgrammingAssumesScanDirectionUnknownFinal = false;
306-
policy->EnhancedPrefetchScheduleAccelerationFinal = 0;
307306
policy->AllowForPStateChangeOrStutterInVBlankFinal = dml_prefetch_support_uclk_fclk_and_stutter_if_possible; /*new*/
308307
policy->UseOnlyMaxPrefetchModes = 1;
309308
}

drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ static const struct dc_debug_options debug_defaults_drv = {
766766
.disable_dmub_reallow_idle = false,
767767
.static_screen_wait_frames = 2,
768768
.notify_dpia_hr_bw = true,
769+
.min_disp_clk_khz = 50000,
769770
};
770771

771772
static const struct dc_panel_config panel_config_defaults = {

0 commit comments

Comments
 (0)