xf86-video-intel: src/sna/kgem.c
Chris Wilson
ickle at kemper.freedesktop.org
Sat Jan 19 17:40:28 PST 2013
src/sna/kgem.c | 39 ++++++++++++++++++++-------------------
1 file changed, 20 insertions(+), 19 deletions(-)
New commits:
commit c9263f192e2f85dd961bc1c4e9ca8180db874517
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Jan 20 01:39:12 2013 +0000
sna: Apply DEBUG_SYNC prior to emitting error report
This is handy for the case where the batch triggers a GPU hang rather
than being rejected by the kernel.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 98f3ec9..89558af 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -2649,6 +2649,26 @@ void _kgem_submit(struct kgem *kgem)
kgem_throttle(kgem);
ret = 0;
}
+
+ if (DEBUG_FLUSH_SYNC && ret == 0) {
+ struct drm_i915_gem_set_domain set_domain;
+
+ DBG(("%s: debug sync, starting\n", __FUNCTION__));
+
+ VG_CLEAR(set_domain);
+ set_domain.handle = handle;
+ set_domain.read_domains = I915_GEM_DOMAIN_GTT;
+ set_domain.write_domain = I915_GEM_DOMAIN_GTT;
+
+ ret = drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain);
+ if (ret == -1) {
+ DBG(("%s: sync: GPU hang detected\n", __FUNCTION__));
+ kgem_throttle(kgem);
+ }
+
+ DBG(("%s: debug sync, completed\n", __FUNCTION__));
+ }
+
#if !NDEBUG
if (ret < 0) {
ret = errno;
@@ -2695,25 +2715,6 @@ void _kgem_submit(struct kgem *kgem)
FatalError("SNA: failed to submit batchbuffer, errno=%d\n", ret);
}
#endif
-
- if (DEBUG_FLUSH_SYNC) {
- struct drm_i915_gem_set_domain set_domain;
-
- DBG(("%s: debug sync, starting\n", __FUNCTION__));
-
- VG_CLEAR(set_domain);
- set_domain.handle = handle;
- set_domain.read_domains = I915_GEM_DOMAIN_GTT;
- set_domain.write_domain = I915_GEM_DOMAIN_GTT;
-
- ret = drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain);
- if (ret == -1) {
- DBG(("%s: sync: GPU hang detected\n", __FUNCTION__));
- kgem_throttle(kgem);
- }
-
- DBG(("%s: debug sync, completed\n", __FUNCTION__));
- }
}
kgem_commit(kgem);
More information about the xorg-commit
mailing list