diff mbox series

[v3,3/4] drm/i915: Use the new gt_to_guc() wrapper

Message ID 20231206204644.105064-4-andi.shyti@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Add gt_to_guc() helper | expand

Commit Message

Andi Shyti Dec. 6, 2023, 8:46 p.m. UTC
Get the guc reference from the gt using the gt_to_guc() helper.

Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs_params.c               | 2 +-
 drivers/gpu/drm/i915/selftests/intel_scheduler_helpers.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Nirmoy Das Dec. 21, 2023, 9:21 a.m. UTC | #1
On 12/6/2023 9:46 PM, Andi Shyti wrote:
> Get the guc reference from the gt using the gt_to_guc() helper.
>
> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_debugfs_params.c               | 2 +-
>   drivers/gpu/drm/i915/selftests/intel_scheduler_helpers.c | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs_params.c b/drivers/gpu/drm/i915/i915_debugfs_params.c
> index 8bca02025e09..74b7f2fd8b57 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs_params.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs_params.c
> @@ -43,7 +43,7 @@ static int notify_guc(struct drm_i915_private *i915)
>   
>   	for_each_gt(gt, i915, i) {
>   		if (intel_uc_uses_guc_submission(&gt->uc))
> -			ret = intel_guc_global_policies_update(&gt->uc.guc);
> +			ret = intel_guc_global_policies_update(gt_to_guc(gt));
>   	}
>   
>   	return ret;
> diff --git a/drivers/gpu/drm/i915/selftests/intel_scheduler_helpers.c b/drivers/gpu/drm/i915/selftests/intel_scheduler_helpers.c
> index 2990dd4d4a0d..d9d8f0336702 100644
> --- a/drivers/gpu/drm/i915/selftests/intel_scheduler_helpers.c
> +++ b/drivers/gpu/drm/i915/selftests/intel_scheduler_helpers.c
> @@ -65,7 +65,7 @@ int intel_selftest_modify_policy(struct intel_engine_cs *engine,
>   	if (!intel_engine_uses_guc(engine))
>   		return 0;
>   
> -	err = intel_guc_global_policies_update(&engine->gt->uc.guc);
> +	err = intel_guc_global_policies_update(gt_to_guc(engine->gt));
>   	if (err)
>   		intel_selftest_restore_policy(engine, saved);
>   
> @@ -84,7 +84,7 @@ int intel_selftest_restore_policy(struct intel_engine_cs *engine,
>   	if (!intel_engine_uses_guc(engine))
>   		return 0;
>   
> -	return intel_guc_global_policies_update(&engine->gt->uc.guc);
> +	return intel_guc_global_policies_update(gt_to_guc(engine->gt));
>   }
>   
>   int intel_selftest_wait_for_rq(struct i915_request *rq)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs_params.c b/drivers/gpu/drm/i915/i915_debugfs_params.c
index 8bca02025e09..74b7f2fd8b57 100644
--- a/drivers/gpu/drm/i915/i915_debugfs_params.c
+++ b/drivers/gpu/drm/i915/i915_debugfs_params.c
@@ -43,7 +43,7 @@  static int notify_guc(struct drm_i915_private *i915)
 
 	for_each_gt(gt, i915, i) {
 		if (intel_uc_uses_guc_submission(&gt->uc))
-			ret = intel_guc_global_policies_update(&gt->uc.guc);
+			ret = intel_guc_global_policies_update(gt_to_guc(gt));
 	}
 
 	return ret;
diff --git a/drivers/gpu/drm/i915/selftests/intel_scheduler_helpers.c b/drivers/gpu/drm/i915/selftests/intel_scheduler_helpers.c
index 2990dd4d4a0d..d9d8f0336702 100644
--- a/drivers/gpu/drm/i915/selftests/intel_scheduler_helpers.c
+++ b/drivers/gpu/drm/i915/selftests/intel_scheduler_helpers.c
@@ -65,7 +65,7 @@  int intel_selftest_modify_policy(struct intel_engine_cs *engine,
 	if (!intel_engine_uses_guc(engine))
 		return 0;
 
-	err = intel_guc_global_policies_update(&engine->gt->uc.guc);
+	err = intel_guc_global_policies_update(gt_to_guc(engine->gt));
 	if (err)
 		intel_selftest_restore_policy(engine, saved);
 
@@ -84,7 +84,7 @@  int intel_selftest_restore_policy(struct intel_engine_cs *engine,
 	if (!intel_engine_uses_guc(engine))
 		return 0;
 
-	return intel_guc_global_policies_update(&engine->gt->uc.guc);
+	return intel_guc_global_policies_update(gt_to_guc(engine->gt));
 }
 
 int intel_selftest_wait_for_rq(struct i915_request *rq)