From: Tom O'Rourke <Tom.O'Rourke@xxxxxxxxx> Expose host2guc_action for use by SLPC in intel_slpc.c. Expose functions to allocate and release objects used by GuC to be used for SLPC shared memory object. v1: Updated function names as they need to be made extern. (ChrisW) v2-v4: Rebase v5: Commit subject update. Signed-off-by: Tom O'Rourke <Tom.O'Rourke@xxxxxxxxx> Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@xxxxxxxxx> --- drivers/gpu/drm/i915/i915_guc_submission.c | 22 +++++++++++----------- drivers/gpu/drm/i915/intel_guc.h | 2 ++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c index 666dab7..c171f1f 100644 --- a/drivers/gpu/drm/i915/i915_guc_submission.c +++ b/drivers/gpu/drm/i915/i915_guc_submission.c @@ -49,7 +49,7 @@ * Firmware writes a success/fail code back to the action register after * processes the request. The kernel driver polls waiting for this update and * then proceeds. - * See host2guc_action() + * See i915_guc_action() * * Doorbells: * Doorbells are interrupts to uKernel. A doorbell is a single cache line (QW) @@ -77,7 +77,7 @@ static inline bool host2guc_action_response(struct drm_i915_private *dev_priv, return GUC2HOST_IS_RESPONSE(val); } -static int host2guc_action(struct intel_guc *guc, u32 *data, u32 len) +int i915_guc_action(struct intel_guc *guc, u32 *data, u32 len) { struct drm_i915_private *dev_priv = guc_to_i915(guc); u32 status; @@ -143,7 +143,7 @@ static int host2guc_allocate_doorbell(struct intel_guc *guc, data[0] = HOST2GUC_ACTION_ALLOCATE_DOORBELL; data[1] = client->ctx_index; - return host2guc_action(guc, data, 2); + return i915_guc_action(guc, data, 2); } static int host2guc_release_doorbell(struct intel_guc *guc, @@ -154,7 +154,7 @@ static int host2guc_release_doorbell(struct intel_guc *guc, data[0] = HOST2GUC_ACTION_DEALLOCATE_DOORBELL; data[1] = client->ctx_index; - return host2guc_action(guc, data, 2); + return i915_guc_action(guc, data, 2); } static int host2guc_sample_forcewake(struct intel_guc *guc, @@ -171,7 +171,7 @@ static int host2guc_sample_forcewake(struct intel_guc *guc, /* bit 0 and 1 are for Render and Media domain separately */ data[1] = GUC_FORCEWAKE_RENDER | GUC_FORCEWAKE_MEDIA; - return host2guc_action(guc, data, ARRAY_SIZE(data)); + return i915_guc_action(guc, data, ARRAY_SIZE(data)); } static int host2guc_logbuffer_flush_complete(struct intel_guc *guc) @@ -180,7 +180,7 @@ static int host2guc_logbuffer_flush_complete(struct intel_guc *guc) data[0] = HOST2GUC_ACTION_LOG_BUFFER_FILE_FLUSH_COMPLETE; - return host2guc_action(guc, data, 1); + return i915_guc_action(guc, data, 1); } static int host2guc_force_logbuffer_flush(struct intel_guc *guc) @@ -190,7 +190,7 @@ static int host2guc_force_logbuffer_flush(struct intel_guc *guc) data[0] = HOST2GUC_ACTION_FORCE_LOG_BUFFER_FLUSH; data[1] = 0; - return host2guc_action(guc, data, 2); + return i915_guc_action(guc, data, 2); } static int host2guc_logging_control(struct intel_guc *guc, u32 control_val) @@ -200,7 +200,7 @@ static int host2guc_logging_control(struct intel_guc *guc, u32 control_val) data[0] = HOST2GUC_ACTION_UK_LOG_ENABLE_LOGGING; data[1] = control_val; - return host2guc_action(guc, data, 2); + return i915_guc_action(guc, data, 2); } /* @@ -672,7 +672,7 @@ static void i915_guc_submit(struct drm_i915_gem_request *rq) * * Return: A i915_vma if successful, otherwise an ERR_PTR. */ -static struct i915_vma *guc_allocate_vma(struct intel_guc *guc, u32 size) +struct i915_vma *guc_allocate_vma(struct intel_guc *guc, u32 size) { struct drm_i915_private *dev_priv = guc_to_i915(guc); struct drm_i915_gem_object *obj; @@ -1583,7 +1583,7 @@ int intel_guc_suspend(struct drm_device *dev) /* first page is shared data with GuC */ data[2] = i915_ggtt_offset(ctx->engine[RCS].state); - return host2guc_action(guc, data, ARRAY_SIZE(data)); + return i915_guc_action(guc, data, ARRAY_SIZE(data)); } @@ -1611,7 +1611,7 @@ int intel_guc_resume(struct drm_device *dev) /* first page is shared data with GuC */ data[2] = i915_ggtt_offset(ctx->engine[RCS].state); - return host2guc_action(guc, data, ARRAY_SIZE(data)); + return i915_guc_action(guc, data, ARRAY_SIZE(data)); } void i915_guc_capture_logs(struct drm_i915_private *dev_priv) diff --git a/drivers/gpu/drm/i915/intel_guc.h b/drivers/gpu/drm/i915/intel_guc.h index 0053258..dad4a23 100644 --- a/drivers/gpu/drm/i915/intel_guc.h +++ b/drivers/gpu/drm/i915/intel_guc.h @@ -189,5 +189,7 @@ struct intel_guc { void i915_guc_register(struct drm_i915_private *dev_priv); void i915_guc_unregister(struct drm_i915_private *dev_priv); int i915_guc_log_control(struct drm_i915_private *dev_priv, u64 control_val); +int i915_guc_action(struct intel_guc *guc, u32 *data, u32 len); +struct i915_vma *guc_allocate_vma(struct intel_guc *guc, u32 size); #endif -- 1.9.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx