All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mateo Lozano, Oscar" <oscar.mateo@intel.com>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v2] tests/gem_error_capture: Initial testcase for error state capture/dump
Date: Fri, 9 May 2014 12:04:47 +0000	[thread overview]
Message-ID: <1399636785.3469.3.camel@omateolo-linux2> (raw)
In-Reply-To: <87mwfmodfj.fsf@gaia.fi.intel.com>

Hi Mika,

> > +static bool rings_stopped(void)
> > +{
> > +	int fd;
> > +	static char buf[128];
> > +	unsigned long long val;
> > +
> > +	fd = igt_debugfs_open("i915_ring_stop", O_RDONLY);
> > +	igt_assert(fd >= 0);
> > +
> > +	igt_assert(read(fd, buf, sizeof(buf)) > 0);
> > +	close(fd);
> > +
> > +	sscanf(buf, "%llx", &val);
> > +
> > +	return (bool)val;
> > +}
> 
> Please use igt_set_stop_rings() and igt_get_stop_rings().
> 
> Also consider stopping only the ring you are testing for.

Oops, I didn see these before. Ok, done in the new version.

> > +			for (i = 0; i < tail / 4; i++) {
> > +				igt_assert(getline(&line, &line_size, file) > 0);
> > +				items = sscanf(line, "%08x :  %08x\n",
> > +						&offset, &command);
> > +				igt_assert(items == 2);
> > +				if ((command & 0x1F800000) == MI_BATCH_BUFFER_START) {
> > +					igt_assert(getline(&line, &line_size, file) > 0);
> > +					items = sscanf(line, "%08x :  %08x\n",
> > +							&offset, &expected_addr);
> > +					igt_assert(items == 2);
> 
> Should check for MAGIC_NUMBER here?

I'm doing it above already, inside bb_matched:

			for (i = 0; i < sizeof(batch) / 4; i++) {
				igt_assert(getline(&line, &line_size, file) > 0);
				snprintf(expected_line, sizeof(expected_line), "%08x :  %08x",
						4*i, batch[i]);
				igt_assert(strstr(line, expected_line));
			}

-- Oscar

  reply	other threads:[~2014-05-09 12:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11 12:59 [PATCH] tests/gem_error_capture: Initial testcase for error state capture/dump oscar.mateo
2014-04-11 13:09 ` Mateo Lozano, Oscar
2014-04-11 14:27   ` Daniel Vetter
2014-04-11 16:48 ` [PATCH v2] " oscar.mateo
2014-04-11 17:12   ` Chris Wilson
2014-04-14 10:01     ` Mateo Lozano, Oscar
2014-04-14 10:14       ` Chris Wilson
2014-04-14 10:23         ` Mateo Lozano, Oscar
2014-04-14 10:30           ` Chris Wilson
2014-04-14 13:03             ` Mateo Lozano, Oscar
2014-04-15 19:38               ` Daniel Vetter
2014-05-09 12:07                 ` Mateo Lozano, Oscar
2014-04-15 14:49   ` Mika Kuoppala
2014-05-09 12:04     ` Mateo Lozano, Oscar [this message]
2014-05-09 11:54   ` [PATCH] " oscar.mateo

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=1399636785.3469.3.camel@omateolo-linux2 \
    --to=oscar.mateo@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.