From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, igt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [igt-dev] [PATCH i-g-t 02/17] igt/gem_tiled_partial_pwrite_pread: Check for known swizzling
Date: Thu, 5 Jul 2018 13:30:57 +0100 [thread overview]
Message-ID: <0e20fa11-9be6-b1b1-e881-b8bbb4b382fc@linux.intel.com> (raw)
In-Reply-To: <153078928772.31833.7517594807964385129@skylake-alporthouse-com>
On 05/07/2018 12:14, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2018-07-02 13:00:07)
>>
>> On 02/07/2018 10:07, Chris Wilson wrote:
>>> As we want to compare a templated tiling pattern against the target_bo,
>>> we need to know that the swizzling is compatible. Or else the two
>>> tiling pattern may differ due to underlying page address that we cannot
>>> know, and so the test may sporadically fail.
>>>
>>> References: https://bugs.freedesktop.org/show_bug.cgi?id=102575
>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> ---
>>> tests/gem_tiled_partial_pwrite_pread.c | 24 ++++++++++++++++++++++++
>>> 1 file changed, 24 insertions(+)
>>>
>>> diff --git a/tests/gem_tiled_partial_pwrite_pread.c b/tests/gem_tiled_partial_pwrite_pread.c
>>> index fe573c37c..83c57c07d 100644
>>> --- a/tests/gem_tiled_partial_pwrite_pread.c
>>> +++ b/tests/gem_tiled_partial_pwrite_pread.c
>>> @@ -249,6 +249,24 @@ static void test_partial_read_writes(void)
>>> }
>>> }
>>>
>>> +static bool known_swizzling(uint32_t handle)
>>> +{
>>> + struct drm_i915_gem_get_tiling2 {
>>> + uint32_t handle;
>>> + uint32_t tiling_mode;
>>> + uint32_t swizzle_mode;
>>> + uint32_t phys_swizzle_mode;
>>> + } arg = {
>>> + .handle = handle,
>>> + };
>>> +#define DRM_IOCTL_I915_GEM_GET_TILING2 DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct
>>
>> Can't we rely on this being in system headers by now?
>>
>> drm_i915_gem_get_tiling2)
>>> +
>>> + if (igt_ioctl(fd, DRM_IOCTL_I915_GEM_GET_TILING2, &arg))
>>> + return false;
>>> +
>>> + return arg.phys_swizzle_mode == arg.swizzle_mode;
>>> +}
>>> +
>>> igt_main
>>> {
>>> uint32_t tiling_mode = I915_TILING_X;
>>> @@ -271,6 +289,12 @@ igt_main
>>> &tiling_mode, &scratch_pitch, 0);
>>> igt_assert(tiling_mode == I915_TILING_X);
>>> igt_assert(scratch_pitch == 4096);
>>> +
>>> + /*
>>> + * As we want to compare our template tiled pattern against
>>> + * the target bo, we need consistent swizzling on both.
>>> + */
>>> + igt_require(known_swizzling(scratch_bo->handle));
>>> staging_bo = drm_intel_bo_alloc(bufmgr, "staging bo", BO_SIZE, 4096);
>>> tiled_staging_bo = drm_intel_bo_alloc_tiled(bufmgr, "scratch bo", 1024,
>>> BO_SIZE/4096, 4,
>>>
>>
>> Another option could be to keep allocating until we found one in the
>> memory area with compatible swizzling? Like this it may be some noise in
>> the test pass<->skip transitions.
>
> It depends on physical layout which the kernel keeps hidden (for
> understandable reasons).
Yeah, but we could allocate more and more until we end up in the area
where args.phys_swizzle_mode == args.swizzle_mode. Might be to heavy
approach. But then this skip can be random depending on what physical
memory gets allocated in each test run.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-07-05 12:30 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-02 9:07 [Intel-gfx] [PATCH i-g-t 01/17] lib: Report file cache as available system memory Chris Wilson
2018-07-02 9:07 ` [igt-dev] [PATCH i-g-t 02/17] igt/gem_tiled_partial_pwrite_pread: Check for known swizzling Chris Wilson
2018-07-02 12:00 ` Tvrtko Ursulin
2018-07-05 11:14 ` [Intel-gfx] " Chris Wilson
2018-07-05 12:30 ` Tvrtko Ursulin [this message]
2018-07-05 12:35 ` Chris Wilson
2018-07-05 15:26 ` Tvrtko Ursulin
2018-07-05 15:55 ` Chris Wilson
2018-07-02 9:07 ` [Intel-gfx] [PATCH i-g-t 03/17] igt/gem_set_tiling_vs_pwrite: Show the erroneous value Chris Wilson
2018-07-02 12:00 ` [igt-dev] " Tvrtko Ursulin
2018-07-02 9:07 ` [igt-dev] [PATCH i-g-t 04/17] lib: Convert spin batch constructor to a factory Chris Wilson
2018-07-02 15:34 ` Tvrtko Ursulin
2018-07-02 9:07 ` [igt-dev] [PATCH i-g-t 05/17] lib: Spin fast, retire early Chris Wilson
2018-07-02 15:36 ` [Intel-gfx] " Tvrtko Ursulin
2018-07-05 11:23 ` [igt-dev] " Chris Wilson
2018-07-05 12:33 ` Tvrtko Ursulin
2018-07-05 12:42 ` [igt-dev] " Chris Wilson
2018-07-05 15:29 ` Tvrtko Ursulin
2018-07-05 15:52 ` Chris Wilson
2018-07-02 9:07 ` [Intel-gfx] [PATCH i-g-t 06/17] igt/gem_sync: Alternate stress for nop+sync Chris Wilson
2018-07-02 9:07 ` [igt-dev] [PATCH i-g-t 07/17] igt/gem_sync: Double the wakeups, twice the pain Chris Wilson
2018-07-02 9:07 ` [igt-dev] [PATCH i-g-t 08/17] igt/gem_sync: Show the baseline poll latency for wakeups Chris Wilson
2018-07-02 9:07 ` [igt-dev] [PATCH i-g-t 09/17] igt/gem_userptr: Check read-only mappings Chris Wilson
2018-07-02 9:07 ` [Intel-gfx] [PATCH i-g-t 10/17] igt: Exercise creating context with shared GTT Chris Wilson
2018-07-02 9:07 ` [Intel-gfx] [PATCH i-g-t 11/17] igt/gem_ctx_switch: Exercise queues Chris Wilson
2018-07-02 9:07 ` [igt-dev] [PATCH i-g-t 12/17] igt/gem_exec_whisper: Fork all-engine tests one-per-engine Chris Wilson
2018-07-02 9:07 ` [igt-dev] [PATCH i-g-t 13/17] igt: Add gem_ctx_engines Chris Wilson
2018-07-02 9:07 ` [igt-dev] [PATCH i-g-t 14/17] igt: Add gem_exec_balancer Chris Wilson
2018-07-02 9:07 ` [igt-dev] [PATCH i-g-t 15/17] benchmarks/wsim: Simulate and interpret .wsim Chris Wilson
2018-07-02 9:07 ` [igt-dev] [PATCH i-g-t 16/17] tools: capture execution pathways Chris Wilson
2018-07-02 9:07 ` [igt-dev] [PATCH i-g-t 17/17] igt/gem_exec_latency: Robustify measurements Chris Wilson
2018-07-02 11:54 ` [igt-dev] [PATCH i-g-t 01/17] lib: Report file cache as available system memory Tvrtko Ursulin
2018-07-02 12:08 ` Chris Wilson
2018-07-02 13:09 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,01/17] " Patchwork
2018-07-02 14:16 ` [igt-dev] ✓ Fi.CI.IGT: " 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=0e20fa11-9be6-b1b1-e881-b8bbb4b382fc@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=igt-dev@lists.freedesktop.org \
--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