]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/guc: Kill USES_GUC macro
authorDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Tue, 18 Feb 2020 22:33:19 +0000 (14:33 -0800)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 20 Feb 2020 17:48:02 +0000 (17:48 +0000)
use intel_uc_uses_guc() directly instead, to be consistent in the way we
check what we want to do with the GuC.

v2: split guc_log_info changes to their own patch (Michal)

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
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/20200218223327.11058-2-daniele.ceraolospurio@intel.com
drivers/gpu/drm/i915/gt/intel_ggtt.c
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_drv.h

index 7dae91e0d00243391f774611d8b9e1b940723c7b..048240b197720af5cc8967498cae37935cc9bebf 100644 (file)
@@ -427,7 +427,7 @@ static int ggtt_reserve_guc_top(struct i915_ggtt *ggtt)
        u64 size;
        int ret;
 
-       if (!USES_GUC(ggtt->vm.i915))
+       if (!intel_uc_uses_guc(&ggtt->vm.gt->uc))
                return 0;
 
        GEM_BUG_ON(ggtt->vm.total <= GUC_GGTT_TOP);
index 4afa5c48994e1962c0acd74a12073594da368c9a..81b3851ddca2ef5ded6280e429f1920547167bc6 100644 (file)
@@ -1558,11 +1558,12 @@ static void i915_guc_log_info(struct seq_file *m, struct intel_guc_log *log)
 static int i915_guc_info(struct seq_file *m, void *data)
 {
        struct drm_i915_private *dev_priv = node_to_i915(m->private);
+       struct intel_uc *uc = &dev_priv->gt.uc;
 
-       if (!USES_GUC(dev_priv))
+       if (!intel_uc_uses_guc(uc))
                return -ENODEV;
 
-       i915_guc_log_info(m, &dev_priv->gt.uc.guc.log);
+       i915_guc_log_info(m, &uc->guc.log);
 
        /* Add more as required ... */
 
@@ -1663,11 +1664,12 @@ static int i915_guc_log_dump(struct seq_file *m, void *data)
 static int i915_guc_log_level_get(void *data, u64 *val)
 {
        struct drm_i915_private *dev_priv = data;
+       struct intel_uc *uc = &dev_priv->gt.uc;
 
-       if (!USES_GUC(dev_priv))
+       if (!intel_uc_uses_guc(uc))
                return -ENODEV;
 
-       *val = intel_guc_log_get_level(&dev_priv->gt.uc.guc.log);
+       *val = intel_guc_log_get_level(&uc->guc.log);
 
        return 0;
 }
@@ -1675,11 +1677,12 @@ static int i915_guc_log_level_get(void *data, u64 *val)
 static int i915_guc_log_level_set(void *data, u64 val)
 {
        struct drm_i915_private *dev_priv = data;
+       struct intel_uc *uc = &dev_priv->gt.uc;
 
-       if (!USES_GUC(dev_priv))
+       if (!intel_uc_uses_guc(uc))
                return -ENODEV;
 
-       return intel_guc_log_set_level(&dev_priv->gt.uc.guc.log, val);
+       return intel_guc_log_set_level(&uc->guc.log, val);
 }
 
 DEFINE_SIMPLE_ATTRIBUTE(i915_guc_log_level_fops,
index 9928d00ea0b179e35b76e799afc712836cf20192..b32668f21e2119c6f7baabdf232f45511dd07b34 100644 (file)
@@ -1693,7 +1693,6 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
 #define HAS_GT_UC(dev_priv)    (INTEL_INFO(dev_priv)->has_gt_uc)
 
 /* Having GuC is not the same as using GuC */
-#define USES_GUC(dev_priv)             intel_uc_uses_guc(&(dev_priv)->gt.uc)
 #define USES_GUC_SUBMISSION(dev_priv)  intel_uc_uses_guc_submission(&(dev_priv)->gt.uc)
 
 #define HAS_POOLED_EU(dev_priv)        (INTEL_INFO(dev_priv)->has_pooled_eu)