diff mbox

[1/2] drm/sti: set initial connectors status at binding

Message ID 1483521346-23663-2-git-send-email-vincent.abriou@st.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vincent Abriou Jan. 4, 2017, 9:15 a.m. UTC
This avoid to have an "unknown" connector status after the sti driver is
registered.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
---
 drivers/gpu/drm/sti/sti_dvo.c  | 3 +++
 drivers/gpu/drm/sti/sti_hdmi.c | 3 +++
 2 files changed, 6 insertions(+)

Comments

Daniel Vetter Jan. 4, 2017, 9:39 a.m. UTC | #1
On Wed, Jan 04, 2017 at 10:15:45AM +0100, Vincent Abriou wrote:
> This avoid to have an "unknown" connector status after the sti driver is
> registered.
> 
> Signed-off-by: Vincent Abriou <vincent.abriou@st.com>

Why is this needed? The fb helpers will probe on their on, your driver
should never need to do this. It also slows down initial boot when you
don't need fbdev ...
-Daniel

> ---
>  drivers/gpu/drm/sti/sti_dvo.c  | 3 +++
>  drivers/gpu/drm/sti/sti_hdmi.c | 3 +++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
> index e8c1ed0..0e73541 100644
> --- a/drivers/gpu/drm/sti/sti_dvo.c
> +++ b/drivers/gpu/drm/sti/sti_dvo.c
> @@ -498,6 +498,9 @@ static int sti_dvo_bind(struct device *dev, struct device *master, void *data)
>  	drm_connector_helper_add(drm_connector,
>  				 &sti_dvo_connector_helper_funcs);
>  
> +	/* set initial status */
> +	drm_connector->status = sti_dvo_connector_detect(drm_connector, false);
> +
>  	err = drm_mode_connector_attach_encoder(drm_connector, encoder);
>  	if (err) {
>  		DRM_ERROR("Failed to attach a connector to a encoder\n");
> diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
> index 9c0025e..2c949bc 100644
> --- a/drivers/gpu/drm/sti/sti_hdmi.c
> +++ b/drivers/gpu/drm/sti/sti_hdmi.c
> @@ -1322,6 +1322,9 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data)
>  	/* initialise property */
>  	sti_hdmi_connector_init_property(drm_dev, drm_connector);
>  
> +	/* set initial status */
> +	drm_connector->status = sti_hdmi_connector_detect(drm_connector, false);
> +
>  	hdmi->drm_connector = drm_connector;
>  
>  	err = drm_mode_connector_attach_encoder(drm_connector, encoder);
> -- 
> 2.7.4
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Vincent Abriou Jan. 4, 2017, 10:14 a.m. UTC | #2
On 01/04/2017 10:39 AM, Daniel Vetter wrote:
> On Wed, Jan 04, 2017 at 10:15:45AM +0100, Vincent Abriou wrote:
>> This avoid to have an "unknown" connector status after the sti driver is
>> registered.
>>
>> Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
>
> Why is this needed? The fb helpers will probe on their on, your driver
> should never need to do this. It also slows down initial boot when you
> don't need fbdev ...
> -Daniel
>

Hi Daniel,

This patch is indeed useless.
I will skip it from my pull request.

Thanks
Vincent

>> ---
>>  drivers/gpu/drm/sti/sti_dvo.c  | 3 +++
>>  drivers/gpu/drm/sti/sti_hdmi.c | 3 +++
>>  2 files changed, 6 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
>> index e8c1ed0..0e73541 100644
>> --- a/drivers/gpu/drm/sti/sti_dvo.c
>> +++ b/drivers/gpu/drm/sti/sti_dvo.c
>> @@ -498,6 +498,9 @@ static int sti_dvo_bind(struct device *dev, struct device *master, void *data)
>>  	drm_connector_helper_add(drm_connector,
>>  				 &sti_dvo_connector_helper_funcs);
>>
>> +	/* set initial status */
>> +	drm_connector->status = sti_dvo_connector_detect(drm_connector, false);
>> +
>>  	err = drm_mode_connector_attach_encoder(drm_connector, encoder);
>>  	if (err) {
>>  		DRM_ERROR("Failed to attach a connector to a encoder\n");
>> diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
>> index 9c0025e..2c949bc 100644
>> --- a/drivers/gpu/drm/sti/sti_hdmi.c
>> +++ b/drivers/gpu/drm/sti/sti_hdmi.c
>> @@ -1322,6 +1322,9 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data)
>>  	/* initialise property */
>>  	sti_hdmi_connector_init_property(drm_dev, drm_connector);
>>
>> +	/* set initial status */
>> +	drm_connector->status = sti_hdmi_connector_detect(drm_connector, false);
>> +
>>  	hdmi->drm_connector = drm_connector;
>>
>>  	err = drm_mode_connector_attach_encoder(drm_connector, encoder);
>> --
>> 2.7.4
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c
index e8c1ed0..0e73541 100644
--- a/drivers/gpu/drm/sti/sti_dvo.c
+++ b/drivers/gpu/drm/sti/sti_dvo.c
@@ -498,6 +498,9 @@  static int sti_dvo_bind(struct device *dev, struct device *master, void *data)
 	drm_connector_helper_add(drm_connector,
 				 &sti_dvo_connector_helper_funcs);
 
+	/* set initial status */
+	drm_connector->status = sti_dvo_connector_detect(drm_connector, false);
+
 	err = drm_mode_connector_attach_encoder(drm_connector, encoder);
 	if (err) {
 		DRM_ERROR("Failed to attach a connector to a encoder\n");
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index 9c0025e..2c949bc 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -1322,6 +1322,9 @@  static int sti_hdmi_bind(struct device *dev, struct device *master, void *data)
 	/* initialise property */
 	sti_hdmi_connector_init_property(drm_dev, drm_connector);
 
+	/* set initial status */
+	drm_connector->status = sti_hdmi_connector_detect(drm_connector, false);
+
 	hdmi->drm_connector = drm_connector;
 
 	err = drm_mode_connector_attach_encoder(drm_connector, encoder);