Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v2 09/12] drm/i915/display: Factor out intel_display_{min, max}_pipe_bpp()
Date: Tue, 6 May 2025 18:16:59 +0300	[thread overview]
Message-ID: <aBon62ld9JyoRuY1@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <abe21867-4735-4e73-a16a-bee34658cae7@intel.com>

On Tue, May 06, 2025 at 06:37:50PM +0530, Nautiyal, Ankit K wrote:
> 
> On 4/28/2025 7:01 PM, Imre Deak wrote:
> > Factor out helpers that can be used in a follow-up change to query the
> > minimum and maximum pipe bpp supported by the HW.
> > 
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> >   drivers/gpu/drm/i915/display/intel_display.c | 28 +++++++++++++-------
> >   drivers/gpu/drm/i915/display/intel_display.h |  3 +++
> >   drivers/gpu/drm/i915/display/intel_dp.c      |  2 +-
> >   3 files changed, 22 insertions(+), 11 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index b4ddffe53e23f..cf2c11826ffb3 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -4301,6 +4301,22 @@ compute_sink_pipe_bpp(const struct drm_connector_state *conn_state,
> >   	return 0;
> >   }
> > +int intel_display_min_pipe_bpp(void)
> > +{
> > +	return 6 * 3;
> 
> Hmm.. I think this is DP specific, for HDMI min is 8 * 3 = 24 bpp.
> 
> I see this is function is used while checking for min bpp while adding
> support for forcing a bpp for different connectors.
> 
> Would it make sense to make this connector specific?

I wonder if it could be kept simple for now and use the platform's min
bpp value in the above debugfs entry. IIUC the
platform/connector/output_type specific min pipe bpps are:

DP/RGB:      18
DP/YCBCR:    24
LVDS:        18
DSI/DDI:     24
DSI/non-DDI: 18
All other:   24

It would make sense to add a helper and use it everywhere, but it would
be a bigger change. Are you ok to do this as a follow up?

> Regards,
> 
> Ankit
> 
> 
> > +}
> > +
> > +int intel_display_max_pipe_bpp(struct intel_display *display)
> > +{
> > +	if (display->platform.g4x || display->platform.valleyview ||
> > +	    display->platform.cherryview)
> > +		return 10*3;
> > +	else if (DISPLAY_VER(display) >= 5)
> > +		return 12*3;
> > +	else
> > +		return 8*3;
> > +}
> > +
> >   static int
> >   compute_baseline_pipe_bpp(struct intel_atomic_state *state,
> >   			  struct intel_crtc *crtc)
> > @@ -4310,17 +4326,9 @@ compute_baseline_pipe_bpp(struct intel_atomic_state *state,
> >   		intel_atomic_get_new_crtc_state(state, crtc);
> >   	struct drm_connector *connector;
> >   	struct drm_connector_state *connector_state;
> > -	int bpp, i;
> > +	int i;
> > -	if (display->platform.g4x || display->platform.valleyview ||
> > -	    display->platform.cherryview)
> > -		bpp = 10*3;
> > -	else if (DISPLAY_VER(display) >= 5)
> > -		bpp = 12*3;
> > -	else
> > -		bpp = 8*3;
> > -
> > -	crtc_state->pipe_bpp = bpp;
> > +	crtc_state->pipe_bpp = intel_display_max_pipe_bpp(display);
> >   	/* Clamp display bpp to connector max bpp */
> >   	for_each_new_connector_in_state(&state->base, connector, connector_state, i) {
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h
> > index 3b54a62c290af..b6610e9175a7a 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.h
> > +++ b/drivers/gpu/drm/i915/display/intel_display.h
> > @@ -524,6 +524,9 @@ void intel_plane_fixup_bitmasks(struct intel_crtc_state *crtc_state);
> >   bool intel_crtc_vrr_disabling(struct intel_atomic_state *state,
> >   			      struct intel_crtc *crtc);
> > +int intel_display_min_pipe_bpp(void);
> > +int intel_display_max_pipe_bpp(struct intel_display *display);
> > +
> >   /* modesetting */
> >   int intel_modeset_pipes_in_mask_early(struct intel_atomic_state *state,
> >   				      const char *reason, u8 pipe_mask);
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> > index 0f89a301e4a0d..73ca9f8efefc5 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > @@ -1198,7 +1198,7 @@ intel_dp_output_format(struct intel_connector *connector,
> >   int intel_dp_min_bpp(enum intel_output_format output_format)
> >   {
> >   	if (output_format == INTEL_OUTPUT_FORMAT_RGB)
> > -		return 6 * 3;
> > +		return intel_display_min_pipe_bpp();
> >   	else
> >   		return 8 * 3;
> >   }

  reply	other threads:[~2025-05-06 15:17 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-28 13:31 [PATCH v2 00/12] drm/i915/dp_mst: Add support for fractional link bpps Imre Deak
2025-04-28 13:31 ` [PATCH v2 01/12] drm/i915/dp_mst: Use the correct connector while computing the link BPP limit on MST Imre Deak
2025-05-06  8:45   ` Nautiyal, Ankit K
2025-05-06  9:39   ` Luca Coelho
2025-04-28 13:31 ` [PATCH v2 02/12] drm/i915/dp_mst: Simplify handling the single-bpp case during state computation Imre Deak
2025-05-06  9:51   ` Nautiyal, Ankit K
2025-05-06 10:00     ` Imre Deak
2025-05-06 12:32       ` Nautiyal, Ankit K
2025-05-06  9:53   ` Luca Coelho
2025-04-28 13:31 ` [PATCH v2 03/12] drm/i915/dp_mst: Validate compressed bpp vs. platform restrictions Imre Deak
2025-05-06  9:54   ` Nautiyal, Ankit K
2025-05-06 10:03   ` Luca Coelho
2025-04-28 13:31 ` [PATCH v2 04/12] drm/i915/dp_mst: Update the total link slot count early Imre Deak
2025-05-06  9:55   ` Nautiyal, Ankit K
2025-05-06 10:07   ` Luca Coelho
2025-04-28 13:31 ` [PATCH v2 05/12] drm/i915/dp_mst: Check BW limit on the local MST link early Imre Deak
2025-05-06 10:06   ` Nautiyal, Ankit K
2025-04-28 13:31 ` [PATCH v2 06/12] drm/i915/dp_mst: Simplify computing the min/max compressed bpp limits Imre Deak
2025-05-06 10:11   ` Luca Coelho
2025-05-06 10:16   ` Nautiyal, Ankit K
2025-04-28 13:31 ` [PATCH v2 07/12] drm/i915/dp: Limit max link bpp properly to a fractional value on SST Imre Deak
2025-05-06 10:27   ` Luca Coelho
2025-05-06 12:34   ` Nautiyal, Ankit K
2025-04-28 13:31 ` [PATCH v2 08/12] drm/i915/dp_mst: Add support for fractional compressed link bpps on MST Imre Deak
2025-05-06 13:02   ` Nautiyal, Ankit K
2025-04-28 13:31 ` [PATCH v2 09/12] drm/i915/display: Factor out intel_display_{min, max}_pipe_bpp() Imre Deak
2025-05-06 13:07   ` Nautiyal, Ankit K
2025-05-06 15:16     ` Imre Deak [this message]
2025-05-07  3:59       ` Nautiyal, Ankit K
2025-05-07 10:58         ` Imre Deak
2025-05-07 12:44           ` Nautiyal, Ankit K
2025-04-28 13:31 ` [PATCH v2 10/12] drm/i915/dp: Export intel_dp_dsc_min_src_compressed_bpp() Imre Deak
2025-05-06 13:16   ` Nautiyal, Ankit K
2025-04-28 13:31 ` [PATCH v2 11/12] drm/i915: Add support for forcing the link bpp on a connector Imre Deak
2025-05-07  5:37   ` Nautiyal, Ankit K
2025-05-07 12:03     ` Imre Deak
2025-05-07 12:41       ` Nautiyal, Ankit K
2025-04-28 13:31 ` [PATCH v2 12/12] drm/i915/dp_mst: Enable fractional link bpps on MST if the bpp is forced Imre Deak
2025-05-06 13:15   ` Nautiyal, Ankit K
2025-04-28 13:59 ` ✓ CI.Patch_applied: success for drm/i915/dp_mst: Add support for fractional link bpps (rev2) Patchwork
2025-04-28 13:59 ` ✗ CI.checkpatch: warning " Patchwork
2025-04-28 14:00 ` ✓ CI.KUnit: success " Patchwork
2025-04-28 14:09 ` ✓ CI.Build: " Patchwork
2025-04-28 14:11 ` ✓ CI.Hooks: " Patchwork
2025-04-28 14:12 ` ✗ CI.checksparse: warning " Patchwork
2025-04-28 17:03 ` ✗ Xe.CI.Full: failure " Patchwork
2025-05-06  8:37 ` ✓ Xe.CI.BAT: success " 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=aBon62ld9JyoRuY1@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=ankit.k.nautiyal@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox