Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Bhanuprakash Modem <bhanuprakash.modem@intel.com>,
	intel-gfx@lists.freedesktop.org, nischal.varide@intel.com,
	uma.shankar@intel.com, anshuman.gupta@intel.com
Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915/display/debug: Expose Dither status via debugfs
Date: Wed, 26 May 2021 17:26:56 +0300	[thread overview]
Message-ID: <87im35bmfj.fsf@intel.com> (raw)
In-Reply-To: <20210526181728.14817-3-bhanuprakash.modem@intel.com>

On Wed, 26 May 2021, Bhanuprakash Modem <bhanuprakash.modem@intel.com> wrote:
> It's useful to know the dithering state & pipe bpc for IGT testing.
> This patch will expose the dithering state for the crtc via a debugfs
> file "dither".
>
> Example usage: cat /sys/kernel/debug/dri/0/crtc-0/dither
>
> Cc: Uma Shankar <uma.shankar@intel.com>
> Cc: Nischal Varide <nischal.varide@intel.com>
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
> ---
>  .../drm/i915/display/intel_display_debugfs.c  | 32 +++++++++++++++++++
>  1 file changed, 32 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> index 94e5cbd86e77..a6fefc7d5ab9 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -2158,11 +2158,43 @@ static const struct {
>  	{"i915_edp_psr_debug", &i915_edp_psr_debug_fops},
>  };
>  
> +static int dither_state_show(struct seq_file *m, void *data)
> +{
> +	struct intel_crtc *crtc = to_intel_crtc(m->private);
> +	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> +	struct intel_crtc_state *crtc_state;
> +	int ret;
> +
> +	if (!HAS_DISPLAY(dev_priv))
> +		return -ENODEV;

Unneeded.

> +
> +	ret = drm_modeset_lock_single_interruptible(&crtc->base.mutex);
> +	if (ret)
> +		return ret;
> +
> +	crtc_state = to_intel_crtc_state(crtc->base.state);
> +	seq_printf(m, "bpc: %u\n", crtc_state->pipe_bpp / 3);
> +	seq_printf(m, "Dither: %u\n", (crtc_state->dither) ? 1 : 0);
> +	seq_printf(m, "Dither_CC1: %u\n",
> +		(crtc_state->gamma_mode & GAMMA_MODE_DITHER_AFTER_CC1) ? 1 : 0);

Are you looking to duplicate the conditions for enabling this CC1 mode
in IGT, and then checking if the driver set the bit as well?

I thought the direction has been that we don't do this type of
validation in IGT. There is no end to it.

Ville?

> +
> +	drm_modeset_unlock(&crtc->base.mutex);
> +
> +	return 0;
> +}
> +DEFINE_SHOW_ATTRIBUTE(dither_state);
> +
>  void intel_display_debugfs_register(struct drm_i915_private *i915)
>  {
>  	struct drm_minor *minor = i915->drm.primary;
> +	struct drm_device *dev = &i915->drm;
> +	struct drm_crtc *crtc;
>  	int i;
>  
> +	drm_for_each_crtc(crtc, dev)
> +		debugfs_create_file("dither", 0444, crtc->debugfs_entry, crtc,
> +				    &dither_state_fops);
> +

See intel_crtc_debugfs_add(), called from intel_crtc_late_register().

>  	for (i = 0; i < ARRAY_SIZE(intel_display_debugfs_files); i++) {
>  		debugfs_create_file(intel_display_debugfs_files[i].name,
>  				    S_IRUGO | S_IWUSR,

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-05-26 14:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 18:17 [Intel-gfx] [PATCH 0/2] drm/i915/xelpd: Enabling dithering after the CC1 Bhanuprakash Modem
2021-05-26 13:05 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-05-26 13:07 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-05-26 13:34 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-05-26 18:17 ` [Intel-gfx] [PATCH 1/2] " Bhanuprakash Modem
2021-05-26 14:04   ` Jani Nikula
2021-05-26 15:58     ` Modem, Bhanuprakash
2021-05-26 16:11       ` Jani Nikula
2021-06-01 12:13       ` Varide, Nischal
2021-06-02 12:47         ` Varide, Nischal
2021-06-02  6:17   ` [Intel-gfx] [PATCH v2 0/1] " Nischal Varide
2021-06-02  6:17     ` [Intel-gfx] [PATCH v2 1/1] drm/i915/xelpd: " Nischal Varide
2021-06-04  9:47       ` Modem, Bhanuprakash
2021-06-08 23:53       ` [Intel-gfx] [PATCH v3 0/1] " Nischal Varide
2021-06-08 23:53         ` [Intel-gfx] [PATCH v3 1/1] drm/i915/xelpd: " Nischal Varide
2021-05-26 18:17 ` [Intel-gfx] [PATCH 2/2] drm/i915/display/debug: Expose Dither status via debugfs Bhanuprakash Modem
2021-05-26 14:26   ` Jani Nikula [this message]
2021-05-26 14:37     ` Ville Syrjälä
2021-06-21  7:53       ` Modem, Bhanuprakash
2021-05-26 15:54     ` Modem, Bhanuprakash
2021-05-26 20:40 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915/xelpd: Enabling dithering after the CC1 Patchwork
2021-06-08 23:44 ` [Intel-gfx] [PATCH v3 0/1] " Nischal Varide
2021-06-08 23:44   ` [Intel-gfx] [PATCH v3 1/1] drm/i915/xelpd: " Nischal Varide
2021-06-09  9:31 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915/xelpd: Enabling dithering after the CC1 (rev3) 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=87im35bmfj.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=bhanuprakash.modem@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=nischal.varide@intel.com \
    --cc=uma.shankar@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