diff mbox series

drm/i915/mtl: Apply notify_guc to all GTs

Message ID 20231025102826.16955-1-nirmoy.das@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/mtl: Apply notify_guc to all GTs | expand

Commit Message

Nirmoy Das Oct. 25, 2023, 10:28 a.m. UTC
Handle platforms with multiple GTs by iterate over all GTs.
Add a Fixes commit so this gets propagated for MTL support.

Fixes: 213c43676beb ("drm/i915/mtl: Remove the 'force_probe' requirement for Meteor Lake")
Suggested-by: John Harrison <john.c.harrison@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs_params.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Andi Shyti Oct. 25, 2023, 10:31 a.m. UTC | #1
Hi Nirmoy,

On Wed, Oct 25, 2023 at 12:28:26PM +0200, Nirmoy Das wrote:
> Handle platforms with multiple GTs by iterate over all GTs.
> Add a Fixes commit so this gets propagated for MTL support.
> 
> Fixes: 213c43676beb ("drm/i915/mtl: Remove the 'force_probe' requirement for Meteor Lake")
> Suggested-by: John Harrison <john.c.harrison@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: Andi Shyti <andi.shyti@linux.intel.com>
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>

I wonder when we will manage to add all the for_each_gt's
everywhere they are needed :-)

Thanks for the patch!

Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>

Andi
Andrzej Hajda Oct. 25, 2023, 1:12 p.m. UTC | #2
On 25.10.2023 12:28, Nirmoy Das wrote:
> Handle platforms with multiple GTs by iterate over all GTs.
> Add a Fixes commit so this gets propagated for MTL support.
>
> Fixes: 213c43676beb ("drm/i915/mtl: Remove the 'force_probe' requirement for Meteor Lake")
> Suggested-by: John Harrison <john.c.harrison@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: Andi Shyti <andi.shyti@linux.intel.com>
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_debugfs_params.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs_params.c b/drivers/gpu/drm/i915/i915_debugfs_params.c
> index 614bde321589..8bca02025e09 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs_params.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs_params.c
> @@ -38,10 +38,13 @@ static int i915_param_int_open(struct inode *inode, struct file *file)
>   
>   static int notify_guc(struct drm_i915_private *i915)
>   {
> -	int ret = 0;
> +	struct intel_gt *gt;
> +	int i, ret = 0;
>   
> -	if (intel_uc_uses_guc_submission(&to_gt(i915)->uc))
> -		ret = intel_guc_global_policies_update(&to_gt(i915)->uc.guc);
> +	for_each_gt(gt, i915, i) {
> +		if (intel_uc_uses_guc_submission(&gt->uc))
> +			ret = intel_guc_global_policies_update(&gt->uc.guc);
> +	}

Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

Regards
Andrzej

>   
>   	return ret;
>   }
Nirmoy Das Oct. 31, 2023, 10:57 a.m. UTC | #3
merged to drm-next


Thanks,

Nirmoy

