From: Scott D Phillips <scott.d.phillips@intel.com>
To: Jordan Justen <jordan.l.justen@intel.com>,
IGT GPU Tools <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t 1/6] aubdump: Add gen8_map_range
Date: Wed, 21 Feb 2018 16:43:41 -0800 [thread overview]
Message-ID: <87d10x3lc2.fsf@intel.com> (raw)
In-Reply-To: <20180221231905.15580-1-jordan.l.justen@intel.com>
Jordan Justen <jordan.l.justen@intel.com> writes:
> This function should allow us to only write the page table entries
> that get used.
>
> Cc: Scott D Phillips <scott.d.phillips@intel.com>
> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
> ---
> tools/aubdump.c | 41 ++++++++++++++++++++++++++++++-----------
> 1 file changed, 30 insertions(+), 11 deletions(-)
>
> diff --git a/tools/aubdump.c b/tools/aubdump.c
> index 700296f4..2e60e547 100644
> --- a/tools/aubdump.c
> +++ b/tools/aubdump.c
> @@ -382,12 +382,40 @@ register_write_out(uint32_t addr, uint32_t value)
> dword_out(value);
> }
>
> +static void
> +gen8_map_range(uint64_t start, uint64_t end)
> +{
> + uint64_t entry_addr;
> + uint64_t page_num;
> + uint64_t end_aligned = (end + 4096 - 1) & ~(4096 - 1);
end_aligned = ALIGN(end, 4096);
> +
> + if (start >= end)
> + return;
Also check (end <= 1ull << 32) (ggtt is at most 4gb)
> + entry_addr = start & ~(4096 - 1);
> + do {
> + page_num = entry_addr >> 21;
> + uint64_t last_page_entry =
> + min((page_num + 1) << 21, end_aligned);
> + uint64_t num_entries = (last_page_entry - entry_addr) >> 12;
> + mem_trace_memory_write_header_out(
> + (page_num << 12) + ((entry_addr >> 9) & 0xff8),
This is a little obfuscated and comes out to equal (entry_addr >> 9) if
I follow.
> + num_entries * GEN8_PTE_SIZE,
> + AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_GGTT_ENTRY);
> + while (num_entries-- > 0) {
> + dword_out((entry_addr & ~(4096 - 1)) |
> + 3 /* read/write | present */);
> + dword_out(entry_addr >> 32);
> + entry_addr += 4096;
> + }
> + } while (entry_addr < end);
> +}
> +
> static void
> gen10_write_header(void)
> {
> char app_name[8 * 4];
> int app_name_len, dwords;
> - uint32_t entry = 0x3; /* read/write | present */
>
> app_name_len =
> snprintf(app_name, sizeof(app_name), "PCI-ID=0x%X %s", device,
> @@ -403,16 +431,7 @@ gen10_write_header(void)
> dword_out(0); /* version */
> data_out(app_name, app_name_len);
>
> - /* GGTT PT */
> - for (uint32_t page = 0; page < ALIGN(PT_SIZE, 4096) / 4096; page++) {
> - uint32_t to_write = min(PT_SIZE - page * 4096, 4096);
Might as well delete PT_SIZE as it's not used now.
> - mem_trace_memory_write_header_out(page << 12, to_write,
> - AUB_MEM_TRACE_MEMORY_ADDRESS_SPACE_GGTT_ENTRY);
> - for (uint32_t i = 0; i < to_write / GEN8_PTE_SIZE; i++) {
> - dword_out(entry + 0x1000 * i + 0x200000 * page);
> - dword_out(0);
> - }
> - }
> + gen8_map_range(0, MEMORY_MAP_SIZE);
>
> /* RENDER_RING */
> mem_trace_memory_write_header_out(RENDER_RING_ADDR, RING_SIZE,
> --
> 2.16.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-02-22 0:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-21 23:19 [igt-dev] [PATCH i-g-t 1/6] aubdump: Add gen8_map_range Jordan Justen
2018-02-21 23:19 ` [igt-dev] [PATCH i-g-t 2/6] aubdump: Add bitmap to track gtt pages that have been mapped Jordan Justen
2018-02-22 0:52 ` Scott D Phillips
2018-02-21 23:19 ` [igt-dev] [PATCH i-g-t 3/6] aubdump: For gen10+ support addresses up to 4GB Jordan Justen
2018-02-22 0:58 ` Scott D Phillips
2018-02-22 1:49 ` Jordan Justen
2018-02-21 23:19 ` [igt-dev] [PATCH i-g-t 4/6] aubdump: Support alignment of BO in execbuffer2 Jordan Justen
2018-02-21 23:19 ` [igt-dev] [PATCH i-g-t 5/6] aubdump: Note pinned BO in verbose output Jordan Justen
2018-02-21 23:19 ` [igt-dev] [PATCH i-g-t 6/6] aubdump: Signal drm sync objects when device override is used Jordan Justen
2018-02-22 1:03 ` Scott D Phillips
2018-02-22 1:06 ` Jason Ekstrand
2018-02-22 0:34 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/6] aubdump: Add gen8_map_range Patchwork
2018-02-22 0:43 ` Scott D Phillips [this message]
2018-02-22 5:24 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=87d10x3lc2.fsf@intel.com \
--to=scott.d.phillips@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jordan.l.justen@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