@@ -1402,6 +1402,24 @@ int intel_guc_resume(struct drm_device *dev)
return host2guc_action(guc, data, ARRAY_SIZE(data));
}
+int i915_guc_log_buffer_force_flush(struct drm_device *dev)
+{
+ struct drm_i915_private *dev_priv = dev->dev_private;
+ struct intel_guc *guc = &dev_priv->guc;
+ u32 data[2];
+ int ret = 0;
+
+ data[0] = HOST2GUC_ACTION_FORCE_LOGBUFFERFLUSH;
+ data[1] = 0;
+
+ if (host2guc_action(guc, data, 2)) {
+ ret = -EINVAL;
+ DRM_ERROR("Failed\n");
+ }
+
+ return ret;
+}
+
void i915_guc_capture_logs(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -2812,6 +2812,9 @@ void i915_handle_error(struct drm_i915_private *dev_priv,
vscnprintf(error_msg, sizeof(error_msg), fmt, args);
va_end(args);
+ flush_work(&dev_priv->guc.events_work);
+ i915_guc_log_buffer_force_flush(dev_priv->dev);
+
i915_capture_error_state(dev_priv, engine_mask, error_msg);
i915_report_and_clear_eir(dev_priv);
@@ -188,6 +188,7 @@ int i915_guc_wq_check_space(struct drm_i915_gem_request *rq);
int i915_guc_submit(struct drm_i915_gem_request *rq);
void i915_guc_submission_disable(struct drm_device *dev);
void i915_guc_submission_fini(struct drm_device *dev);
+int i915_guc_log_buffer_force_flush(struct drm_device *dev);
void i915_guc_capture_logs(struct drm_device *dev);
ssize_t i915_guc_read_logs(struct intel_guc_log_client *log_client,
size_t count, uint32_t f_flags);