On 10/25/2023 3:12 PM, Andrzej Hajda wrote:
>
>
> On 25.10.2023 12:28, Nirmoy Das wrote:
>> Handle platforms with multiple GTs by iterate over all GTs.
>> Add a Fixes commit so this gets propagated for MTL support.
>>
>> Fixes: 213c43676beb ("drm/i915/mtl: Remove the 'force_probe' 
>> requirement for Meteor Lake")
>> Suggested-by: John Harrison <john.c.harrison@intel.com>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>> Cc: Andi Shyti <andi.shyti@linux.intel.com>
>> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
>> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
>> ---
>>   drivers/gpu/drm/i915/i915_debugfs_params.c | 9 ++++++---
>>   1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_debugfs_params.c 
>> b/drivers/gpu/drm/i915/i915_debugfs_params.c
>> index 614bde321589..8bca02025e09 100644
>> --- a/drivers/gpu/drm/i915/i915_debugfs_params.c
>> +++ b/drivers/gpu/drm/i915/i915_debugfs_params.c
>> @@ -38,10 +38,13 @@ static int i915_param_int_open(struct inode 
>> *inode, struct file *file)
>>     static int notify_guc(struct drm_i915_private *i915)
>>   {
>> -    int ret = 0;
>> +    struct intel_gt *gt;
>> +    int i, ret = 0;
>>   -    if (intel_uc_uses_guc_submission(&to_gt(i915)->uc))
>> -        ret = intel_guc_global_policies_update(&to_gt(i915)->uc.guc);
>> +    for_each_gt(gt, i915, i) {
>> +        if (intel_uc_uses_guc_submission(&gt->uc))
>> +            ret = intel_guc_global_policies_update(&gt->uc.guc);
>> +    }
>
> Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
>
> Regards
> Andrzej
>
>>         return ret;
>>   }
>
Nirmoy Das Oct. 31, 2023, 10:59 a.m. UTC | #4
On 10/31/2023 11:57 AM, Nirmoy Das wrote:
> merged to drm-next

Sorry, drm-intel-next not drm-next.


Regards,

Nirmoy

>
>
> Thanks,
>
> Nirmoy
>
> On 10/25/2023 3:12 PM, Andrzej Hajda wrote:
>>
>>
>> On 25.10.2023 12:28, Nirmoy Das wrote:
>>> Handle platforms with multiple GTs by iterate over all GTs.
>>> Add a Fixes commit so this gets propagated for MTL support.
>>>
>>> Fixes: 213c43676beb ("drm/i915/mtl: Remove the 'force_probe' 
>>> requirement for Meteor Lake")
>>> Suggested-by: John Harrison <john.c.harrison@intel.com>
>>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>>> Cc: Andi Shyti <andi.shyti@linux.intel.com>
>>> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
>>> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
>>> ---
>>>   drivers/gpu/drm/i915/i915_debugfs_params.c | 9 ++++++---
>>>   1 file changed, 6 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/i915_debugfs_params.c 
>>> b/drivers/gpu/drm/i915/i915_debugfs_params.c
>>> index 614bde321589..8bca02025e09 100644
>>> --- a/drivers/gpu/drm/i915/i915_debugfs_params.c
>>> +++ b/drivers/gpu/drm/i915/i915_debugfs_params.c
>>> @@ -38,10 +38,13 @@ static int i915_param_int_open(struct inode 
>>> *inode, struct file *file)
>>>     static int notify_guc(struct drm_i915_private *i915)
>>>   {
>>> -    int ret = 0;
>>> +    struct intel_gt *gt;
>>> +    int i, ret = 0;
>>>   -    if (intel_uc_uses_guc_submission(&to_gt(i915)->uc))
>>> -        ret = intel_guc_global_policies_update(&to_gt(i915)->uc.guc);
>>> +    for_each_gt(gt, i915, i) {
>>> +        if (intel_uc_uses_guc_submission(&gt->uc))
>>> +            ret = intel_guc_global_policies_update(&gt->uc.guc);
>>> +    }
>>
>> Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
>>
>> Regards
>> Andrzej
>>
>>>         return ret;
>>>   }
>>
Jani Nikula Nov. 6, 2023, 12:45 p.m. UTC | #5
On Wed, 25 Oct 2023, Nirmoy Das <nirmoy.das@intel.com> wrote:
> Handle platforms with multiple GTs by iterate over all GTs.
> Add a Fixes commit so this gets propagated for MTL support.
>
> Fixes: 213c43676beb ("drm/i915/mtl: Remove the 'force_probe' requirement for Meteor Lake")

This came up in another patch. I don't like abusing Fixes: like this. I
understand the motivation here, but this patch does not fix the
referenced commit.

BR,
Jani.

> Suggested-by: John Harrison <john.c.harrison@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Cc: Andi Shyti <andi.shyti@linux.intel.com>
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs_params.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs_params.c b/drivers/gpu/drm/i915/i915_debugfs_params.c
> index 614bde321589..8bca02025e09 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs_params.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs_params.c
> @@ -38,10 +38,13 @@ static int i915_param_int_open(struct inode *inode, struct file *file)
>  
>  static int notify_guc(struct drm_i915_private *i915)
>  {
> -	int ret = 0;
> +	struct intel_gt *gt;
> +	int i, ret = 0;
>  
> -	if (intel_uc_uses_guc_submission(&to_gt(i915)->uc))
> -		ret = intel_guc_global_policies_update(&to_gt(i915)->uc.guc);
> +	for_each_gt(gt, i915, i) {
> +		if (intel_uc_uses_guc_submission(&gt->uc))
> +			ret = intel_guc_global_policies_update(&gt->uc.guc);
> +	}
>  
>  	return ret;
>  }
Nirmoy Das Nov. 6, 2023, 12:51 p.m. UTC | #6
On 11/6/2023 1:45 PM, Jani Nikula wrote:
> On Wed, 25 Oct 2023, Nirmoy Das <nirmoy.das@intel.com> wrote:
>> Handle platforms with multiple GTs by iterate over all GTs.
>> Add a Fixes commit so this gets propagated for MTL support.
>>
>> Fixes: 213c43676beb ("drm/i915/mtl: Remove the 'force_probe' requirement for Meteor Lake")
> This came up in another patch. I don't like abusing Fixes: like this. I
> understand the motivation here, but this patch does not fix the
> referenced commit.

I wasn't aware of a better solution but now I have from your response to 
the other patch.

I will keep that in my mind.


Thanks,

Nirmoy


> BR,
> Jani.
>
>> Suggested-by: John Harrison <john.c.harrison@intel.com>
>> Cc: Jani Nikula <jani.nikula@linux.intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>> Cc: Andi Shyti <andi.shyti@linux.intel.com>
>> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
>> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
>> ---
>>   drivers/gpu/drm/i915/i915_debugfs_params.c | 9 ++++++---
>>   1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_debugfs_params.c b/drivers/gpu/drm/i915/i915_debugfs_params.c
>> index 614bde321589..8bca02025e09 100644
>> --- a/drivers/gpu/drm/i915/i915_debugfs_params.c
>> +++ b/drivers/gpu/drm/i915/i915_debugfs_params.c
>> @@ -38,10 +38,13 @@ static int i915_param_int_open(struct inode *inode, struct file *file)
>>   
>>   static int notify_guc(struct drm_i915_private *i915)
>>   {
>> -	int ret = 0;
>> +	struct intel_gt *gt;
>> +	int i, ret = 0;
>>   
>> -	if (intel_uc_uses_guc_submission(&to_gt(i915)->uc))
>> -		ret = intel_guc_global_policies_update(&to_gt(i915)->uc.guc);
>> +	for_each_gt(gt, i915, i) {
>> +		if (intel_uc_uses_guc_submission(&gt->uc))
>> +			ret = intel_guc_global_policies_update(&gt->uc.guc);
>> +	}
>>   
>>   	return ret;
>>   }
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 614bde321589..8bca02025e09 100644
--- a/drivers/gpu/drm/i915/i915_debugfs_params.c
+++ b/drivers/gpu/drm/i915/i915_debugfs_params.c
@@ -38,10 +38,13 @@  static int i915_param_int_open(struct inode *inode, struct file *file)
 
 static int notify_guc(struct drm_i915_private *i915)
 {
-	int ret = 0;
+	struct intel_gt *gt;
+	int i, ret = 0;
 
-	if (intel_uc_uses_guc_submission(&to_gt(i915)->uc))
-		ret = intel_guc_global_policies_update(&to_gt(i915)->uc.guc);
+	for_each_gt(gt, i915, i) {
+		if (intel_uc_uses_guc_submission(&gt->uc))
+			ret = intel_guc_global_policies_update(&gt->uc.guc);
+	}
 
 	return ret;
 }