A follow-up patch adds a workaround for a payload allocation problem in a DELL monitor. For this the driver needs to reset the payload table in the monitor's MST hub, factor out a helper to do this. While at it use DP_PAYLOAD_TABLE_SIZE in the reset command, instead of open coding it. Cc: Lyude Paul <lyude@xxxxxxxxxx> Cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx Signed-off-by: Imre Deak <imre.deak@xxxxxxxxx> --- drivers/gpu/drm/display/drm_dp_mst_topology.c | 8 +++++++- include/drm/display/drm_dp_mst_helper.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c index d0e929df7d088..eb170389cf9bc 100644 --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -3429,6 +3429,12 @@ int drm_dp_add_payload_part2(struct drm_dp_mst_topology_mgr *mgr, } EXPORT_SYMBOL(drm_dp_add_payload_part2); +int drm_dp_mst_reset_payload_table(struct drm_dp_mst_topology_mgr *mgr) +{ + return drm_dp_dpcd_write_payload(mgr, 0, 0, DP_PAYLOAD_TABLE_SIZE - 1); +} +EXPORT_SYMBOL(drm_dp_mst_reset_payload_table); + /** * drm_dp_mst_has_payload_alloc_errors - Query for payload allocation errors * @mst_state: The MST atomic state @@ -3699,7 +3705,7 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms goto out_unlock; /* Write reset payload */ - drm_dp_dpcd_write_payload(mgr, 0, 0, 0x3f); + drm_dp_mst_reset_payload_table(mgr); queue_work(system_long_wq, &mgr->work); diff --git a/include/drm/display/drm_dp_mst_helper.h b/include/drm/display/drm_dp_mst_helper.h index bb7c595096fed..2d15399df2950 100644 --- a/include/drm/display/drm_dp_mst_helper.h +++ b/include/drm/display/drm_dp_mst_helper.h @@ -845,6 +845,7 @@ void drm_dp_remove_payload(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_topology_state *mst_state, const struct drm_dp_mst_atomic_payload *old_payload, struct drm_dp_mst_atomic_payload *new_payload); +int drm_dp_mst_reset_payload_table(struct drm_dp_mst_topology_mgr *mgr); bool drm_dp_mst_has_payload_alloc_errors(const struct drm_dp_mst_topology_state *mst_state); int drm_dp_mst_payload_vchannel(const struct drm_dp_mst_topology_state *mst_state, const struct drm_dp_mst_atomic_payload *payload); -- 2.37.1