diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_guc.h')
| -rw-r--r-- | drivers/gpu/drm/i915/intel_guc.h | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/intel_guc.h b/drivers/gpu/drm/i915/intel_guc.h index 9d79c4c3e256..4df80cc9a291 100644 --- a/drivers/gpu/drm/i915/intel_guc.h +++ b/drivers/gpu/drm/i915/intel_guc.h | |||
| @@ -48,14 +48,23 @@ struct drm_i915_gem_request; | |||
| 48 | * queue (a circular array of work items), again described in the process | 48 | * queue (a circular array of work items), again described in the process |
| 49 | * descriptor. Work queue pages are mapped momentarily as required. | 49 | * descriptor. Work queue pages are mapped momentarily as required. |
| 50 | * | 50 | * |
| 51 | * Finally, we also keep a few statistics here, including the number of | 51 | * We also keep a few statistics on failures. Ideally, these should all |
| 52 | * submissions to each engine, and a record of the last submission failure | 52 | * be zero! |
| 53 | * (if any). | 53 | * no_wq_space: times that the submission pre-check found no space was |
| 54 | * available in the work queue (note, the queue is shared, | ||
| 55 | * not per-engine). It is OK for this to be nonzero, but | ||
| 56 | * it should not be huge! | ||
| 57 | * q_fail: failed to enqueue a work item. This should never happen, | ||
| 58 | * because we check for space beforehand. | ||
| 59 | * b_fail: failed to ring the doorbell. This should never happen, unless | ||
| 60 | * somehow the hardware misbehaves, or maybe if the GuC firmware | ||
| 61 | * crashes? We probably need to reset the GPU to recover. | ||
| 62 | * retcode: errno from last guc_submit() | ||
| 54 | */ | 63 | */ |
| 55 | struct i915_guc_client { | 64 | struct i915_guc_client { |
| 56 | struct drm_i915_gem_object *client_obj; | 65 | struct drm_i915_gem_object *client_obj; |
| 57 | void *client_base; /* first page (only) of above */ | 66 | void *client_base; /* first page (only) of above */ |
| 58 | struct intel_context *owner; | 67 | struct i915_gem_context *owner; |
| 59 | struct intel_guc *guc; | 68 | struct intel_guc *guc; |
| 60 | uint32_t priority; | 69 | uint32_t priority; |
| 61 | uint32_t ctx_index; | 70 | uint32_t ctx_index; |
| @@ -71,12 +80,13 @@ struct i915_guc_client { | |||
| 71 | uint32_t wq_tail; | 80 | uint32_t wq_tail; |
| 72 | uint32_t unused; /* Was 'wq_head' */ | 81 | uint32_t unused; /* Was 'wq_head' */ |
| 73 | 82 | ||
| 74 | /* GuC submission statistics & status */ | 83 | uint32_t no_wq_space; |
| 75 | uint64_t submissions[GUC_MAX_ENGINES_NUM]; | 84 | uint32_t q_fail; /* No longer used */ |
| 76 | uint32_t q_fail; | ||
| 77 | uint32_t b_fail; | 85 | uint32_t b_fail; |
| 78 | int retcode; | 86 | int retcode; |
| 79 | int spare; /* pad to 32 DWords */ | 87 | |
| 88 | /* Per-engine counts of GuC submissions */ | ||
| 89 | uint64_t submissions[GUC_MAX_ENGINES_NUM]; | ||
| 80 | }; | 90 | }; |
| 81 | 91 | ||
| 82 | enum intel_guc_fw_status { | 92 | enum intel_guc_fw_status { |
| @@ -138,20 +148,19 @@ struct intel_guc { | |||
| 138 | }; | 148 | }; |
| 139 | 149 | ||
| 140 | /* intel_guc_loader.c */ | 150 | /* intel_guc_loader.c */ |
| 141 | extern void intel_guc_ucode_init(struct drm_device *dev); | 151 | extern void intel_guc_init(struct drm_device *dev); |
| 142 | extern int intel_guc_ucode_load(struct drm_device *dev); | 152 | extern int intel_guc_setup(struct drm_device *dev); |
| 143 | extern void intel_guc_ucode_fini(struct drm_device *dev); | 153 | extern void intel_guc_fini(struct drm_device *dev); |
| 144 | extern const char *intel_guc_fw_status_repr(enum intel_guc_fw_status status); | 154 | extern const char *intel_guc_fw_status_repr(enum intel_guc_fw_status status); |
| 145 | extern int intel_guc_suspend(struct drm_device *dev); | 155 | extern int intel_guc_suspend(struct drm_device *dev); |
| 146 | extern int intel_guc_resume(struct drm_device *dev); | 156 | extern int intel_guc_resume(struct drm_device *dev); |
| 147 | 157 | ||
| 148 | /* i915_guc_submission.c */ | 158 | /* i915_guc_submission.c */ |
| 149 | int i915_guc_submission_init(struct drm_device *dev); | 159 | int i915_guc_submission_init(struct drm_i915_private *dev_priv); |
| 150 | int i915_guc_submission_enable(struct drm_device *dev); | 160 | int i915_guc_submission_enable(struct drm_i915_private *dev_priv); |
| 151 | int i915_guc_submit(struct i915_guc_client *client, | 161 | int i915_guc_wq_check_space(struct drm_i915_gem_request *rq); |
| 152 | struct drm_i915_gem_request *rq); | 162 | int i915_guc_submit(struct drm_i915_gem_request *rq); |
| 153 | void i915_guc_submission_disable(struct drm_device *dev); | 163 | void i915_guc_submission_disable(struct drm_i915_private *dev_priv); |
| 154 | void i915_guc_submission_fini(struct drm_device *dev); | 164 | void i915_guc_submission_fini(struct drm_i915_private *dev_priv); |
| 155 | int i915_guc_wq_check_space(struct i915_guc_client *client); | ||
| 156 | 165 | ||
| 157 | #endif | 166 | #endif |
