public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 04/29] drm/i915: Dump 'output_types' in crtc state dump
Date: Mon, 18 Sep 2017 21:56:34 +0300	[thread overview]
Message-ID: <20170918185634.GE4914@intel.com> (raw)
In-Reply-To: <150576022385.5563.15619535562088836904@mail.alporthouse.com>

On Mon, Sep 18, 2017 at 07:43:43PM +0100, Chris Wilson wrote:
> Quoting Ville Syrjala (2017-09-18 19:25:39)
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > To make it easier to debug things let's dump the output types bitmask in
> > the crtc state dump. And to make life that much better, let's pretty
> > print it as a a human reaadable string as well.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 50 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 50 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 8599e425abb1..192b07a92e76 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -10683,6 +10683,53 @@ intel_dump_m_n_config(struct intel_crtc_state *pipe_config, char *id,
> >                       m_n->link_m, m_n->link_n, m_n->tu);
> >  }
> >  
> > +#define OUTPUT_TYPE(x) [INTEL_OUTPUT_ ## x] = #x
> > +
> > +static const char * const output_type_str[] = {
> > +       OUTPUT_TYPE(UNUSED),
> > +       OUTPUT_TYPE(ANALOG),
> > +       OUTPUT_TYPE(DVO),
> > +       OUTPUT_TYPE(SDVO),
> > +       OUTPUT_TYPE(LVDS),
> > +       OUTPUT_TYPE(TVOUT),
> > +       OUTPUT_TYPE(HDMI),
> > +       OUTPUT_TYPE(DP),
> > +       OUTPUT_TYPE(EDP),
> > +       OUTPUT_TYPE(DSI),
> > +       OUTPUT_TYPE(UNKNOWN),
> > +       OUTPUT_TYPE(DP_MST),
> > +};
> > +
> > +static const char *output_types_str(unsigned int output_types)
> > +{
> > +       static char buf[64];
> 
> Bleh. Push to caller?

It's a debug thing so I wasn't too worried about making it entirely
robust. But I guess these things tend to come back and bite us
later, so with that in mind I can respin this to use a caller
provided buffer.

> > +       size_t len = sizeof(buf);
> > +       char *str = buf;
> > +       int i;
> > +
> > +       str[0] = '\0';
> > +
> > +       for (i = 0; i < ARRAY_SIZE(output_type_str); i++) {
> > +               int r;
> > +
> > +               if ((output_types & BIT(i)) == 0)
> > +                       continue;
> > +
> > +               r = snprintf(str, len, "%s%s",
> > +                            str != buf ? "," : "", output_type_str[i]);
> 
> No space after the comma? Heathen.

I had it there originally, but it looked a bit weird to me when I had
more than one bit set. I think the problem is that we alrady use a
comma for separating different pieces of state when we print them on
the same line. And so not having a space in there makes it more
clear that these things are in fact part of the same piece of state.

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-09-18 18:56 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18 18:25 [PATCH 00/29] drm/i915: Eliminate DDI encoder->type frobbery redux Ville Syrjala
2017-09-18 18:25 ` [PATCH 01/29] drm/i915: Replace some spaces with tabs Ville Syrjala
2017-09-18 18:38   ` Chris Wilson
2017-09-18 18:53   ` Jani Nikula
2017-09-18 18:25 ` [PATCH 02/29] drm/i915: Shrink bxt_ddi_buf_trans Ville Syrjala
2017-09-18 18:54   ` Jani Nikula
2017-09-18 18:25 ` [PATCH 03/29] drm/i915: Shrink cnl_ddi_buf_trans Ville Syrjala
2017-09-18 18:39   ` Chris Wilson
2017-09-18 18:40   ` Chris Wilson
2017-09-18 19:02     ` Chris Wilson
2017-09-18 18:25 ` [PATCH 04/29] drm/i915: Dump 'output_types' in crtc state dump Ville Syrjala
2017-09-18 18:43   ` Chris Wilson
2017-09-18 18:56     ` Ville Syrjälä [this message]
2017-09-18 18:54   ` Jani Nikula
2017-09-20 14:03   ` [PATCH v2 " Ville Syrjala
2017-09-18 18:25 ` [PATCH 05/29] drm/i915: Extract intel_ddi_clk_disable() Ville Syrjala
2017-09-18 18:45   ` Chris Wilson
2017-09-18 19:09     ` Ville Syrjälä
2017-09-18 18:25 ` [PATCH 06/29] drm/i915: Extract intel_disable_ddi_buf() Ville Syrjala
2017-09-18 18:55   ` Jani Nikula
2017-09-18 18:25 ` [PATCH 07/29] drm/i915: Inline the required bits of intel_ddi_post_disable() into intel_ddi_fdi_post_disable() Ville Syrjala
2017-09-18 18:55   ` Jani Nikula
2017-09-18 18:25 ` [PATCH 08/29] drm/i915: Split intel_ddi_post_disable() into DP vs. HDMI variants Ville Syrjala
2017-09-18 18:56   ` Jani Nikula
2017-09-18 18:25 ` [PATCH 09/29] drm/i915: Remove useless eDP check from intel_ddi_pre_enable_dp() Ville Syrjala
2017-09-18 18:56   ` Jani Nikula
2017-09-18 18:25 ` [PATCH 10/29] drm/i915: Split intel_disable_ddi() into DP vs. HDMI variants Ville Syrjala
2017-09-18 18:25 ` [PATCH 11/29] drm/i915: Plump crtc_state etc. directly to intel_ddi_pre_enable_{dp, hdmi}() Ville Syrjala
2017-09-18 18:25 ` [PATCH 12/29] drm/i915: Split intel_enable_ddi() into DP and HDMI variants Ville Syrjala
2017-09-18 18:25 ` [PATCH 13/29] drm/i915: Relocate intel_ddi_get_buf_trans_*() functions Ville Syrjala
2017-09-18 18:25 ` [PATCH 14/29] drm/i915: Extract intel_ddi_get_buf_trans_hdmi() Ville Syrjala
2017-09-18 18:25 ` [PATCH 15/29] drm/i915: Pass the encoder type explicitly to skl_set_iboost() Ville Syrjala
2017-09-18 18:25 ` [PATCH 16/29] drm/i915: Pass the level to intel_prepare_hdmi_ddi_buffers() Ville Syrjala
2017-09-18 18:25 ` [PATCH 17/29] drm/i915: Integrate BXT into intel_ddi_dp_voltage_max() Ville Syrjala
2017-09-18 18:25 ` [PATCH 18/29] drm/i915: Pass encoder type to cnl_ddi_vswing_sequence() explicitly Ville Syrjala
2017-09-18 18:25 ` [PATCH 19/29] drm/i915: Kill off the BXT buf_trans default_index Ville Syrjala
2017-09-18 18:25 ` [PATCH 20/29] drm/i915: Don't use encoder->type in intel_ddi_set_pipe_settings() Ville Syrjala
2017-09-18 18:25 ` [PATCH 21/29] drm/i915: Pass crtc state to intel_prepare_dp_ddi_buffers() Ville Syrjala
2017-09-18 18:25 ` [PATCH 22/29] drm/i915: Start using output_types for DPLL selection Ville Syrjala
2017-09-18 18:25 ` [PATCH 23/29] drm/i915: Stop using encoder->type in intel_ddi_enable_transcoder_func() Ville Syrjala
2017-09-18 18:25 ` [PATCH 24/29] drm/i915: Centralize the SKL DDI A/E vs. B/C/D buf trans handling Ville Syrjala
2017-09-18 18:26 ` [PATCH 25/29] drm/i915: Stop frobbing with DDI encoder->type Ville Syrjala
2017-09-21 11:06   ` [PATCH v2 " Ville Syrjala
2017-09-21 14:56   ` [PATCH v3 " Ville Syrjala
2017-09-18 18:26 ` [PATCH 26/29] drm/i915: Unify error handling for missing DDI buf trans tables Ville Syrjala
2017-09-18 18:26 ` [PATCH 27/29] drm/i915: Clear up the types we use for DDI buf trans level/n_entries Ville Syrjala
2017-09-18 18:26 ` [PATCH 28/29] drm/i915: Replace most intel_ddi_get_encoder_port() alls with encoder->port Ville Syrjala
2017-09-18 18:26 ` [PATCH 29/29] drm/i915: Pass a crtc state to ddi post_disable from MST code Ville Syrjala
2017-09-18 19:02   ` Jani Nikula
2017-09-18 19:04 ` [PATCH 00/29] drm/i915: Eliminate DDI encoder->type frobbery redux Jani Nikula
2017-09-18 19:46 ` ✗ Fi.CI.BAT: failure for " Patchwork
2017-09-20 14:26 ` ✗ Fi.CI.BAT: failure for drm/i915: Eliminate DDI encoder->type frobbery redux (rev2) Patchwork
2017-09-20 15:40 ` Patchwork
2017-09-20 15:46   ` Ville Syrjälä
2017-09-25 11:40     ` Jani Nikula
2017-09-21 13:18 ` ✗ Fi.CI.BAT: failure for drm/i915: Eliminate DDI encoder->type frobbery redux (rev3) Patchwork
2017-09-21 15:36 ` ✓ Fi.CI.BAT: success for drm/i915: Eliminate DDI encoder->type frobbery redux (rev4) Patchwork
2017-09-21 18:26 ` ✗ 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=20170918185634.GE4914@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@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