intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ankit Nautiyal <ankit.k.nautiyal@intel.com>,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: ville.syrjala@linux.intel.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] Revert "drm/i915/dp: Reject HBR3 when sink doesn't support TPS4"
Date: Wed, 14 May 2025 13:47:02 +0300	[thread overview]
Message-ID: <87r00rh3kp.fsf@intel.com> (raw)
In-Reply-To: <87v7q3h5nb.fsf@intel.com>

On Wed, 14 May 2025, Jani Nikula <jani.nikula@linux.intel.com> wrote:
> On Wed, 14 May 2025, Ankit Nautiyal <ankit.k.nautiyal@intel.com> wrote:
>> This reverts commit 584cf613c24a4250d9be4819efc841aa2624d5b6.
>>
>> Some eDP panels support HBR3 but not TPS4 and rely on a fixed mode that
>> requires HBR3. After the original commit, these panels go blank due to
>> the rejection of HBR3.
>>
>> To restore functionality for such panels, this commit reverts the change.
>
> Which panels? References? Bugs?

Regardless, on another reading of the specs, I think the commit being
reverted was misguided. TPS4 seems to be required for HBR3 on DPRX, but
not eDPRX.


BR,
Jani.

>
>> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/5969
>
> This is a reference to a bug that got closed by the commit being
> reverted. This now breaks it again, can't use the Closes: tag here.
>
> Since the original commit was backported to stable, I think we're
> probably going to be screwed if we do the revert + fix in two
> steps. Maybe we want a fix in one go, and backport that to stable. Idk.
>
> BR,
> Jani.
>
>
>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> ---
>>  drivers/gpu/drm/i915/display/intel_dp.c | 49 ++++---------------------
>>  1 file changed, 7 insertions(+), 42 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
>> index 91a34d474463..97cf80372264 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
>> @@ -175,28 +175,10 @@ int intel_dp_link_symbol_clock(int rate)
>>  
>>  static int max_dprx_rate(struct intel_dp *intel_dp)
>>  {
>> -	struct intel_display *display = to_intel_display(intel_dp);
>> -	struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
>> -	int max_rate;
>> -
>>  	if (intel_dp_tunnel_bw_alloc_is_enabled(intel_dp))
>> -		max_rate = drm_dp_tunnel_max_dprx_rate(intel_dp->tunnel);
>> -	else
>> -		max_rate = drm_dp_bw_code_to_link_rate(intel_dp->dpcd[DP_MAX_LINK_RATE]);
>> +		return drm_dp_tunnel_max_dprx_rate(intel_dp->tunnel);
>>  
>> -	/*
>> -	 * Some broken eDP sinks illegally declare support for
>> -	 * HBR3 without TPS4, and are unable to produce a stable
>> -	 * output. Reject HBR3 when TPS4 is not available.
>> -	 */
>> -	if (max_rate >= 810000 && !drm_dp_tps4_supported(intel_dp->dpcd)) {
>> -		drm_dbg_kms(display->drm,
>> -			    "[ENCODER:%d:%s] Rejecting HBR3 due to missing TPS4 support\n",
>> -			    encoder->base.base.id, encoder->base.name);
>> -		max_rate = 540000;
>> -	}
>> -
>> -	return max_rate;
>> +	return drm_dp_bw_code_to_link_rate(intel_dp->dpcd[DP_MAX_LINK_RATE]);
>>  }
>>  
>>  static int max_dprx_lane_count(struct intel_dp *intel_dp)
>> @@ -4272,9 +4254,6 @@ static void intel_edp_mso_init(struct intel_dp *intel_dp)
>>  static void
>>  intel_edp_set_sink_rates(struct intel_dp *intel_dp)
>>  {
>> -	struct intel_display *display = to_intel_display(intel_dp);
>> -	struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
>> -
>>  	intel_dp->num_sink_rates = 0;
>>  
>>  	if (intel_dp->edp_dpcd[0] >= DP_EDP_14) {
>> @@ -4285,7 +4264,10 @@ intel_edp_set_sink_rates(struct intel_dp *intel_dp)
>>  				 sink_rates, sizeof(sink_rates));
>>  
>>  		for (i = 0; i < ARRAY_SIZE(sink_rates); i++) {
>> -			int rate;
>> +			int val = le16_to_cpu(sink_rates[i]);
>> +
>> +			if (val == 0)
>> +				break;
>>  
>>  			/* Value read multiplied by 200kHz gives the per-lane
>>  			 * link rate in kHz. The source rates are, however,
>> @@ -4293,24 +4275,7 @@ intel_edp_set_sink_rates(struct intel_dp *intel_dp)
>>  			 * back to symbols is
>>  			 * (val * 200kHz)*(8/10 ch. encoding)*(1/8 bit to Byte)
>>  			 */
>> -			rate = le16_to_cpu(sink_rates[i]) * 200 / 10;
>> -
>> -			if (rate == 0)
>> -				break;
>> -
>> -			/*
>> -			 * Some broken eDP sinks illegally declare support for
>> -			 * HBR3 without TPS4, and are unable to produce a stable
>> -			 * output. Reject HBR3 when TPS4 is not available.
>> -			 */
>> -			if (rate >= 810000 && !drm_dp_tps4_supported(intel_dp->dpcd)) {
>> -				drm_dbg_kms(display->drm,
>> -					    "[ENCODER:%d:%s] Rejecting HBR3 due to missing TPS4 support\n",
>> -					    encoder->base.base.id, encoder->base.name);
>> -				break;
>> -			}
>> -
>> -			intel_dp->sink_rates[i] = rate;
>> +			intel_dp->sink_rates[i] = (val * 200) / 10;
>>  		}
>>  		intel_dp->num_sink_rates = i;
>>  	}

