linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] drm/msm/dp: make eDP panel as the first connected connector
@ 2022-07-06 17:24 Kuogee Hsieh
  2022-07-06 17:25 ` Dmitry Baryshkov
  0 siblings, 1 reply; 6+ messages in thread
From: Kuogee Hsieh @ 2022-07-06 17:24 UTC (permalink / raw)
  To: robdclark, sean, swboyd, dianders, vkoul, daniel, airlied,
	agross, dmitry.baryshkov, bjorn.andersson
  Cc: quic_abhinavk, quic_aravindh, quic_khsieh, quic_sbillaka,
	freedreno, dri-devel, linux-arm-msm, linux-kernel

Some userspace presumes that the first connected connector is the main
display, where it's supposed to display e.g. the login screen. For
laptops, this should be the main panel.

This patch call drm_helper_move_panel_connectors_to_head() after
drm_bridge_connector_init() to make sure eDP stay at head of
connected connector list. This fixes unexpected corruption happen
at eDP panel if eDP is not placed at head of connected connector
list.

Changes in v2:
-- move drm_helper_move_panel_connectors_to_head() to
		dpu_kms_drm_obj_init()

Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index 2b9d931..50ff666 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -763,6 +763,8 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
 	if (ret)
 		return ret;
 
+	drm_helper_move_panel_connectors_to_head(dev);
+
 	num_encoders = 0;
 	drm_for_each_encoder(encoder, dev)
 		num_encoders++;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] drm/msm/dp: make eDP panel as the first connected connector
  2022-07-06 17:24 [PATCH v3] drm/msm/dp: make eDP panel as the first connected connector Kuogee Hsieh
@ 2022-07-06 17:25 ` Dmitry Baryshkov
  2022-07-06 17:38   ` Kuogee Hsieh
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Baryshkov @ 2022-07-06 17:25 UTC (permalink / raw)
  To: Kuogee Hsieh, robdclark, sean, swboyd, dianders, vkoul, daniel,
	airlied, agross, bjorn.andersson
  Cc: quic_abhinavk, quic_aravindh, quic_sbillaka, freedreno,
	dri-devel, linux-arm-msm, linux-kernel

On 06/07/2022 20:24, Kuogee Hsieh wrote:
> Some userspace presumes that the first connected connector is the main
> display, where it's supposed to display e.g. the login screen. For
> laptops, this should be the main panel.
> 
> This patch call drm_helper_move_panel_connectors_to_head() after
> drm_bridge_connector_init() to make sure eDP stay at head of
> connected connector list. This fixes unexpected corruption happen
> at eDP panel if eDP is not placed at head of connected connector
> list.
> 
> Changes in v2:
> -- move drm_helper_move_panel_connectors_to_head() to
> 		dpu_kms_drm_obj_init()
> 
> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> index 2b9d931..50ff666 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> @@ -763,6 +763,8 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
>   	if (ret)
>   		return ret;
>   
> +	drm_helper_move_panel_connectors_to_head(dev);

This should be in msm_drv.c unless you have a strong reason to have it here.

> +
>   	num_encoders = 0;
>   	drm_for_each_encoder(encoder, dev)
>   		num_encoders++;


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] drm/msm/dp: make eDP panel as the first connected connector
  2022-07-06 17:25 ` Dmitry Baryshkov
@ 2022-07-06 17:38   ` Kuogee Hsieh
  2022-07-06 17:41     ` Dmitry Baryshkov
  0 siblings, 1 reply; 6+ messages in thread
From: Kuogee Hsieh @ 2022-07-06 17:38 UTC (permalink / raw)
  To: Dmitry Baryshkov, robdclark, sean, swboyd, dianders, vkoul,
	daniel, airlied, agross, bjorn.andersson
  Cc: quic_abhinavk, quic_aravindh, quic_sbillaka, freedreno,
	dri-devel, linux-arm-msm, linux-kernel


On 7/6/2022 10:25 AM, Dmitry Baryshkov wrote:
> On 06/07/2022 20:24, Kuogee Hsieh wrote:
>> Some userspace presumes that the first connected connector is the main
>> display, where it's supposed to display e.g. the login screen. For
>> laptops, this should be the main panel.
>>
>> This patch call drm_helper_move_panel_connectors_to_head() after
>> drm_bridge_connector_init() to make sure eDP stay at head of
>> connected connector list. This fixes unexpected corruption happen
>> at eDP panel if eDP is not placed at head of connected connector
>> list.
>>
>> Changes in v2:
>> -- move drm_helper_move_panel_connectors_to_head() to
>>         dpu_kms_drm_obj_init()
>>
>> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
>> ---
>>   drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c 
>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>> index 2b9d931..50ff666 100644
>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>> @@ -763,6 +763,8 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms 
>> *dpu_kms)
>>       if (ret)
>>           return ret;
>>   +    drm_helper_move_panel_connectors_to_head(dev);
>
> This should be in msm_drv.c unless you have a strong reason to have it 
> here.
Can you please  provide more info why should be in msm_drv.c?
> _dpu_kms_drm_obj_init() create and initialize drm obj one by one and 
> _dpu_kms_setup_displays() had created system wide connectors/interfaces .

