public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH i-g-t] kms_flip_tiling: Test flips between same tiling
Date: Thu, 23 Apr 2015 12:33:22 +0100	[thread overview]
Message-ID: <5538D882.2050504@linux.intel.com> (raw)
In-Reply-To: <20150423103949.GF21511@nuc-i3427.alporthouse.com>


On 04/23/2015 11:39 AM, Chris Wilson wrote:
> On Thu, Apr 23, 2015 at 11:08:35AM +0100, Tvrtko Ursulin wrote:
>> +/*
>> + * Test that tiled page flips work.
>
> Worth saying that we don't always expect linear->tiled flips to work, so
> the mo is to first set the CRTC with a tiled fb, then flip to the
> second.

I didn't have that in mind for this test - here it only concerns itself 
with skl_do_mmio_flip bug (2ebef630fd283642a11c48c0e0f054c3c5c59e86).

>> + */
>> +static void
>> +test_tiled_flip(data_t *data, igt_output_t *output, uint64_t tiling)
>> +{
>> +	drmModeModeInfo *mode;
>> +	igt_plane_t *primary;
>> +	igt_pipe_crc_t *pipe_crc;
>> +	igt_crc_t reference_crc, crc;
>> +	struct igt_fb fb[2];
>> +	int fb_id[2], pipe, ret, width, height;
>> +
>> +	pipe = output->config.pipe;
>> +	pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
>> +	igt_output_set_pipe(output, pipe);
>> +
>> +	mode = igt_output_get_mode(output);
>> +	primary = igt_output_get_plane(output, 0);
>> +
>> +	width = mode->hdisplay;
>> +	height = mode->vdisplay;
>> +
>> +	/* create two identical fbs */
>> +	fb_id[0] = igt_create_fb(data->drm_fd, width, height,
>> +				 DRM_FORMAT_XRGB8888, tiling, &fb[0]);
>> +	igt_assert(fb_id[0]);
>> +
>> +	fb_id[1] = igt_create_fb(data->drm_fd, width, height,
>> +				 DRM_FORMAT_XRGB8888, tiling, &fb[1]);
>> +	igt_assert(fb_id[1]);
>> +
>> +	fill_fb(&fb[0], data, mode);
>> +	fill_fb(&fb[1], data, mode);
>
> Pretty please can we have two different patterns?
>
>> +	/* set the crtc and generate a reference crc */
>> +	igt_plane_set_fb(primary, &fb[0]);
>> +	igt_display_commit(&data->display);
>> +	igt_pipe_crc_collect_crc(pipe_crc, &reference_crc);
>> +
>> +	/* flip to the other fb */
>> +	ret = drmModePageFlip(data->drm_fd, output->config.crtc->crtc_id,
>> +			      fb_id[1], 0, NULL);
>> +	igt_assert_eq(ret, 0);
>> +
>> +	igt_wait_for_vblank(data->drm_fd, pipe);
>
> I'd be more comfortable waiting for the flip-completion event (and then
> a vblank for the CRC to be computed? idk)

I can look into that but shame on you for ruining my copy&paste party! ;)

>> +	/* get a crc and compare with the reference */
>> +	igt_pipe_crc_collect_crc(pipe_crc, &crc);
>> +	igt_assert_crc_equal(&reference_crc, &crc);
>
> With 2 patterns you can even test the second flip back again!
>
> So for detecting the current breakage, we should just a
> test_tiled_change that if PageFlip returns 0, the crc matches the
> reference? And iterate over the modes to find one that causes an
> underrun?

Underruns and watermarks I intended for another test case. This one is a 
really simple one - flip with the same framebuffer and check that it has 
really remained the same.

And the pre-existent test_flip_changes_tiling works in the opposite 
direction so won't cause an underrun. But will start failing if we merge 
(drm/i915/skl: Disallow tiling changes during page flip).

So third test case could be what you say, flip from linear to tiled and 
check for underrun if it works.

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2015-04-23 11:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 10:08 [PATCH i-g-t] kms_flip_tiling: Test flips between same tiling Tvrtko Ursulin
2015-04-23 10:39 ` Chris Wilson
2015-04-23 11:33   ` Tvrtko Ursulin [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=5538D882.2050504@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --cc=tvrtko.ursulin@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