Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Govindapillai, Vinod" <vinod.govindapillai@intel.com>
To: "Lisovskiy, Stanislav" <stanislav.lisovskiy@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Cc: "Nikula, Jani" <jani.nikula@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Implement UHBR bandwidth check
Date: Tue, 4 Apr 2023 10:56:25 +0000	[thread overview]
Message-ID: <e0d5ca530510ebde7f5ce3225c03296528949109.camel@intel.com> (raw)
In-Reply-To: <20230324135125.6720-1-stanislav.lisovskiy@intel.com>

Hi Stan,

On Fri, 2023-03-24 at 15:51 +0200, Stanislav Lisovskiy wrote:
> According to spec, we should check if output_bpp * pixel_rate is less
> than DDI clock * 72, if UHBR is used.
> 
> v2: - s/pipe_config/crtc_state/ (Jani Nikula)
>     - Merged previous patch into that one, to remove empty function(Jani Nikula)
> 
> v3: - Make that constraint check to be DSC-related only
>     - Limit this to only DISPLAY_VER <= 13
> 
> HSDES: 1406899791
> BSPEC: 49259
> 
> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp_mst.c | 29 +++++++++++++++++++--
>  1 file changed, 27 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 a860cbc5dbea..4c0edb760b8e 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> @@ -45,6 +45,27 @@
>  #include "intel_hotplug.h"
>  #include "skl_scaler.h"
>  
> +static int intel_dp_mst_check_constraints(struct drm_i915_private *i915, int bpp,
> +                                         const struct drm_display_mode *adjusted_mode,
> +                                         struct intel_crtc_state *crtc_state,
> +                                         bool dsc)
> +{
> +       if (intel_dp_is_uhbr(crtc_state) && DISPLAY_VER(i915) <= 13 && dsc) {
> +               int output_bpp = bpp;
> +               /* DisplayPort 2 128b/132b, bits per lane is always 32 */
> +               int symbol_clock = crtc_state->port_clock / 32;
> +
> +               if (output_bpp * adjusted_mode->crtc_clock >=
> +                   symbol_clock * 72) {
> +                       drm_dbg_kms(&i915->drm, "UHBR check failed(required bw %d available
> %d)\n",
> +                                   output_bpp * adjusted_mode->crtc_clock, symbol_clock * 72);
> +                       return -EINVAL;
> +               }
> +       }
> +
> +       return 0;
> +}
> +
>  static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder,
>                                                 struct intel_crtc_state *crtc_state,
>                                                 int max_bpp,
> @@ -87,6 +108,10 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder,
>  
>                 drm_dbg_kms(&i915->drm, "Trying bpp %d\n", bpp);
>  
> +               ret = intel_dp_mst_check_constraints(i915, bpp, adjusted_mode, crtc_state, dsc);
> +               if (ret)
> +                       continue;
> +

One suggestion, if you move this constraints check to the top of the "for loop", you may be able to
save an unnecessary "drm_dp_calc_pbn_mode" call in case constraints doesn't match for a bpp.

Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>

>                 slots = drm_dp_atomic_find_time_slots(state, &intel_dp->mst_mgr,
>                                                       connector->port,
>                                                       crtc_state->pbn);
> @@ -104,8 +129,8 @@ static int intel_dp_mst_find_vcpi_slots_for_bpp(struct intel_encoder *encoder,
>                 }
>         }
>  
> -       /* Despite slots are non-zero, we still failed the atomic check */
> -       if (ret && slots >= 0)
> +       /* We failed to find a proper bpp/timeslots, return error */
> +       if (ret)
>                 slots = ret;
>  
>         if (slots < 0) {


  parent reply	other threads:[~2023-04-04 10:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-24 13:51 [Intel-gfx] [PATCH] drm/i915: Implement UHBR bandwidth check Stanislav Lisovskiy
2023-03-24 16:05 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Implement UHBR bandwidth check (rev3) Patchwork
2023-03-24 16:17 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-24 22:23 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-04-04 10:56 ` Govindapillai, Vinod [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-02-27 11:20 [Intel-gfx] [PATCH] drm/i915: Implement UHBR bandwidth check Stanislav Lisovskiy
2023-03-09 12:54 ` Ville Syrjälä
2023-01-13 13:06 Stanislav Lisovskiy
2023-01-13 14:43 ` Ville Syrjälä
2023-01-16  7:51   ` Lisovskiy, Stanislav

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=e0d5ca530510ebde7f5ce3225c03296528949109.camel@intel.com \
    --to=vinod.govindapillai@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=stanislav.lisovskiy@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