From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2] drm/i915/cmdparser: Limit clflush to active cachelines
Date: Fri, 10 Mar 2017 13:19:01 +0200 [thread overview]
Message-ID: <87pohp2xcq.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20170310104639.30060-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> We only need to clflush those cachelines that we have validated to be
> read by the GPU. Userspace typically fills the batch length in
> correctly, the exceptions tend to be explicit tests within igt.
>
> v2: Use ptr_mask_bits() to make Mika happy
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_cmd_parser.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_cmd_parser.c b/drivers/gpu/drm/i915/i915_cmd_parser.c
> index 21b1cd917d81..787980d52272 100644
> --- a/drivers/gpu/drm/i915/i915_cmd_parser.c
> +++ b/drivers/gpu/drm/i915/i915_cmd_parser.c
> @@ -1330,8 +1330,10 @@ int intel_engine_cmd_parser(struct intel_engine_cs *engine,
> ret = -EINVAL;
> }
>
> - if (ret == 0 && needs_clflush_after)
> - drm_clflush_virt_range(shadow_batch_obj->mm.mapping, batch_len);
> + if (ret == 0 && needs_clflush_after) {
> + void *ptr = ptr_mask_bits(shadow_batch_obj->mm.mapping);
> + drm_clflush_virt_range(ptr, (void *)cmd - ptr);
Your ptr is page aligned, and the cmd is pointing to a BATCH_BUFFER_END
right at the next cacheline boundary. Apparently in this case you would
get flush only to the previous cacheline and not the one containg the
BB_END?
-Mika
> + }
> i915_gem_object_unpin_map(shadow_batch_obj);
>
> return ret;
> --
> 2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-03-10 11:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-10 9:42 [PATCH] drm/i915/cmdparser: Limit clflush to active cachelines Chris Wilson
2017-03-10 9:58 ` Mika Kuoppala
2017-03-10 10:04 ` Chris Wilson
2017-03-10 10:19 ` Chris Wilson
2017-03-10 10:26 ` Mika Kuoppala
2017-03-10 10:39 ` Chris Wilson
2017-03-10 10:42 ` Mika Kuoppala
2017-03-10 10:50 ` Chris Wilson
2017-03-10 10:46 ` [PATCH v2] " Chris Wilson
2017-03-10 11:19 ` Mika Kuoppala [this message]
2017-03-10 11:39 ` Chris Wilson
2017-03-10 11:55 ` [PATCH v3] " Chris Wilson
2017-03-10 12:41 ` Mika Kuoppala
2017-03-10 13:19 ` Chris Wilson
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=87pohp2xcq.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.