Commit 065dd5ad authored by Sagar Arun Kamble's avatar Sagar Arun Kamble Committed by Chris Wilson

drm/i915/guc: Update name and prototype of i915_guc_log_control

i915_guc_log_control is GuC interface and GuC APIs that are not user
facing should be named with "intel_guc" prefix hence we change name to
intel_guc_log_control. Also changed the parameter to intel_guc struct.

v2: Move log vma check to intel_guc_log_control (Michal)
    Return -ENODEV when log isn't initialized. (Chris)
Suggested-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: default avatarSagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/1516808821-3638-4-git-send-email-sagar.a.kamble@intel.com
parent 70deeadd
...@@ -2471,10 +2471,7 @@ static int i915_guc_log_control_set(void *data, u64 val) ...@@ -2471,10 +2471,7 @@ static int i915_guc_log_control_set(void *data, u64 val)
if (!HAS_GUC(dev_priv)) if (!HAS_GUC(dev_priv))
return -ENODEV; return -ENODEV;
if (!dev_priv->guc.log.vma) return intel_guc_log_control(&dev_priv->guc, val);
return -EINVAL;
return i915_guc_log_control(dev_priv, val);
} }
DEFINE_SIMPLE_ATTRIBUTE(i915_guc_log_control_fops, DEFINE_SIMPLE_ATTRIBUTE(i915_guc_log_control_fops,
......
...@@ -637,13 +637,16 @@ void intel_guc_log_destroy(struct intel_guc *guc) ...@@ -637,13 +637,16 @@ void intel_guc_log_destroy(struct intel_guc *guc)
i915_vma_unpin_and_release(&guc->log.vma); i915_vma_unpin_and_release(&guc->log.vma);
} }
int i915_guc_log_control(struct drm_i915_private *dev_priv, u64 control_val) int intel_guc_log_control(struct intel_guc *guc, u64 control_val)
{ {
struct intel_guc *guc = &dev_priv->guc; struct drm_i915_private *dev_priv = guc_to_i915(guc);
bool enable_logging = control_val > 0; bool enable_logging = control_val > 0;
u32 verbosity; u32 verbosity;
int ret; int ret;
if (!guc->log.vma)
return -ENODEV;
BUILD_BUG_ON(GUC_LOG_VERBOSITY_MIN); BUILD_BUG_ON(GUC_LOG_VERBOSITY_MIN);
if (control_val > 1 + GUC_LOG_VERBOSITY_MAX) if (control_val > 1 + GUC_LOG_VERBOSITY_MAX)
return -EINVAL; return -EINVAL;
......
...@@ -64,7 +64,7 @@ void intel_guc_log_destroy(struct intel_guc *guc); ...@@ -64,7 +64,7 @@ void intel_guc_log_destroy(struct intel_guc *guc);
void intel_guc_log_init_early(struct intel_guc *guc); void intel_guc_log_init_early(struct intel_guc *guc);
int intel_guc_log_relay_create(struct intel_guc *guc); int intel_guc_log_relay_create(struct intel_guc *guc);
void intel_guc_log_relay_destroy(struct intel_guc *guc); void intel_guc_log_relay_destroy(struct intel_guc *guc);
int i915_guc_log_control(struct drm_i915_private *dev_priv, u64 control_val); int intel_guc_log_control(struct intel_guc *guc, u64 control_val);
void i915_guc_log_register(struct drm_i915_private *dev_priv); void i915_guc_log_register(struct drm_i915_private *dev_priv);
void i915_guc_log_unregister(struct drm_i915_private *dev_priv); void i915_guc_log_unregister(struct drm_i915_private *dev_priv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment