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>
Subject: Re: [RFC i-g-t] tests/gem_exec_pad_to_size: Test object padding at execbuf
Date: Wed, 25 Mar 2015 14:32:05 +0000 [thread overview]
Message-ID: <5512C6E5.1000305@linux.intel.com> (raw)
In-Reply-To: <20150325142835.GA13857@nuc-i3427.alporthouse.com>
On 03/25/2015 02:28 PM, Chris Wilson wrote:
> On Wed, Mar 25, 2015 at 02:21:00PM +0000, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> This tests the new EXEC_OBJECT_PAD_TO_SIZE exec_object2 flag.
>>
>> It uses the fact DRM allocation policy is set as ABI and allocates
>> space in order.
>
> Ssh. That's not what I meant to say. I meant that the policy is not ABI,
> and we abuse our internal knowledge to get a working test, as we do
> elsewhere in igt.
Ah, OK. :)
>> That means that we should be able to easily get
>> two bos mapped at adjacent GTT addresses and then test that the
>> pad to size flag will move them apart.
>
>> + /* Try to get two buffer object next to each other in GTT space. */
>> + for (try = 0, idx = 0; try < max_tries;) {
>> + eb_handles[0] = handles[0];
>> + eb_handles[1] = loc_handles[idx];
>> + eb_handles[2] = loc_handles[idx + 1];
>> +
>> + igt_assert(exec(fd, eb_handles, (uint32_t[2]){0, 0},
>> + offsets) == 0);
>> +
>> + if (offsets[1] > offsets[0]) {
>> + distance = offsets[1] - offsets[0];
>> + if (distance == PAGE_SIZE)
>> + neighbours = true;
>> + pad_to_size[0] = ALIGN(distance + PAGE_SIZE, PAGE_SIZE);
>> + } else {
>> + distance = offsets[0] - offsets[1];
>> + if (distance == PAGE_SIZE)
>> + neighbours = true;
>> + pad_to_size[1] = ALIGN(distance + PAGE_SIZE, PAGE_SIZE);
>> + }
>> +
>> + if (neighbours)
>> + break;
>
> What's important to make this trick work is to allocate new handles
> every time. That way we fill up the GTT and thereby hope to skip over
> the fragmented part.
It does do that!
Only perhaps I need to make sure they are kept bound so maybe keep them
mapped or something while trying new ones?
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-03-25 14:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-25 14:21 [RFC i-g-t] tests/gem_exec_pad_to_size: Test object padding at execbuf Tvrtko Ursulin
2015-03-25 14:28 ` Chris Wilson
2015-03-25 14:32 ` Tvrtko Ursulin [this message]
2015-03-25 14:41 ` Chris Wilson
2015-03-25 14:57 ` Tvrtko Ursulin
2015-04-01 11:21 ` [RFC i-g-t v2] " Tvrtko Ursulin
2015-04-01 13:06 ` Chris Wilson
2015-04-01 13:17 ` Chris Wilson
2015-04-01 13:36 ` Tvrtko Ursulin
2015-04-01 13:56 ` Chris Wilson
2015-04-01 14:14 ` Tvrtko Ursulin
2015-04-01 14:27 ` Chris Wilson
2015-04-01 15:14 ` [RFC i-g-t v3] " Tvrtko Ursulin
2015-04-01 15:42 ` Chris Wilson
2015-04-01 16:07 ` Tvrtko Ursulin
2015-04-01 16:31 ` Chris Wilson
2015-04-01 16:39 ` Chris Wilson
2015-04-02 10:47 ` Tvrtko Ursulin
2015-04-02 10:45 ` [RFC i-g-t v4] " Tvrtko Ursulin
2015-04-02 11:02 ` Chris Wilson
2015-04-02 12:54 ` [RFC i-g-t v5] " Tvrtko Ursulin
2015-04-02 16:09 ` Thomas Wood
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=5512C6E5.1000305@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=chris@chris-wilson.co.uk \
--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