From: Tomas Elf <tomas.elf@intel.com>
To: Intel-GFX@Lists.FreeDesktop.Org
Subject: [RFCv2 10/12] drm/i915: Port of Added scheduler support to __wait_request() calls
Date: Tue, 21 Jul 2015 14:58:53 +0100 [thread overview]
Message-ID: <1437487135-32520-11-git-send-email-tomas.elf@intel.com> (raw)
In-Reply-To: <1437487135-32520-1-git-send-email-tomas.elf@intel.com>
This is a partial port of the following patch from John Harrison's GPU
scheduler patch series: (patch sent to Intel-GFX with the subject line
"[Intel-gfx] [RFC 19/39] drm/i915: Added scheduler support to __wait_request()
calls" on Fri 17 July 2015)
Author: John Harrison <John.C.Harrison@Intel.com>
Date: Thu Apr 10 10:48:55 2014 +0100
Subject: drm/i915: Added scheduler support to __wait_request() calls
Removed all scheduler references and backported it to this baseline. The reason
we need this is because Chris Wilson has pointed out that threads that don't
hold the struct_mutex should not be thrown out of __i915_wait_request during
TDR hang recovery. Therefore we need a way to determine which threads are
holding the mutex and which are not.
Signed-off-by: Tomas Elf <tomas.elf@intel.com>
Signed-off-by: John Harrison <john.c.harrison@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
drivers/gpu/drm/i915/i915_drv.h | 3 ++-
drivers/gpu/drm/i915/i915_gem.c | 11 ++++++-----
drivers/gpu/drm/i915/intel_display.c | 2 +-
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 9f37cba..2cf8b38 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2864,7 +2864,8 @@ int __i915_wait_request(struct drm_i915_gem_request *req,
unsigned reset_counter,
bool interruptible,
s64 *timeout,
- struct drm_i915_file_private *file_priv);
+ struct drm_i915_file_private *file_priv,
+ bool is_locked);
int __must_check i915_wait_request(struct drm_i915_gem_request *req);
int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
int __must_check
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 036735b..340418b 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1233,7 +1233,8 @@ int __i915_wait_request(struct drm_i915_gem_request *req,
unsigned reset_counter,
bool interruptible,
s64 *timeout,
- struct drm_i915_file_private *file_priv)
+ struct drm_i915_file_private *file_priv,
+ bool is_locked)
{
struct intel_engine_cs *ring = i915_gem_request_get_ring(req);
struct drm_device *dev = ring->dev;
@@ -1376,7 +1377,7 @@ i915_wait_request(struct drm_i915_gem_request *req)
reset_counter = atomic_read(&dev_priv->gpu_error.reset_counter);
i915_gem_request_reference(req);
ret = __i915_wait_request(req, reset_counter,
- interruptible, NULL, NULL);
+ interruptible, NULL, NULL, true);
i915_gem_request_unreference(req);
return ret;
}
@@ -1456,7 +1457,7 @@ i915_gem_object_wait_rendering__nonblocking(struct drm_i915_gem_object *obj,
reset_counter = atomic_read(&dev_priv->gpu_error.reset_counter);
i915_gem_request_reference(req);
mutex_unlock(&dev->struct_mutex);
- ret = __i915_wait_request(req, reset_counter, true, NULL, file_priv);
+ ret = __i915_wait_request(req, reset_counter, true, NULL, file_priv, false);
mutex_lock(&dev->struct_mutex);
i915_gem_request_unreference(req);
if (ret)
@@ -2950,7 +2951,7 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
ret = __i915_wait_request(req, reset_counter, true,
args->timeout_ns > 0 ? &args->timeout_ns : NULL,
- file->driver_priv);
+ file->driver_priv, false);
i915_gem_request_unreference__unlocked(req);
return ret;
@@ -4139,7 +4140,7 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file)
if (target == NULL)
return 0;
- ret = __i915_wait_request(target, reset_counter, true, NULL, NULL);
+ ret = __i915_wait_request(target, reset_counter, true, NULL, NULL, false);
if (ret == 0)
queue_delayed_work(dev_priv->wq, &dev_priv->mm.retire_work, 0);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 97922fb..3e1db90 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10358,7 +10358,7 @@ static void intel_mmio_flip_work_func(struct work_struct *work)
if (mmio_flip->req)
WARN_ON(__i915_wait_request(mmio_flip->req,
crtc->reset_counter,
- false, NULL, NULL) != 0);
+ false, NULL, NULL, false) != 0);
intel_do_mmio_flip(crtc);
if (mmio_flip->req) {
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-07-21 14:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-21 13:58 [RFCv2 00/12] TDR/watchdog timeout support for gen8 Tomas Elf
2015-07-21 13:58 ` [RFCv2 01/12] drm/i915: Early exit from semaphore_waits_for for execlist mode Tomas Elf
2015-07-21 13:58 ` [RFCv2 02/12] drm/i915: Make i915_gem_reset_ring_status() public Tomas Elf
2015-07-21 13:58 ` [RFCv2 03/12] drm/i915: Adding TDR / per-engine reset support for gen8 Tomas Elf
2015-07-21 13:58 ` [RFCv2 04/12] drm/i915: Extending i915_gem_check_wedge to check engine reset in progress Tomas Elf
2015-07-21 13:58 ` [RFCv2 05/12] drm/i915: Reinstate hang recovery work queue Tomas Elf
2015-07-21 13:58 ` [RFCv2 06/12] drm/i915: Watchdog timeout support for gen8 Tomas Elf
2015-07-21 13:58 ` [RFCv2 07/12] drm/i915: Fake lost context interrupts through forced CSB check Tomas Elf
2015-07-21 13:58 ` [RFCv2 08/12] drm/i915: Debugfs interface for per-engine hang recovery Tomas Elf
2015-07-21 13:58 ` [RFCv2 09/12] drm/i915: TDR/watchdog trace points Tomas Elf
2015-07-21 13:58 ` Tomas Elf [this message]
2015-07-21 13:58 ` [RFCv2 11/12] drm/i915: Fix __i915_wait_request() behaviour during hang detection Tomas Elf
2015-07-21 13:58 ` [RFCv2 12/12] drm/i915: Extended error state with TDR count, watchdog count and engine reset count Tomas Elf
2015-07-21 14:51 ` [RFCv2 00/12] TDR/watchdog timeout support for gen8 (edit: fixed coverletter) Tomas Elf
2015-07-24 11:13 ` Tomas Elf
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=1437487135-32520-11-git-send-email-tomas.elf@intel.com \
--to=tomas.elf@intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox