public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: IGT development <igt-dev@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] lib/crc: Reset fifo underrun reporting for every crc capture
Date: Wed, 20 Feb 2019 13:55:37 +0100	[thread overview]
Message-ID: <20190220125537.GY2665@phenom.ffwll.local> (raw)
In-Reply-To: <20190219091106.15916-1-daniel.vetter@ffwll.ch>

On Tue, Feb 19, 2019 at 10:11:06AM +0100, Daniel Vetter wrote:
> We have tons of issues with crc mismatches, but often by that time
> there was already a fifo underrun, which disables further fifo
> underrun reporting. Reset fifo underrun reporting before we capture a
> crc so that it's easier to figure out why the crc mismatch happened.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Merged with Maarten's irc r-b.
-Daniel

> ---
>  lib/igt_debugfs.c | 21 +++++++++++++++++++++
>  lib/igt_debugfs.h |  2 ++
>  lib/igt_kms.c     |  8 ++------
>  3 files changed, 25 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
> index 6cfaa97579e7..640c78e972e9 100644
> --- a/lib/igt_debugfs.c
> +++ b/lib/igt_debugfs.c
> @@ -808,6 +808,8 @@ void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
>  	/* Stop first just to make sure we don't have lingering state left. */
>  	igt_pipe_crc_stop(pipe_crc);
>  
> +	igt_reset_fifo_underrun_reporting(pipe_crc->fd);
> +
>  	igt_assert_eq(write(pipe_crc->ctl_fd, src, strlen(src)), strlen(src));
>  
>  	sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
> @@ -1002,6 +1004,25 @@ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)
>  	igt_pipe_crc_stop(pipe_crc);
>  }
>  
> +/**
> + * igt_reset_fifo_underrun_reporting:
> + * @drm_fd: drm device file descriptor
> + *
> + * Resets fifo underrun reporting, if supported by the device. Useful since fifo
> + * underrun reporting tends to be one-shot, so good to reset it before the
> + * actual functional test again in case there's been a separate issue happening
> + * while preparing the test setup.
> + */
> +void igt_reset_fifo_underrun_reporting(int drm_fd)
> +{
> +	int fd = igt_debugfs_open(drm_fd, "i915_fifo_underrun_reset", O_WRONLY);
> +	if (fd >= 0) {
> +		igt_assert_eq(write(fd, "y", 1), 1);
> +
> +		close(fd);
> +	}
> +}
> +
>  /*
>   * Drop caches
>   */
> diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
> index 1233cd8f7a07..b9cf0f813773 100644
> --- a/lib/igt_debugfs.h
> +++ b/lib/igt_debugfs.h
> @@ -216,6 +216,8 @@ void igt_require_hpd_storm_ctl(int fd);
>  		  DROP_FREED | \
>  		  DROP_IDLE)
>  
> +void igt_reset_fifo_underrun_reporting(int drm_fd);
> +
>  bool igt_drop_caches_has(int fd, uint64_t val);
>  void igt_drop_caches_set(int fd, uint64_t val);
>  
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 85a911e11060..080f90ae6e8c 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -3269,14 +3269,10 @@ display_commit_changed(igt_display_t *display, enum igt_commit_style s)
>  	}
>  
>  	if (display->first_commit) {
> -		int fd = igt_debugfs_open(display->drm_fd, "i915_fifo_underrun_reset", O_WRONLY);
> -		if (fd >= 0) {
> -			igt_assert_eq(write(fd, "y", 1), 1);
> -
> -			close(fd);
> -		}
> +		igt_reset_fifo_underrun_reporting(display->drm_fd);
>  
>  		igt_display_drop_events(display);
> +
>  		display->first_commit = false;
>  	}
>  }
> -- 
> 2.20.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

      parent reply	other threads:[~2019-02-20 12:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-19  9:11 [igt-dev] [PATCH i-g-t] lib/crc: Reset fifo underrun reporting for every crc capture Daniel Vetter
2019-02-19  9:54 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-02-19 11:36 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-02-20 12:55 ` Daniel Vetter [this message]

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=20190220125537.GY2665@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=igt-dev@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