diff mbox series

[v2] drm/msm/dpu: Reapply CTM if modeset is needed

Message ID 20230118164103.325-1-quic_jesszhan@quicinc.com (mailing list archive)
State Superseded
Headers show
Series [v2] drm/msm/dpu: Reapply CTM if modeset is needed | expand

Commit Message

Jessica Zhang Jan. 18, 2023, 4:41 p.m. UTC
Add a !drm_atomic_crtc_needs_modeset() check to
_dpu_crtc_setup_cp_blocks() so that CTM is reapplied if the LM/DSPP
blocks were reallocated during modeset.

Changes in V2:
- Fixed commit message

Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/23
Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Abhinav Kumar Jan. 18, 2023, 7:29 p.m. UTC | #1
On 1/18/2023 8:41 AM, Jessica Zhang wrote:
> Add a !drm_atomic_crtc_needs_modeset() check to
> _dpu_crtc_setup_cp_blocks() so that CTM is reapplied if the LM/DSPP
> blocks were reallocated during modeset.

This was in addition to the suspend/resume case.

So CTM needs to be reapplied in case of suspend/resume OR LM/DSPP block 
reallocation.

To cover both of these we are adding the needs_modeset check

> 
> Changes in V2:
> - Fixed commit message
> 
> Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/23
> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> index 13ce321283ff..aa120a230222 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> @@ -748,7 +748,7 @@ static void _dpu_crtc_setup_cp_blocks(struct drm_crtc *crtc)
>   	int i;
>   
>   
> -	if (!state->color_mgmt_changed)
> +	if (!state->color_mgmt_changed && !drm_atomic_crtc_needs_modeset(state))
>   		return;
>   
>   	for (i = 0; i < cstate->num_mixers; i++) {
Jessica Zhang Jan. 18, 2023, 11:30 p.m. UTC | #2
On 1/18/2023 11:29 AM, Abhinav Kumar wrote:
> 
> 
> On 1/18/2023 8:41 AM, Jessica Zhang wrote:
>> Add a !drm_atomic_crtc_needs_modeset() check to
>> _dpu_crtc_setup_cp_blocks() so that CTM is reapplied if the LM/DSPP
>> blocks were reallocated during modeset.
> 
> This was in addition to the suspend/resume case.
> 
> So CTM needs to be reapplied in case of suspend/resume OR LM/DSPP block 
> reallocation.
> 
> To cover both of these we are adding the needs_modeset check

Hi Abhinav,

Acked. Will add back mention of suspend/resume case.

Thanks,

Jessica Zhang

> 
>>
>> Changes in V2:
>> - Fixed commit message
>>
>> Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/23
>> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
>> ---
>>   drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c 
>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
>> index 13ce321283ff..aa120a230222 100644
>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
>> @@ -748,7 +748,7 @@ static void _dpu_crtc_setup_cp_blocks(struct 
>> drm_crtc *crtc)
>>       int i;
>> -    if (!state->color_mgmt_changed)
>> +    if (!state->color_mgmt_changed && 
>> !drm_atomic_crtc_needs_modeset(state))
>>           return;
>>       for (i = 0; i < cstate->num_mixers; i++) {
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 13ce321283ff..aa120a230222 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -748,7 +748,7 @@  static void _dpu_crtc_setup_cp_blocks(struct drm_crtc *crtc)
 	int i;
 
 
-	if (!state->color_mgmt_changed)
+	if (!state->color_mgmt_changed && !drm_atomic_crtc_needs_modeset(state))
 		return;
 
 	for (i = 0; i < cstate->num_mixers; i++) {