All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: imre.deak@intel.com
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/mst: fix INT_MAX to .4 fixed point conversion mistake
Date: Wed, 05 Feb 2025 15:41:59 +0200	[thread overview]
Message-ID: <8734gs4ifs.fsf@intel.com> (raw)
In-Reply-To: <Z6I3iNAjlZHnxxyf@ideak-desk.fi.intel.com>

On Tue, 04 Feb 2025, Imre Deak <imre.deak@intel.com> wrote:
> On Tue, Feb 04, 2025 at 05:37:17PM +0200, Jani Nikula wrote:
>> intel_dp_mtp_tu_compute_config() conversion to use .4 fixed point didn't
>> take into account that intel_dp_mst_max_dpt_bpp() may return INT_MAX
>> when the transport limitation is not relevant. Converting INT_MAX to .4
>> fixed point results in -1.0, which then gets used as if it were a real
>> max BPP value:
>> 
>> i915 0000:00:02.0: [drm:intel_dp_mtp_tu_compute_config [i915]] Limiting bpp to max DPT bpp (24.0000 -> -1.0000)
>> i915 0000:00:02.0: [drm:intel_dp_mtp_tu_compute_config [i915]] Looking for slots in range min bpp 18.0000 max bpp -1.0000
>> 
>> Just return 0 for "no max DPT BPP", and handle it explicitly.
>> 
>> Fixes: 67782bf6e8a6 ("drm/i915/mst: Convert intel_dp_mtp_tu_compute_config() to .4 format")
>> Cc: Imre Deak <imre.deak@intel.com>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Reviewed-by: Imre Deak <imre.deak@intel.com>

Pushed to din, thanks for the review!

>
>> ---
>>  drivers/gpu/drm/i915/display/intel_dp_mst.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
>> index b729e27cdde2..95abc6ea85eb 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
>> @@ -111,7 +111,7 @@ static int intel_dp_mst_max_dpt_bpp(const struct intel_crtc_state *crtc_state,
>>  		&crtc_state->hw.adjusted_mode;
>>  
>>  	if (!intel_dp_is_uhbr(crtc_state) || DISPLAY_VER(display) >= 20 || !dsc)
>> -		return INT_MAX;
>> +		return 0;
>>  
>>  	/*
>>  	 * DSC->DPT interface width:
>> @@ -248,7 +248,7 @@ int intel_dp_mtp_tu_compute_config(struct intel_dp *intel_dp,
>>  	}
>>  
>>  	max_dpt_bpp_x16 = fxp_q4_from_int(intel_dp_mst_max_dpt_bpp(crtc_state, dsc));
>> -	if (max_bpp_x16 > max_dpt_bpp_x16) {
>> +	if (max_dpt_bpp_x16 && max_bpp_x16 > max_dpt_bpp_x16) {
>>  		drm_dbg_kms(display->drm, "Limiting bpp to max DPT bpp (" FXP_Q4_FMT " -> " FXP_Q4_FMT ")\n",
>>  			    FXP_Q4_ARGS(max_bpp_x16), FXP_Q4_ARGS(max_dpt_bpp_x16));
>>  		max_bpp_x16 = max_dpt_bpp_x16;
>> -- 
>> 2.39.5
>> 

-- 
Jani Nikula, Intel

  reply	other threads:[~2025-02-05 13:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04 15:37 [PATCH] drm/i915/mst: fix INT_MAX to .4 fixed point conversion mistake Jani Nikula
2025-02-04 15:51 ` Imre Deak
2025-02-05 13:41   ` Jani Nikula [this message]
2025-02-04 20:16 ` ✓ CI.Patch_applied: success for " Patchwork
2025-02-04 20:17 ` ✗ CI.checkpatch: warning " Patchwork
2025-02-04 20:18 ` ✓ CI.KUnit: success " Patchwork
2025-02-04 20:33 ` ✗ Fi.CI.CHECKPATCH: warning " Patchwork
2025-02-04 20:35 ` ✓ CI.Build: success " Patchwork
2025-02-04 20:37 ` ✓ CI.Hooks: " Patchwork
2025-02-04 20:38 ` ✓ CI.checksparse: " Patchwork
2025-02-04 20:52 ` ✗ i915.CI.BAT: failure " Patchwork
2025-02-05  8:19   ` Jani Nikula
2025-02-05 13:57     ` Ravali, JupallyX
2025-02-04 21:00 ` ✓ Xe.CI.BAT: success " Patchwork
2025-02-05  0:47 ` ✗ Xe.CI.Full: failure " Patchwork
2025-02-05 11:28 ` ✓ i915.CI.BAT: success " Patchwork
2025-02-05 15:04 ` ✗ i915.CI.Full: failure " Patchwork

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=8734gs4ifs.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.