intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: intel-gfx@lists.freedesktop.org, Petr Mladek <pmladek@suse.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/12] drm/i915: Indicate which pipe failed the fastset check overall
Date: Fri, 23 Feb 2024 21:47:04 +0200	[thread overview]
Message-ID: <Zdj2ONs8BZ6959Xb@intel.com> (raw)
In-Reply-To: <ZdfApN1h97GTfL1t@intel.com>

On Thu, Feb 22, 2024 at 04:46:12PM -0500, Rodrigo Vivi wrote:
> On Thu, Feb 15, 2024 at 06:40:44PM +0200, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > intel_crtc_check_fastset() is done per-pipe, so it would be nice
> > to know which pipe it was that failed its checkup.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_display.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index 00ac65a14029..a7f487f5c2b2 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -5562,14 +5562,16 @@ static int intel_modeset_checks(struct intel_atomic_state *state)
> >  static void intel_crtc_check_fastset(const struct intel_crtc_state *old_crtc_state,
> >  				     struct intel_crtc_state *new_crtc_state)
> >  {
> > -	struct drm_i915_private *i915 = to_i915(old_crtc_state->uapi.crtc->dev);
> > +	struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
> > +	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
> >  
> >  	/* only allow LRR when the timings stay within the VRR range */
> >  	if (old_crtc_state->vrr.in_range != new_crtc_state->vrr.in_range)
> >  		new_crtc_state->update_lrr = false;
> >  
> >  	if (!intel_pipe_config_compare(old_crtc_state, new_crtc_state, true))
> > -		drm_dbg_kms(&i915->drm, "fastset requirement not met, forcing full modeset\n");
> > +		drm_dbg_kms(&i915->drm, "[CRTC:%d:%s] fastset requirement not met, forcing full modeset\n",
> > +			    crtc->base.base.id, crtc->base.name);
> 
> looking to other patches in this same series, I wonder
> if we shouldn't benefit of a crct_dbg(crtc, "message") that would print
> [CRTC:%d:%s] underneath.

There has been some discussion on this topic recently, but
I don't think that particular approach is good because:
a) it only works when you need to talk about one partiuclar
   object and often we need to talk about more than one
b) different debug function for every little thing is just ugly,
   and we'd probably end up with dozens of differently named
   variants which takes up too many slots in my brain's pattern
   matcher

I think Jani proposed that drm_dbg_kms() could take different kinds
of objects as its first parameter to do this, but I don't like that
either because of point a).

One idea that was floating about was that each object would embed
a .debug_string or somesuch thing which would include the preferred
formatting. With that you could prints with just a simple %s. The
downside is that when you then read the format string you have no
idea what kind of thing each %s refers to unless you also parse
the full argument list to figure out which is which.

And one basic idea I was mulling over at some point was simply
to define DRM_CRTC_FMT/ARGS/etc. macros and use those. But that
makes the format string super ugly and hard to read.


I think the proper solution would be to have actually
sensible conversion specifiers in the format string.
So instead of %<set of random characters> we'd have something
more like %{drm_crtc} (or whatever color you want to throw
on that particular bikeshed).

