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

v2: do not go through ctx->vm->gt, use i915->gt instead

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> #v1
Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20200218223327.11058-3-daniele.ceraolospurio@intel.com
drivers/gpu/drm/i915/gem/i915_gem_context.c
drivers/gpu/drm/i915/gt/selftest_hangcheck.c
drivers/gpu/drm/i915/gt/selftest_lrc.c
drivers/gpu/drm/i915/gt/selftest_reset.c
drivers/gpu/drm/i915/gvt/scheduler.c
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_gvt.c

index 3e82739bdbc045a1a6069c1439f3190d4374331b..adcebf22a3d3f91a3d1198e88cf39b0b6a28fae7 100644 (file)
@@ -1390,7 +1390,7 @@ set_engines__load_balance(struct i915_user_extension __user *base, void *data)
        if (!HAS_EXECLISTS(i915))
                return -ENODEV;
 
-       if (USES_GUC_SUBMISSION(i915))
+       if (intel_uc_uses_guc_submission(&i915->gt.uc))
                return -ENODEV; /* not implement yet */
 
        if (get_user(idx, &ext->engine_index))
index 3e5e6c86e84370c138f1133a19e1f87f830ca802..c3514ec7b8db54af86aeeeed0db036723cc4a21c 100644 (file)
@@ -1640,7 +1640,7 @@ static int igt_reset_engines_atomic(void *arg)
        if (!intel_has_reset_engine(gt))
                return 0;
 
-       if (USES_GUC_SUBMISSION(gt->i915))
+       if (intel_uc_uses_guc_submission(&gt->uc))
                return 0;
 
        igt_global_reset_lock(gt);
index 49b93cda04ca6fa9051cfc090e2bf6db42e35f61..febd608c23a7fe03abe987a6468bf75a6a52cb1e 100644 (file)
@@ -2109,7 +2109,7 @@ static int live_suppress_self_preempt(void *arg)
        if (!HAS_LOGICAL_RING_PREEMPTION(gt->i915))
                return 0;
 
-       if (USES_GUC_SUBMISSION(gt->i915))
+       if (intel_uc_uses_guc_submission(&gt->uc))
                return 0; /* presume black blox */
 
        if (intel_vgpu_active(gt->i915))
@@ -3224,7 +3224,7 @@ static int live_virtual_engine(void *arg)
        unsigned int class, inst;
        int err;
 
-       if (USES_GUC_SUBMISSION(gt->i915))
+       if (intel_uc_uses_guc_submission(&gt->uc))
                return 0;
 
        for_each_engine(engine, gt, id) {
@@ -3357,7 +3357,7 @@ static int live_virtual_mask(void *arg)
        unsigned int class, inst;
        int err;
 
-       if (USES_GUC_SUBMISSION(gt->i915))
+       if (intel_uc_uses_guc_submission(&gt->uc))
                return 0;
 
        for (class = 0; class <= MAX_ENGINE_CLASS; class++) {
@@ -3499,7 +3499,7 @@ static int live_virtual_preserved(void *arg)
         * are preserved.
         */
 
-       if (USES_GUC_SUBMISSION(gt->i915))
+       if (intel_uc_uses_guc_submission(&gt->uc))
                return 0;
 
        /* As we use CS_GPR we cannot run before they existed on all engines. */
@@ -3729,7 +3729,7 @@ static int live_virtual_bond(void *arg)
        unsigned int class, inst;
        int err;
 
-       if (USES_GUC_SUBMISSION(gt->i915))
+       if (intel_uc_uses_guc_submission(&gt->uc))
                return 0;
 
        for (class = 0; class <= MAX_ENGINE_CLASS; class++) {
@@ -3890,7 +3890,7 @@ static int live_virtual_reset(void *arg)
         * forgotten.
         */
 
-       if (USES_GUC_SUBMISSION(gt->i915))
+       if (intel_uc_uses_guc_submission(&gt->uc))
                return 0;
 
        if (!intel_has_reset_engine(gt))
index 6ad6aca315f6c6e00b103ca9957812dc760adeed..35406ecdf0b2a9bd61b53f96e6fbd0b657b40a6c 100644 (file)
@@ -115,7 +115,7 @@ static int igt_atomic_engine_reset(void *arg)
        if (!intel_has_reset_engine(gt))
                return 0;
 
-       if (USES_GUC_SUBMISSION(gt->i915))
+       if (intel_uc_uses_guc_submission(&gt->uc))
                return 0;
 
        intel_gt_pm_get(gt);
index 685d1e04a5ff6ee9b82cd11cd6c74b8a215c9270..5fe00ee6bd1b3e52cdec87b44fb5f6396c2874cd 100644 (file)
@@ -1246,7 +1246,8 @@ int intel_vgpu_setup_submission(struct intel_vgpu *vgpu)
                ce->vm = i915_vm_get(&ppgtt->vm);
                intel_context_set_single_submission(ce);
 
-               if (!USES_GUC_SUBMISSION(i915)) { /* Max ring buffer size */
+               /* Max ring buffer size */
+               if (!intel_uc_uses_guc_submission(&engine->gt->uc)) {
                        const unsigned int ring_size = 512 * SZ_4K;
 
                        ce->ring = __intel_context_ring_size(ring_size);
index 81b3851ddca2ef5ded6280e429f1920547167bc6..8f2525e4ce0fab3532242ab6813e276afab4d683 100644 (file)
@@ -1573,11 +1573,11 @@ static int i915_guc_info(struct seq_file *m, void *data)
 static int i915_guc_stage_pool(struct seq_file *m, void *data)
 {
        struct drm_i915_private *dev_priv = node_to_i915(m->private);
-       const struct intel_guc *guc = &dev_priv->gt.uc.guc;
-       struct guc_stage_desc *desc = guc->stage_desc_pool_vaddr;
+       struct intel_uc *uc = &dev_priv->gt.uc;
+       struct guc_stage_desc *desc = uc->guc.stage_desc_pool_vaddr;
        int index;
 
-       if (!USES_GUC_SUBMISSION(dev_priv))
+       if (!intel_uc_uses_guc_submission(uc))
                return -ENODEV;
 
        for (index = 0; index < GUC_MAX_STAGE_DESCRIPTORS; index++, desc++) {
index b32668f21e2119c6f7baabdf232f45511dd07b34..be1a56acc732bf62d02ec781d92c1de536e9c5de 100644 (file)
@@ -1692,9 +1692,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_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)
 
 #define HAS_GLOBAL_MOCS_REGISTERS(dev_priv)    (INTEL_INFO(dev_priv)->has_global_mocs)
index 38ebd5562c7cb332d1386ed5db5e5ec0c6fd1713..5c189bc31da51768ad29f972e54f48f212b89dbf 100644 (file)
@@ -105,7 +105,7 @@ int intel_gvt_init(struct drm_i915_private *dev_priv)
                return 0;
        }
 
-       if (USES_GUC_SUBMISSION(dev_priv)) {
+       if (intel_uc_uses_guc_submission(&dev_priv->gt.uc)) {
                drm_err(&dev_priv->drm,
                        "i915 GVT-g loading failed due to Graphics virtualization is not yet supported with GuC submission\n");
                return -EIO;