From e0cce122514ff76c3c986103c94de68fbb401949 Mon Sep 17 00:00:00 2001 From: Jingwen Zhu Date: Thu, 30 Mar 2023 16:38:59 +0800 Subject: drm/amd/display: Improvement for handling edp link training fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [Why] The eDP retrain will cause the DPCD 300 to be reset to default. And cause the brightness can't be set correctly. [How] delete the call to edp panel power control in both enable_link_output/disable_link_output entirely and only call edp panel control in enable_link_dp and  disable_link_dp once. Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Jingwen Zhu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher --- .../drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 19 +++++++++++-------- drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 5 +++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c index 9fe0ce91db00..8d2460d06bce 100644 --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c @@ -3031,10 +3031,12 @@ void dce110_enable_dp_link_output( const struct link_hwss *link_hwss = get_link_hwss(link, link_res); unsigned int i; - + /* + * Add the logic to extract BOTH power up and power down sequences + * from enable/disable link output and only call edp panel control + * in enable_link_dp and disable_link_dp once. + */ if (link->connector_signal == SIGNAL_TYPE_EDP) { - if (!link->dc->config.edp_no_power_sequencing) - link->dc->hwss.edp_power_control(link, true); link->dc->hwss.edp_wait_for_hpd_ready(link, true); } @@ -3096,11 +3098,12 @@ void dce110_disable_link_output(struct dc_link *link, link_hwss->disable_link_output(link, link_res, signal); link->phy_state.symclk_state = SYMCLK_OFF_TX_OFF; - - if (signal == SIGNAL_TYPE_EDP && - link->dc->hwss.edp_backlight_control) - link->dc->hwss.edp_power_control(link, false); - else if (dmcu != NULL && dmcu->funcs->lock_phy) + /* + * Add the logic to extract BOTH power up and power down sequences + * from enable/disable link output and only call edp panel control + * in enable_link_dp and disable_link_dp once. + */ + if (dmcu != NULL && dmcu->funcs->lock_phy) dmcu->funcs->unlock_phy(dmcu); dc->link_srv->dp_trace_source_sequence(link, DPCD_SOURCE_SEQ_AFTER_DISABLE_LINK_PHY); } diff --git a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c index 027ad1f0144d..2267fb097830 100644 --- a/drivers/gpu/drm/amd/display/dc/link/link_dpms.c +++ b/drivers/gpu/drm/amd/display/dc/link/link_dpms.c @@ -1927,6 +1927,11 @@ static void disable_link_dp(struct dc_link *link, dp_disable_link_phy(link, link_res, signal); + if (link->connector_signal == SIGNAL_TYPE_EDP) { + if (!link->dc->config.edp_no_power_sequencing) + link->dc->hwss.edp_power_control(link, false); + } + if (signal == SIGNAL_TYPE_DISPLAY_PORT_MST) /* set the sink to SST mode after disabling the link */ enable_mst_on_sink(link, false); -- cgit x.org.uk/linux.git/commit/include/linux/jiffies.h?h=v6.14-rc2&id=b35108a51cf7bab58d7eace1267d7965978bcdb8'>jiffies: Define secs_to_jiffies()Easwar Hariharan 2024-10-25time: Fix references to _msecs_to_jiffies() handling of valuesMiguel Ojeda 2024-09-08treewide: Fix wrong singular form of jiffies in commentsAnna-Maria Behnsen 2024-02-19jiffies: Transform comment about time_* functions into DOC blockAnna-Maria Behnsen 2023-07-14jiffies: add kernel-doc for all APIsRandy Dunlap 2020-10-16kernel.h: split out min()/max() et al. helpersAndy Shevchenko 2020-03-21linux/jiffies.h: Extract common header for vDSOVincenzo Frascino 2019-12-18y2038: remove obsolete jiffies conversion functionsArnd Bergmann 2019-04-08time: Introduce jiffies64_to_msecs()Li RongQing 2018-08-16jiffies: add utility function to calculate delta in msMatteo Croce 2018-04-06jiffies: Introduce USER_TICK_USEC and redefine TICK_USECRafael J. Wysocki 2017-11-02License cleanup: add SPDX GPL-2.0 license identifier to files with no licenseGreg Kroah-Hartman 2017-06-02frv: declare jiffies to be located in the .data sectionMatthias Kaehlcke 2017-05-08jiffies.h: declare jiffies and jiffies_64 with ____cacheline_aligned_in_smpMatthias Kaehlcke 2017-02-01time: Introduce jiffies64_to_nsecs()Frederic Weisbecker 2016-10-07jiffies: add time comparison functions for 64 bit jiffiesJason A. Donenfeld 2015-09-01Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/ke...Linus Torvalds 2015-08-31Merge branch 'timers-nohz-for-linus' of git://git.kernel.org/pub/scm/linux/ke...Linus Torvalds 2015-08-17time: Introduce timespec64_to_jiffies()/jiffies_to_timespec64()Baolin Wang 2015-08-05jiffies: Force inlining of {m,u}msecs_to_jiffies()Denys Vlasenko 2015-07-29jiffies: Remove HZ > USEC_PER_SEC special caseFrederic Weisbecker 2015-06-10time: Allow gcc to fold usecs_to_jiffies(constant)Nicholas Mc Guire 2015-06-10time: Refactor usecs_to_jiffiesNicholas Mc Guire 2015-05-19jiffies: Remove the extra indentation levelThomas Gleixner 2015-05-19time: Allow gcc to fold constants when possibleNicholas Mc Guire 2015-05-19time: Refactor msecs_to_jiffiesNicholas Mc Guire 2014-09-12jiffies: Fix timeval conversion to jiffiesAndrew Hunter 2014-01-16sched/nohz: Fix overflow error in scheduler_tick_max_deferment()Kevin Hilman 2013-08-20jiffies: Avoid undefined behavior from signed overflowPaul E. McKenney 2013-07-02net: convert lls to use time_in_range()Eliezer Tamir 2013-03-22timekeeping: Make jiffies_lock internalThomas Gleixner 2012-11-13time: Kill xtime_lock, replacing it with jiffies_lockJohn Stultz 2012-10-12Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/ke...Linus Torvalds 2012-09-28Merge branch 'arnds-jiffies-fix' into fortglx/3.7/timeJohn Stultz 2012-09-28time/jiffies: bring back unconditional LATCH definitionArnd Bergmann 2012-09-24jiffies: Remove compile time assumptions about CLOCK_TICK_RATEJohn Stultz 2012-09-24jiffies: Kill unused TICK_USEC_TO_NSECJohn Stultz 2012-08-22Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller 2012-08-09time: jiffies_delta_to_clock_t() helper to the rescueEric Dumazet 2012-07-31time/jiffies: Rename ACTHZ to SHIFTED_HZJohn Stultz 2012-07-31time/jiffies: Allow CLOCK_TICK_RATE to be undefinedCatalin Marinas 2011-09-21time: Change jiffies_to_clock_t() argument type to unsigned longhank 2011-03-31Fix common misspellingsLucas De Marchi 2011-01-26time: Add nsecs_to_cputime64 interface for asm-genericVenkatesh Pallipadi