aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gpu_error.c
diff options
context:
space:
mode:
authorOscar Mateo <oscar.mateo@intel.com>2014-07-24 12:04:43 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-09-03 04:54:28 -0400
commit9075e52face677b87c6bf08d8ea1a960d48d085c (patch)
tree4531ab40bde337f845594370f43ed5570f51ae2b /drivers/gpu/drm/i915/i915_gpu_error.c
parent87a01e822db6e8b6a2898ddc7f116698247c7a4d (diff)
drm/i915/bdw: Make sure error capture keeps working with Execlists
Since the ringbuffer does not belong per engine anymore, we have to make sure that we are always recording the correct ringbuffer. TODO: This is only a small fix to keep basic error capture working, but we need to add more information for it to be useful (e.g. dump the context being executed). v2: Reorder how the ringbuffer is chosen to clarify the change and rename the variable, both changes suggested by Chris Wilson. Also, add the TODO comment to the code, as suggested by Daniel. Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gpu_error.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gpu_error.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 1e05414c6406..22698d44b38d 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -912,9 +912,6 @@ static void i915_record_ring_state(struct drm_device *dev,
912 ering->hws = I915_READ(mmio); 912 ering->hws = I915_READ(mmio);
913 } 913 }
914 914
915 ering->cpu_ring_head = ring->buffer->head;
916 ering->cpu_ring_tail = ring->buffer->tail;
917
918 ering->hangcheck_score = ring->hangcheck.score; 915 ering->hangcheck_score = ring->hangcheck.score;
919 ering->hangcheck_action = ring->hangcheck.action; 916 ering->hangcheck_action = ring->hangcheck.action;
920 917
@@ -977,6 +974,7 @@ static void i915_gem_record_rings(struct drm_device *dev,
977 974
978 for (i = 0; i < I915_NUM_RINGS; i++) { 975 for (i = 0; i < I915_NUM_RINGS; i++) {
979 struct intel_engine_cs *ring = &dev_priv->ring[i]; 976 struct intel_engine_cs *ring = &dev_priv->ring[i];
977 struct intel_ringbuffer *rbuf;
980 978
981 error->ring[i].pid = -1; 979 error->ring[i].pid = -1;
982 980
@@ -1023,8 +1021,24 @@ static void i915_gem_record_rings(struct drm_device *dev,
1023 } 1021 }
1024 } 1022 }
1025 1023
1024 if (i915.enable_execlists) {
1025 /* TODO: This is only a small fix to keep basic error
1026 * capture working, but we need to add more information
1027 * for it to be useful (e.g. dump the context being
1028 * executed).
1029 */
1030 if (request)
1031 rbuf = request->ctx->engine[ring->id].ringbuf;
1032 else
1033 rbuf = ring->default_context->engine[ring->id].ringbuf;
1034 } else
1035 rbuf = ring->buffer;
1036
1037 error->ring[i].cpu_ring_head = rbuf->head;
1038 error->ring[i].cpu_ring_tail = rbuf->tail;
1039
1026 error->ring[i].ringbuffer = 1040 error->ring[i].ringbuffer =
1027 i915_error_ggtt_object_create(dev_priv, ring->buffer->obj); 1041 i915_error_ggtt_object_create(dev_priv, rbuf->obj);
1028 1042
1029 error->ring[i].hws_page = 1043 error->ring[i].hws_page =
1030 i915_error_ggtt_object_create(dev_priv, ring->status_page.obj); 1044 i915_error_ggtt_object_create(dev_priv, ring->status_page.obj);