After that should be fine to move edp to head of connector list.

>> +
>>       num_encoders = 0;
>>       drm_for_each_encoder(encoder, dev)
>>           num_encoders++;
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] drm/msm/dp: make eDP panel as the first connected connector
  2022-07-06 17:38   ` Kuogee Hsieh
@ 2022-07-06 17:41     ` Dmitry Baryshkov
  2022-07-06 17:54       ` Kuogee Hsieh
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Baryshkov @ 2022-07-06 17:41 UTC (permalink / raw)
  To: Kuogee Hsieh, robdclark, sean, swboyd, dianders, vkoul, daniel,
	airlied, agross, bjorn.andersson
  Cc: quic_abhinavk, quic_aravindh, quic_sbillaka, freedreno,
	dri-devel, linux-arm-msm, linux-kernel

On 06/07/2022 20:38, Kuogee Hsieh wrote:
> 
> On 7/6/2022 10:25 AM, Dmitry Baryshkov wrote:
>> On 06/07/2022 20:24, Kuogee Hsieh wrote:
>>> Some userspace presumes that the first connected connector is the main
>>> display, where it's supposed to display e.g. the login screen. For
>>> laptops, this should be the main panel.
>>>
>>> This patch call drm_helper_move_panel_connectors_to_head() after
>>> drm_bridge_connector_init() to make sure eDP stay at head of
>>> connected connector list. This fixes unexpected corruption happen
>>> at eDP panel if eDP is not placed at head of connected connector
>>> list.
>>>
>>> Changes in v2:
>>> -- move drm_helper_move_panel_connectors_to_head() to
>>>         dpu_kms_drm_obj_init()
>>>
>>> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
>>> ---
>>>   drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c 
>>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>>> index 2b9d931..50ff666 100644
>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>>> @@ -763,6 +763,8 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms 
>>> *dpu_kms)
>>>       if (ret)
>>>           return ret;
>>>   +    drm_helper_move_panel_connectors_to_head(dev);
>>
>> This should be in msm_drv.c unless you have a strong reason to have it 
>> here.
> Can you please  provide more info why should be in msm_drv.c?

Let me quote my message from v1 review:

Please move this call to the msm_drm_init(). Calling this function 
somewhere after the ->kms_init() would make sure that all panel 
connectors are close to the top of the list, whichever MDP/DPU driver is 
used and whichever actual interface is bound to this panel.

>> _dpu_kms_drm_obj_init() create and initialize drm obj one by one and 
>> _dpu_kms_setup_displays() had created system wide connectors/interfaces .
> 
> After that should be fine to move edp to head of connector list.
> 
>>> +
>>>       num_encoders = 0;
>>>       drm_for_each_encoder(encoder, dev)
>>>           num_encoders++;
>>
>>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] drm/msm/dp: make eDP panel as the first connected connector
  2022-07-06 17:41     ` Dmitry Baryshkov
@ 2022-07-06 17:54       ` Kuogee Hsieh
  2022-07-06 17:57         ` Dmitry Baryshkov
  0 siblings, 1 reply; 6+ messages in thread
From: Kuogee Hsieh @ 2022-07-06 17:54 UTC (permalink / raw)
  To: Dmitry Baryshkov, robdclark, sean, swboyd, dianders, vkoul,
	daniel, airlied, agross, bjorn.andersson
  Cc: quic_abhinavk, quic_aravindh, quic_sbillaka, freedreno,
	dri-devel, linux-arm-msm, linux-kernel


On 7/6/2022 10:41 AM, Dmitry Baryshkov wrote:
> On 06/07/2022 20:38, Kuogee Hsieh wrote:
>>
>> On 7/6/2022 10:25 AM, Dmitry Baryshkov wrote:
>>> On 06/07/2022 20:24, Kuogee Hsieh wrote:
>>>> Some userspace presumes that the first connected connector is the main
>>>> display, where it's supposed to display e.g. the login screen. For
>>>> laptops, this should be the main panel.
>>>>
>>>> This patch call drm_helper_move_panel_connectors_to_head() after
>>>> drm_bridge_connector_init() to make sure eDP stay at head of
>>>> connected connector list. This fixes unexpected corruption happen
>>>> at eDP panel if eDP is not placed at head of connected connector
>>>> list.
>>>>
>>>> Changes in v2:
>>>> -- move drm_helper_move_panel_connectors_to_head() to
>>>>         dpu_kms_drm_obj_init()
>>>>
>>>> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
>>>> ---
>>>>   drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 ++
>>>>   1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c 
>>>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>>>> index 2b9d931..50ff666 100644
>>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>>>> @@ -763,6 +763,8 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms 
>>>> *dpu_kms)
>>>>       if (ret)
>>>>           return ret;
>>>>   +    drm_helper_move_panel_connectors_to_head(dev);
>>>
>>> This should be in msm_drv.c unless you have a strong reason to have 
>>> it here.
>> Can you please  provide more info why should be in msm_drv.c?
>
> Let me quote my message from v1 review:
>
> Please move this call to the msm_drm_init(). Calling this function 
> somewhere after the ->kms_init() would make sure that all panel 
> connectors are close to the top of the list, whichever MDP/DPU driver 
> is used and whichever actual interface is bound to this panel.
>
Below are the call flow in timing order, ->kms_init does not create 
connectors/interfaces, hw_init does that.