Adding vsprintf.c folks to cc in case they have some ideas...

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2024-02-23 19:47 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 16:40 [PATCH 00/12] drm/i915: Use drm_printer more Ville Syrjala
2024-02-15 16:40 ` [PATCH 01/12] drm/i915: Indicate which pipe failed the fastset check overall Ville Syrjala
2024-02-22 21:46   ` Rodrigo Vivi
2024-02-23 19:47     ` Ville Syrjälä [this message]
2024-02-26 14:57       ` Jani Nikula
2024-02-26 15:10         ` Andy Shevchenko
2024-02-26 15:35           ` Jani Nikula
2024-02-26 16:30             ` Andy Shevchenko
2024-02-26 16:35             ` Ville Syrjälä
2024-02-27  9:38         ` Rasmus Villemoes
2024-02-27 18:32           ` Ville Syrjälä
2024-02-28  8:32             ` Rasmus Villemoes
2024-02-28  9:55               ` Petr Mladek
2024-02-15 16:40 ` [PATCH 02/12] drm/i915: Include CRTC info in infoframe mismatch prints Ville Syrjala
2024-02-22 21:47   ` Rodrigo Vivi
2024-02-23 19:50     ` Ville Syrjälä
2024-02-15 16:40 ` [PATCH 03/12] drm/i915: Include CRTC info in VSC SDP " Ville Syrjala
2024-02-22 21:48   ` Rodrigo Vivi
2024-02-15 16:40 ` [PATCH 04/12] drm/i915: Convert pipe_config_infoframe_mismatch() to drm_printer Ville Syrjala
2024-02-22 21:50   ` Rodrigo Vivi
2024-02-15 16:40 ` [PATCH 05/12] drm/i915: Convert pipe_config_buffer_mismatch() " Ville Syrjala
2024-02-22 21:51   ` Rodrigo Vivi
2024-02-15 16:40 ` [PATCH 06/12] drm/i915: Convert intel_dpll_dump_hw_state() " Ville Syrjala
2024-02-22 21:54   ` Rodrigo Vivi
2024-02-23 19:57     ` Ville Syrjälä
2024-02-29 18:40   ` [PATCH v2 " Ville Syrjala
2024-02-29 19:43     ` Jani Nikula
2024-02-15 16:40 ` [PATCH 07/12] drm/i915: Use drm_printer more extensively in intel_crtc_state_dump() Ville Syrjala
2024-02-22 21:57   ` Rodrigo Vivi
2024-02-23 19:59     ` Ville Syrjälä
2024-02-15 16:40 ` [PATCH 08/12] drm/i915: Convert the remaining state dump to drm_printer Ville Syrjala
2024-03-05  9:12   ` Jani Nikula
2024-02-15 16:40 ` [PATCH 09/12] drm/i915: Skip intel_crtc_state_dump() if debugs aren't enabled Ville Syrjala
2024-02-29 15:20   ` Jani Nikula
2024-02-29 15:21     ` Jani Nikula
2024-02-15 16:40 ` [PATCH 10/12] drm/i915: Relocate pipe_config_mismatch() Ville Syrjala
2024-02-29 15:21   ` Jani Nikula
2024-02-15 16:40 ` [PATCH 11/12] drm/i915: Reuse pipe_config_mismatch() more Ville Syrjala
2024-02-29 15:28   ` Jani Nikula
2024-02-29 18:42   ` [PATCH v2 " Ville Syrjala
2024-02-15 16:40 ` [PATCH 12/12] drm/i915: Create the printer only once in intel_pipe_config_compare() Ville Syrjala
2024-02-29 15:29   ` Jani Nikula
2024-02-29 18:42   ` [PATCH v2 " Ville Syrjala
2024-02-16 18:03 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Use drm_printer more Patchwork
2024-02-16 18:03 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-02-16 18:15 ` ✓ Fi.CI.BAT: success " Patchwork
2024-02-17  7:24 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-02-29 12:08 ` [PATCH 00/12] " Jani Nikula
2024-02-29 23:02 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Use drm_printer more (rev4) Patchwork
2024-02-29 23:02 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-02-29 23:19 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-03-05 21:28 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Use drm_printer more (rev5) Patchwork
2024-03-05 21:28 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-03-05 21:46 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-03-06 12:07 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Use drm_printer more (rev6) Patchwork
2024-03-06 12:07 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-03-06 12:13 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-03-08  8:37 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Use drm_printer more (rev7) Patchwork
2024-03-08  8:37 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-03-08  8:52 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-03-13 19:41 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Use drm_printer more (rev8) Patchwork
2024-03-13 19:41 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-03-13 19:54 ` ✓ Fi.CI.BAT: success " Patchwork
2024-03-14  2:49 ` ✗ Fi.CI.IGT: 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=Zdj2ONs8BZ6959Xb@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=pmladek@suse.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.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;
as well as URLs for NNTP newsgroup(s).