From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Subject: Re: [PATCH 3/6] drm/i915: Flush all writes before suspend
Date: Fri, 01 Jun 2018 16:01:01 +0300 [thread overview]
Message-ID: <1527858061.3392.3.camel@linux.intel.com> (raw)
In-Reply-To: <20180601093554.13083-3-chris@chris-wilson.co.uk>
On Fri, 2018-06-01 at 10:35 +0100, Chris Wilson wrote:
> As we have already suspended the device, this should be a no-op except
> for marking that all writes are indeed complete. The downside is that
> we then have to walk all the lists of objects for what should be a no-op
> (in some cases they will be mmio read to ensure the GGTT writes are
> indeed flushed, and clflushes to ensure that cpu writes are in memory).
>
> It seems prudent and the safer course for us to ensure all writes are
> flushed to memory before suspend.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
<SNIP>
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -5066,6 +5066,13 @@ int i915_gem_suspend(struct drm_i915_private *dev_priv)
>
> void i915_gem_suspend_late(struct drm_i915_private *i915)
> {
> + struct drm_i915_gem_object *obj;
> + struct list_head *phases[] = {
> + &i915->mm.unbound_list,
> + &i915->mm.bound_list,
> + NULL
> + }, **p;
I guess the p variable could be on a separate line, and maybe even
"phase".
> +
> /*
> * Neither the BIOS, ourselves or any other kernel
> * expects the system to be in execlists mode on startup,
> @@ -5086,6 +5093,13 @@ void i915_gem_suspend_late(struct drm_i915_private *i915)
> * machine in an unusable condition.
> */
>
> + mutex_lock(&i915->drm.struct_mutex);
> + for (p = phases; *p; p++) {
> + list_for_each_entry(obj, *p, mm.link)
> + WARN_ON(i915_gem_object_set_to_gtt_domain(obj, false));
> + }
> + mutex_unlock(&i915->drm.struct_mutex);
Braces not exactly needed.
Reviewed-by: joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Regards, Joonas
--
Joonas Lahtinen
Open Source Graphics Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-06-01 13:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-01 9:35 [PATCH 1/6] drm/i915/gtt: Avoid calling non-existent allocate_va_range Chris Wilson
2018-06-01 9:35 ` [PATCH 2/6] drm/i915/gtt: Don't restore the non-existent PDE for GGTT Chris Wilson
2018-06-01 12:56 ` Joonas Lahtinen
2018-06-01 13:55 ` Chris Wilson
2018-06-01 9:35 ` [PATCH 3/6] drm/i915: Flush all writes before suspend Chris Wilson
2018-06-01 13:01 ` Joonas Lahtinen [this message]
2018-06-01 9:35 ` [PATCH 4/6] drm/i915: Apply the full CPU domain markup before freezing Chris Wilson
2018-06-01 13:04 ` Joonas Lahtinen
2018-06-01 9:35 ` [PATCH 5/6] drm/i915/gtt: Enable full-ppgtt by default for HSW Chris Wilson
2018-06-01 9:35 ` [PATCH 6/6] drm/i915/gtt: Enable full-ppgtt by default everywhere! Chris Wilson
2018-06-01 10:01 ` ✗ Fi.CI.BAT: failure for series starting with [1/6] drm/i915/gtt: Avoid calling non-existent allocate_va_range Patchwork
2018-06-01 11:37 ` ✗ 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=1527858061.3392.3.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--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