1) ->kms_init

2) ->hw_init -> dpu_kms_hw_init --> _dpu_kms_drm_obj_init()  --> 
_dpu_kms_setup_displays()--> msm_dp_modeset_init() --> creator 
connectors/interfaces

3) drm_helper_move_panel_connectors_to_head() <== add here??

>>> _dpu_kms_drm_obj_init() create and initialize drm obj one by one and 
>>> _dpu_kms_setup_displays() had created system wide 
>>> connectors/interfaces .
>>
>> After that should be fine to move edp to head of connector list.
>>
>>>> +
>>>>       num_encoders = 0;
>>>>       drm_for_each_encoder(encoder, dev)
>>>>           num_encoders++;
>>>
>>>
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3] drm/msm/dp: make eDP panel as the first connected connector
  2022-07-06 17:54       ` Kuogee Hsieh
@ 2022-07-06 17:57         ` Dmitry Baryshkov
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Baryshkov @ 2022-07-06 17:57 UTC (permalink / raw)
  To: Kuogee Hsieh, robdclark, sean, swboyd, dianders, vkoul, daniel,
	airlied, agross, bjorn.andersson
  Cc: quic_abhinavk, quic_aravindh, quic_sbillaka, freedreno,
	dri-devel, linux-arm-msm, linux-kernel

On 06/07/2022 20:54, Kuogee Hsieh wrote:
> 
> On 7/6/2022 10:41 AM, Dmitry Baryshkov wrote:
>> On 06/07/2022 20:38, Kuogee Hsieh wrote:
>>>
>>> On 7/6/2022 10:25 AM, Dmitry Baryshkov wrote:
>>>> On 06/07/2022 20:24, Kuogee Hsieh wrote:
>>>>> Some userspace presumes that the first connected connector is the main
>>>>> display, where it's supposed to display e.g. the login screen. For
>>>>> laptops, this should be the main panel.
>>>>>
>>>>> This patch call drm_helper_move_panel_connectors_to_head() after
>>>>> drm_bridge_connector_init() to make sure eDP stay at head of
>>>>> connected connector list. This fixes unexpected corruption happen
>>>>> at eDP panel if eDP is not placed at head of connected connector
>>>>> list.
>>>>>
>>>>> Changes in v2:
>>>>> -- move drm_helper_move_panel_connectors_to_head() to
>>>>>         dpu_kms_drm_obj_init()
>>>>>
>>>>> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
>>>>> ---
>>>>>   drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 ++
>>>>>   1 file changed, 2 insertions(+)
>>>>>
>>>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c 
>>>>> b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>>>>> index 2b9d931..50ff666 100644
>>>>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>>>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
>>>>> @@ -763,6 +763,8 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms 
>>>>> *dpu_kms)
>>>>>       if (ret)
>>>>>           return ret;
>>>>>   +    drm_helper_move_panel_connectors_to_head(dev);
>>>>
>>>> This should be in msm_drv.c unless you have a strong reason to have 
>>>> it here.
>>> Can you please  provide more info why should be in msm_drv.c?
>>
>> Let me quote my message from v1 review:
>>
>> Please move this call to the msm_drm_init(). Calling this function 
>> somewhere after the ->kms_init() would make sure that all panel 
>> connectors are close to the top of the list, whichever MDP/DPU driver 
>> is used and whichever actual interface is bound to this panel.
>>
> Below are the call flow in timing order, ->kms_init does not create 
> connectors/interfaces, hw_init does that.
> 
> 1) ->kms_init
> 
> 2) ->hw_init -> dpu_kms_hw_init --> _dpu_kms_drm_obj_init()  --> 
> _dpu_kms_setup_displays()--> msm_dp_modeset_init() --> creator 
> connectors/interfaces
> 
> 3) drm_helper_move_panel_connectors_to_head() <== add here??

Yes.

> 
>>>> _dpu_kms_drm_obj_init() create and initialize drm obj one by one and 
>>>> _dpu_kms_setup_displays() had created system wide 
>>>> connectors/interfaces .
>>>
>>> After that should be fine to move edp to head of connector list.
>>>
>>>>> +
>>>>>       num_encoders = 0;
>>>>>       drm_for_each_encoder(encoder, dev)
>>>>>           num_encoders++;
>>>>
>>>>
>>
>>


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-07-06 17:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06 17:24 [PATCH v3] drm/msm/dp: make eDP panel as the first connected connector Kuogee Hsieh
2022-07-06 17:25 ` Dmitry Baryshkov
2022-07-06 17:38   ` Kuogee Hsieh
2022-07-06 17:41     ` Dmitry Baryshkov
2022-07-06 17:54       ` Kuogee Hsieh
2022-07-06 17:57         ` Dmitry Baryshkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).