drm/i915/guc: Update name and prototype of i915_guc_log_control
authorSagar Arun Kamble <sagar.a.kamble@intel.com>
Wed, 24 Jan 2018 15:46:59 +0000 (21:16 +0530)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 24 Jan 2018 19:44:06 +0000 (19:44 +0000)
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: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/1516808821-3638-4-git-send-email-sagar.a.kamble@intel.com
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/intel_guc_log.c
drivers/gpu/drm/i915/intel_guc_log.h

index d3def0ef63bd564a0dcda6d34ebe68c98f6ef482..3849ded354e3337ae5146ac347388b5230b062bc 100644 (file)
@@ -2471,10 +2471,7 @@ static int i915_guc_log_control_set(void *data, u64 val)
        if (!HAS_GUC(dev_priv))
                return -ENODEV;
 
-       if (!dev_priv->guc.log.vma)
-               return -EINVAL;
-
-       return i915_guc_log_control(dev_priv, val);
+       return intel_guc_log_control(&dev_priv->guc, val);
 }
 
 DEFINE_SIMPLE_ATTRIBUTE(i915_guc_log_control_fops,
index d10ec53f92907d078b4aeb546b531df61a18d318..cb10f7aeb04250898e6737bdceb5d657f28096bf 100644 (file)
@@ -637,13 +637,16 @@ void intel_guc_log_destroy(struct intel_guc *guc)
        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;
        u32 verbosity;
        int ret;
 
+       if (!guc->log.vma)
+               return -ENODEV;
+
        BUILD_BUG_ON(GUC_LOG_VERBOSITY_MIN);
        if (control_val > 1 + GUC_LOG_VERBOSITY_MAX)
                return -EINVAL;
index c638b9d76d04bdd5423a60220b078988f9963deb..dab0e949567a3821c298d166931493f3ee014f55 100644 (file)
@@ -64,7 +64,7 @@ void intel_guc_log_destroy(struct intel_guc *guc);
 void intel_guc_log_init_early(struct intel_guc *guc);
 int intel_guc_log_relay_create(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_unregister(struct drm_i915_private *dev_priv);