summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_guc.h
diff options
context:
space:
mode:
authorDave Gordon2016-05-13 16:36:33 +0200
committerTvrtko Ursulin2016-05-23 15:21:53 +0200
commit551aaecd8873b728a85c1fcb2b8ca502e9ffc49c (patch)
tree2f9890e8f01bd619da27eecb7a7be23b658f823c /drivers/gpu/drm/i915/intel_guc.h
parentdrm/i915/guc: pass request (not client) to i915_guc_{wq_check_space, submit}() (diff)
downloadkernel-qcow2-linux-551aaecd8873b728a85c1fcb2b8ca502e9ffc49c.tar.gz
kernel-qcow2-linux-551aaecd8873b728a85c1fcb2b8ca502e9ffc49c.tar.xz
kernel-qcow2-linux-551aaecd8873b728a85c1fcb2b8ca502e9ffc49c.zip
drm/i915/guc: don't spinwait if the GuC's workqueue is full
Rather than wait to see whether more space becomes available in the GuC submission workqueue, we can just return -EAGAIN and let the caller try again in a little while. This gets rid of an uninterruptable sleep in the polling code :) We'll also add a counter to the GuC client statistics, to see how often we find the WQ full. v2: Flag the likely() code path (Tvtrko Ursulin). v4: Add/update comments about failure counters (Tvtrko Ursulin). Signed-off-by: Dave Gordon <david.s.gordon@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_guc.h')
-rw-r--r--drivers/gpu/drm/i915/intel_guc.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_guc.h b/drivers/gpu/drm/i915/intel_guc.h
index 91f315cf073b..380a743f830f 100644
--- a/drivers/gpu/drm/i915/intel_guc.h
+++ b/drivers/gpu/drm/i915/intel_guc.h
@@ -48,9 +48,18 @@ struct drm_i915_gem_request;
* queue (a circular array of work items), again described in the process
* descriptor. Work queue pages are mapped momentarily as required.
*
- * Finally, we also keep a few statistics here, including the number of
- * submissions to each engine, and a record of the last submission failure
- * (if any).
+ * We also keep a few statistics on failures. Ideally, these should all
+ * be zero!
+ * no_wq_space: times that the submission pre-check found no space was
+ * available in the work queue (note, the queue is shared,
+ * not per-engine). It is OK for this to be nonzero, but
+ * it should not be huge!
+ * q_fail: failed to enqueue a work item. This should never happen,
+ * because we check for space beforehand.
+ * b_fail: failed to ring the doorbell. This should never happen, unless
+ * somehow the hardware misbehaves, or maybe if the GuC firmware
+ * crashes? We probably need to reset the GPU to recover.
+ * retcode: errno from last guc_submit()
*/
struct i915_guc_client {
struct drm_i915_gem_object *client_obj;
@@ -71,12 +80,13 @@ struct i915_guc_client {
uint32_t wq_tail;
uint32_t unused; /* Was 'wq_head' */
- /* GuC submission statistics & status */
- uint64_t submissions[GUC_MAX_ENGINES_NUM];
+ uint32_t no_wq_space;
uint32_t q_fail;
uint32_t b_fail;
int retcode;
- int spare; /* pad to 32 DWords */
+
+ /* Per-engine counts of GuC submissions */
+ uint64_t submissions[GUC_MAX_ENGINES_NUM];
};
enum intel_guc_fw_status {