All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>, Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: daniel.vetter@ffwll.ch, tomi.valkeinen@ti.com, "Tahvanainen,
	Jari" <jari.tahvanainen@intel.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2] drm: drm_probe_helper: Fix output_poll_work scheduling
Date: Mon, 19 Dec 2016 11:54:05 +0200	[thread overview]
Message-ID: <871sx4nt1e.fsf@intel.com> (raw)
In-Reply-To: <20160831112317.GC20761@phenom.ffwll.local>

On Wed, 31 Aug 2016, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, Aug 31, 2016 at 02:09:05PM +0300, Peter Ujfalusi wrote:
>> drm_kms_helper_poll_enable_locked() should check if we have delayed event
>> pending and if we have, schedule the work to run without delay.
>> 
>> Currently the output_poll_work is only scheduled if any of the connectors
>> have DRM_CONNECTOR_POLL_CONNECT or DRM_CONNECTOR_POLL_DISCONNECT with
>> DRM_OUTPUT_POLL_PERIOD delay. It does not matter if we have delayed event
>> already registered to be handled. The detection will be delayd by
>> DRM_OUTPUT_POLL_PERIOD in any case.
>> Furthermore if none of the connectors are marked as POLL_CONNECT or
>> POLL_DISCONNECT because all connectors are either POLL_HPD or they are
>> always connected: the output_poll_work will not run at all even if we
>> have delayed event marked.
>> 
>> When none of the connectors require polling, their initial status change
>> from unknown to connected/disconnected is not going to be handled until
>> the first kms application starts or if we have fb console enabled.
>> 
>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
>> ---
>> Hi,
>> 
>> Changes since v1:
>> - dropped the last paragraph from the commit message.
>
> I added a few more words to the commit message to explain when exactly
> this is a problem and applied your patch to drm-misc.

Hi Peter, sadly looks like this regresses users out there [1]. Seems to
be a reliable bisect. We need to have this fixed or reverted.

BR,
Jani.


[1] https://bugs.freedesktop.org/show_bug.cgi?id=98690



>
> Thanks, Daniel
>> 
>> Regards,
>> Peter
>> 
>>  drivers/gpu/drm/drm_probe_helper.c | 8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
>> index a0df377d7d1c..f6b64d7d3528 100644
>> --- a/drivers/gpu/drm/drm_probe_helper.c
>> +++ b/drivers/gpu/drm/drm_probe_helper.c
>> @@ -129,6 +129,7 @@ void drm_kms_helper_poll_enable_locked(struct drm_device *dev)
>>  {
>>  	bool poll = false;
>>  	struct drm_connector *connector;
>> +	unsigned long delay = DRM_OUTPUT_POLL_PERIOD;
>> 
>>  	WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
>> 
>> @@ -141,8 +142,13 @@ void drm_kms_helper_poll_enable_locked(struct drm_device *dev)
>>  			poll = true;
>>  	}
>> 
>> +	if (dev->mode_config.delayed_event) {
>> +		poll = true;
>> +		delay = 0;
>> +	}
>> +
>>  	if (poll)
>> -		schedule_delayed_work(&dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD);
>> +		schedule_delayed_work(&dev->mode_config.output_poll_work, delay);
>>  }
>>  EXPORT_SYMBOL(drm_kms_helper_poll_enable_locked);
>> 
>> --
>> 2.9.3
>> 

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>, Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: daniel.vetter@ffwll.ch, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, tomi.valkeinen@ti.com,
	"Tahvanainen\, Jari" <jari.tahvanainen@intel.com>
Subject: Re: [PATCH v2] drm: drm_probe_helper: Fix output_poll_work scheduling
Date: Mon, 19 Dec 2016 11:54:05 +0200	[thread overview]
Message-ID: <871sx4nt1e.fsf@intel.com> (raw)
In-Reply-To: <20160831112317.GC20761@phenom.ffwll.local>

On Wed, 31 Aug 2016, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, Aug 31, 2016 at 02:09:05PM +0300, Peter Ujfalusi wrote:
>> drm_kms_helper_poll_enable_locked() should check if we have delayed event
>> pending and if we have, schedule the work to run without delay.
>> 
>> Currently the output_poll_work is only scheduled if any of the connectors
>> have DRM_CONNECTOR_POLL_CONNECT or DRM_CONNECTOR_POLL_DISCONNECT with
>> DRM_OUTPUT_POLL_PERIOD delay. It does not matter if we have delayed event
>> already registered to be handled. The detection will be delayd by
>> DRM_OUTPUT_POLL_PERIOD in any case.
>> Furthermore if none of the connectors are marked as POLL_CONNECT or
>> POLL_DISCONNECT because all connectors are either POLL_HPD or they are
>> always connected: the output_poll_work will not run at all even if we
>> have delayed event marked.
>> 
>> When none of the connectors require polling, their initial status change
>> from unknown to connected/disconnected is not going to be handled until
>> the first kms application starts or if we have fb console enabled.
>> 
>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
>> ---
>> Hi,
>> 
>> Changes since v1:
>> - dropped the last paragraph from the commit message.
>
> I added a few more words to the commit message to explain when exactly
> this is a problem and applied your patch to drm-misc.

Hi Peter, sadly looks like this regresses users out there [1]. Seems to
be a reliable bisect. We need to have this fixed or reverted.

BR,
Jani.


[1] https://bugs.freedesktop.org/show_bug.cgi?id=98690



>
> Thanks, Daniel
>> 
>> Regards,
>> Peter
>> 
>>  drivers/gpu/drm/drm_probe_helper.c | 8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
>> index a0df377d7d1c..f6b64d7d3528 100644
>> --- a/drivers/gpu/drm/drm_probe_helper.c
>> +++ b/drivers/gpu/drm/drm_probe_helper.c
>> @@ -129,6 +129,7 @@ void drm_kms_helper_poll_enable_locked(struct drm_device *dev)
>>  {
>>  	bool poll = false;
>>  	struct drm_connector *connector;
>> +	unsigned long delay = DRM_OUTPUT_POLL_PERIOD;
>> 
>>  	WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
>> 
>> @@ -141,8 +142,13 @@ void drm_kms_helper_poll_enable_locked(struct drm_device *dev)
>>  			poll = true;
>>  	}
>> 
>> +	if (dev->mode_config.delayed_event) {
>> +		poll = true;
>> +		delay = 0;
>> +	}
>> +
>>  	if (poll)
>> -		schedule_delayed_work(&dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD);
>> +		schedule_delayed_work(&dev->mode_config.output_poll_work, delay);
>>  }
>>  EXPORT_SYMBOL(drm_kms_helper_poll_enable_locked);
>> 
>> --
>> 2.9.3
>> 

-- 
Jani Nikula, Intel Open Source Technology Center

  reply	other threads:[~2016-12-19  9:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31 11:09 [PATCH v2] drm: drm_probe_helper: Fix output_poll_work scheduling Peter Ujfalusi
2016-08-31 11:09 ` Peter Ujfalusi
2016-08-31 11:23 ` Daniel Vetter
2016-08-31 11:23   ` Daniel Vetter
2016-12-19  9:54   ` Jani Nikula [this message]
2016-12-19  9:54     ` Jani Nikula
2016-12-19 12:15     ` Peter Ujfalusi
2016-12-19 12:15       ` Peter Ujfalusi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871sx4nt1e.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jari.tahvanainen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.ujfalusi@ti.com \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.