[PATCH] drm/amd/display: Fix set scaling doesn's work

hongao posted 1 patch 3 years, 4 months ago
[PATCH] drm/amd/display: Fix set scaling doesn's work
Posted by hongao 3 years, 4 months ago
[Why]
Setting scaling does not correctly update CRTC state. As a result
dc stream state's src (composition area) && dest (addressable area)
was not calculated as expected. This causes set scaling doesn's work.

[How]
Correctly update CRTC state when setting scaling property.

Signed-off-by: hongao <hongao@uniontech.com>

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 3e1ecca72430..a88a6f758748 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -9386,8 +9386,8 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
 			goto fail;
 		}
 
-		if (dm_old_con_state->abm_level !=
-		    dm_new_con_state->abm_level)
+		if (dm_old_con_state->abm_level != dm_new_con_state->abm_level ||
+		    dm_old_con_state->scaling != dm_new_con_state->scaling)
 			new_crtc_state->connectors_changed = true;
 	}
 
-- 
2.20.1
Re: [PATCH] drm/amd/display: Fix set scaling doesn's work
Posted by Rodrigo Siqueira Jordao 3 years, 3 months ago

On 11/22/22 06:20, hongao wrote:
> [Why]
> Setting scaling does not correctly update CRTC state. As a result
> dc stream state's src (composition area) && dest (addressable area)
> was not calculated as expected. This causes set scaling doesn's work.
> 
> [How]
> Correctly update CRTC state when setting scaling property.
> 
> Signed-off-by: hongao <hongao@uniontech.com>
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 3e1ecca72430..a88a6f758748 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -9386,8 +9386,8 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
>   			goto fail;
>   		}
>   
> -		if (dm_old_con_state->abm_level !=
> -		    dm_new_con_state->abm_level)
> +		if (dm_old_con_state->abm_level != dm_new_con_state->abm_level ||
> +		    dm_old_con_state->scaling != dm_new_con_state->scaling)
>   			new_crtc_state->connectors_changed = true;
>   	}
>   

Hi,

This change lgtm, and I also run it in our CI, and from IGT perspective, 
we are good.

Harry, do you have any comment about this change?

Thanks
Siqueira
Re: [PATCH] drm/amd/display: Fix set scaling doesn's work
Posted by Harry Wentland 3 years, 3 months ago
On 1/10/23 10:58, Rodrigo Siqueira Jordao wrote:
> 
> 
> On 11/22/22 06:20, hongao wrote:
>> [Why]
>> Setting scaling does not correctly update CRTC state. As a result
>> dc stream state's src (composition area) && dest (addressable area)
>> was not calculated as expected. This causes set scaling doesn's work.
>>
>> [How]
>> Correctly update CRTC state when setting scaling property.
>>
>> Signed-off-by: hongao <hongao@uniontech.com>
>>
>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> index 3e1ecca72430..a88a6f758748 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> @@ -9386,8 +9386,8 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
>>               goto fail;
>>           }
>>   -        if (dm_old_con_state->abm_level !=
>> -            dm_new_con_state->abm_level)
>> +        if (dm_old_con_state->abm_level != dm_new_con_state->abm_level ||
>> +            dm_old_con_state->scaling != dm_new_con_state->scaling)
>>               new_crtc_state->connectors_changed = true;
>>       }
>>   
> 
> Hi,
> 
> This change lgtm, and I also run it in our CI, and from IGT perspective, we are good.
> 
> Harry, do you have any comment about this change?
> 

LGTM

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> Thanks
> Siqueira

Re: [PATCH] drm/amd/display: Fix set scaling doesn's work
Posted by Rodrigo Siqueira Jordao 3 years, 3 months ago

On 1/11/23 10:19, Harry Wentland wrote:
> On 1/10/23 10:58, Rodrigo Siqueira Jordao wrote:
>>
>>
>> On 11/22/22 06:20, hongao wrote:
>>> [Why]
>>> Setting scaling does not correctly update CRTC state. As a result
>>> dc stream state's src (composition area) && dest (addressable area)
>>> was not calculated as expected. This causes set scaling doesn's work.
>>>
>>> [How]
>>> Correctly update CRTC state when setting scaling property.
>>>
>>> Signed-off-by: hongao <hongao@uniontech.com>
>>>
>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>>> index 3e1ecca72430..a88a6f758748 100644
>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>>> @@ -9386,8 +9386,8 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
>>>                goto fail;
>>>            }
>>>    -        if (dm_old_con_state->abm_level !=
>>> -            dm_new_con_state->abm_level)
>>> +        if (dm_old_con_state->abm_level != dm_new_con_state->abm_level ||
>>> +            dm_old_con_state->scaling != dm_new_con_state->scaling)
>>>                new_crtc_state->connectors_changed = true;
>>>        }
>>>    
>>
>> Hi,
>>
>> This change lgtm, and I also run it in our CI, and from IGT perspective, we are good.
>>
>> Harry, do you have any comment about this change?
>>
> 
> LGTM
> 
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
> 
> Harry
> 
>> Thanks
>> Siqueira
> 

Thanks, patch applied to amd-staging-drm-next.