From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: "Michał Winiarski" <michal.winiarski@intel.com>,
intel-gfx@lists.freedesktop.org
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Subject: Re: [PATCH 1/3] drm/i915/gtt: Split gen8_ppgtt_clear_pte_range
Date: Wed, 05 Oct 2016 08:44:06 +0300 [thread overview]
Message-ID: <1475646246.3331.7.camel@linux.intel.com> (raw)
In-Reply-To: <1475589267-12440-1-git-send-email-michal.winiarski@intel.com>
I wonder if GCC is doing the right thing, do we have some benchmark for
this, Chris, Mika? The code is much more readable in my eyes after the
changes.
On ti, 2016-10-04 at 15:54 +0200, Michał Winiarski wrote:
> +static void gen8_ppgtt_clear_pt(struct i915_address_space *vm,
> + struct i915_page_table *pt,
> + uint64_t start,
> + uint64_t length,
> + bool use_scratch)
> {
> struct i915_hw_ppgtt *ppgtt = i915_vm_to_ppgtt(vm);
> +
> + unsigned int pte_start = gen8_pte_index(start);
> + unsigned int num_entries = min(gen8_pte_count(start, length),
> + GEN8_PTES);
i915_pte_count (called by gen8_pte_count) states following;
"the max value would be GEN6_PTES for GEN6, and GEN8_PTES for GEN8."
GEM_BUG_ON(num_entries > GEN8_PTES); would be the standard recipe for
paranoia. But I don't think it's needed here.
> + uint64_t pte;
> +
No newlines to the variable block, keep it tight.
> @@ -768,21 +793,13 @@ static void gen8_ppgtt_clear_range(struct i915_address_space *vm,
> bool use_scratch)
> {
> struct i915_hw_ppgtt *ppgtt = i915_vm_to_ppgtt(vm);
> - gen8_pte_t scratch_pte = gen8_pte_encode(vm->scratch_page.daddr,
> - I915_CACHE_LLC, use_scratch);
>
> - if (!USES_FULL_48BIT_PPGTT(vm->dev)) {
> - gen8_ppgtt_clear_pte_range(vm, &ppgtt->pdp, start, length,
> - scratch_pte);
> - } else {
> - uint64_t pml4e;
> - struct i915_page_directory_pointer *pdp;
> -
> - gen8_for_each_pml4e(pdp, &ppgtt->pml4, start, length, pml4e) {
> - gen8_ppgtt_clear_pte_range(vm, pdp, start, length,
> - scratch_pte);
> - }
> - }
> + if (!USES_FULL_48BIT_PPGTT(vm->dev))
Now that this is so much simplified, the negation could be removed, and
just just write if (USES_FULL_...)
Other than above, looks good to me.
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2016-10-05 5:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-04 13:54 [PATCH 1/3] drm/i915/gtt: Split gen8_ppgtt_clear_pte_range Michał Winiarski
2016-10-04 13:54 ` [PATCH 2/3] drm/i915/gtt: Free unused lower-level page tables Michał Winiarski
2016-10-05 6:40 ` Joonas Lahtinen
2016-10-05 9:30 ` Chris Wilson
2016-10-04 13:54 ` [PATCH 3/3] drm/i915: Remove unused "valid" parameter from pte_encode Michał Winiarski
2016-10-05 5:48 ` Joonas Lahtinen
2016-10-05 8:49 ` Mika Kuoppala
2016-10-04 14:26 ` ✗ Fi.CI.BAT: failure for series starting with [1/3] drm/i915/gtt: Split gen8_ppgtt_clear_pte_range Patchwork
2016-10-05 5:44 ` Joonas Lahtinen [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=1475646246.3331.7.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=michal.winiarski@intel.com \
--cc=mika.kuoppala@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