-- 
Jani Nikula, Intel

  reply	other threads:[~2025-05-14 10:47 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-14  8:43 [PATCH 0/2] Add quirk for panels that support HBR3 without TPS4 Ankit Nautiyal
2025-05-14  8:43 ` [PATCH 1/2] Revert "drm/i915/dp: Reject HBR3 when sink doesn't support TPS4" Ankit Nautiyal
2025-05-14 10:02   ` Jani Nikula
2025-05-14 10:47     ` Jani Nikula [this message]
2025-05-14 11:33       ` Nautiyal, Ankit K
2025-05-14  8:43 ` [PATCH 2/2] drm/dp: Add quirk for panel with HBR3 without TPS4 Ankit Nautiyal
2025-05-14  9:58   ` Jani Nikula
2025-05-14 21:20 ` ✓ CI.Patch_applied: success for Add quirk for panels that support " Patchwork
2025-05-14 21:20 ` ✓ CI.checkpatch: " Patchwork
2025-05-14 21:22 ` ✓ CI.KUnit: " Patchwork
2025-05-14 21:32 ` ✓ CI.Build: " Patchwork
2025-05-14 21:34 ` ✓ CI.Hooks: " Patchwork
2025-05-14 21:36 ` ✓ CI.checksparse: " Patchwork
2025-05-14 22:05 ` ✓ Xe.CI.BAT: " Patchwork
2025-05-15  6:16 ` ✗ Xe.CI.Full: failure " Patchwork
2025-05-15  6:49 ` ✓ CI.Patch_applied: success for Add quirk for panels that support HBR3 without TPS4 (rev2) Patchwork
2025-05-15  6:49 ` ✓ CI.checkpatch: " Patchwork
2025-05-15  6:51 ` ✓ CI.KUnit: " Patchwork
2025-05-15  7:01 ` ✓ CI.Build: " Patchwork
2025-05-15  7:04 ` ✓ CI.Hooks: " Patchwork
2025-05-15  7:05 ` ✓ CI.checksparse: " Patchwork
2025-05-15  7:42 ` ✓ Xe.CI.BAT: " Patchwork
2025-05-15 14:25 ` ✗ Xe.CI.Full: failure " Patchwork
2025-05-27  1:38 ` ✓ CI.Patch_applied: success " Patchwork
2025-05-27  1:38 ` ✓ CI.checkpatch: " Patchwork
2025-05-27  1:39 ` ✓ CI.KUnit: " Patchwork
2025-05-27  1:49 ` ✓ CI.Build: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2025-06-10 10:04 [PATCH 0/2] Add kernel param to limit the eDP rate to HBR2 Ankit Nautiyal
2025-06-10 10:04 ` [PATCH 1/2] Revert "drm/i915/dp: Reject HBR3 when sink doesn't support TPS4" Ankit Nautiyal
2025-06-10 12:15   ` Jani Nikula
2025-06-20 12:44 [PATCH 0/2] Revert patch to reject HBR3 for all eDP panels Ankit Nautiyal
2025-06-20 12:44 ` [PATCH 1/2] Revert "drm/i915/dp: Reject HBR3 when sink doesn't support TPS4" Ankit Nautiyal
2025-06-23 14:42   ` Ville Syrjälä
2025-06-24  4:40     ` Nautiyal, Ankit K
2025-06-24 16:49       ` Ville Syrjälä
2025-06-25  8:18         ` Jani Nikula
2025-06-26 11:31           ` Ville Syrjälä
2025-07-09  5:51 [PATCH 0/1] Revert patch to reject HBR3 for all eDP panels Ankit Nautiyal
2025-07-09  5:51 ` [PATCH 1/2] Revert "drm/i915/dp: Reject HBR3 when sink doesn't support TPS4" Ankit Nautiyal
2025-07-09 18:04   ` Ville Syrjälä
2025-07-10  4:47     ` Nautiyal, Ankit K
2025-07-10  5:20 [PATCH 0/1] Revert patch to reject HBR3 for all eDP panels Ankit Nautiyal
2025-07-10  5:20 ` [PATCH 1/2] Revert "drm/i915/dp: Reject HBR3 when sink doesn't support TPS4" Ankit Nautiyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r00rh3kp.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).