From: Dave Airlie <airlied@redhat.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/kms: Add a module parameter to disable polling
Date: Fri, 20 Aug 2010 08:50:40 +1000 [thread overview]
Message-ID: <1282258240.19666.0.camel@clockmaker-el6> (raw)
In-Reply-To: <1281643044-9135-1-git-send-email-chris@chris-wilson.co.uk>
On Thu, 2010-08-12 at 20:57 +0100, Chris Wilson wrote:
> Polling for a VGA device on an old system can be quite expensive,
> causing latencies on the order of 600ms. As we hold the mode mutex for
> this time and also need the same mutex to move the cursor, we trigger a
> user-visible stall.
You should rebase this on -rc1 or above since the stuff in the kernel
changed and we don't use the slow work stuff anymore.
Dave.
>
> The real solution would involve improving the granulatity of the
> locking and so perhaps performing some of the probing not under the lock
> or some other updates can be done under different locks. Also reducing the
> cost of probing for a non-existent monitor would be worthwhile. However,
> exposing a parameter to disable polling is a simple workaround in the
> meantime.
>
> In order to accommodate users turning polling on and off at runtime, the
> polling is potentially re-enabled on every probe. This is coupled to
> the user calling xrandr, which seems to be a vaild time to reset the
> polling timeout since the information on the connection has just been
> updated. (The presumption being that all connections are probed in a
> single xrandr pass, which is currently valid.)
>
> References:
>
> Bug 29536 - 2.6.35 causes ~600ms latency every 10s
> https://bugs.freedesktop.org/show_bug.cgi?id=29536
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Reported-and-tested-by: Bruno Prémont <bonbons@linux-vserver.org>
> ---
> drivers/gpu/drm/drm_crtc_helper.c | 17 +++++++++++++++--
> 1 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
> index a0ab1d1..13ba313 100644
> --- a/drivers/gpu/drm/drm_crtc_helper.c
> +++ b/drivers/gpu/drm/drm_crtc_helper.c
> @@ -34,6 +34,9 @@
> #include "drm_crtc_helper.h"
> #include "drm_fb_helper.h"
>
> +static bool drm_kms_helper_poll = true;
> +module_param_named(poll, drm_kms_helper_poll, bool, 0600);
> +
> static void drm_mode_validate_flag(struct drm_connector *connector,
> int flags)
> {
> @@ -99,8 +102,10 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
> connector->status = connector_status_disconnected;
> if (connector->funcs->force)
> connector->funcs->force(connector);
> - } else
> + } else {
> connector->status = connector->funcs->detect(connector);
> + drm_helper_hpd_irq_event(dev);
> + }
>
> if (connector->status == connector_status_disconnected) {
> DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n",
> @@ -982,6 +987,9 @@ static void output_poll_execute(struct work_struct *work)
> enum drm_connector_status old_status, status;
> bool repoll = false, changed = false;
>
> + if (!drm_kms_helper_poll)
> + return;
> +
> mutex_lock(&dev->mode_config.mutex);
> list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
>
> @@ -1032,6 +1040,9 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)
> bool poll = false;
> struct drm_connector *connector;
>
> + if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll)
> + return;
> +
> list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
> if (connector->polled)
> poll = true;
> @@ -1061,8 +1072,10 @@ void drm_helper_hpd_irq_event(struct drm_device *dev)
> {
> if (!dev->mode_config.poll_enabled)
> return;
> +
> /* kill timer and schedule immediate execution, this doesn't block */
> cancel_delayed_work(&dev->mode_config.output_poll_work);
> - queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, 0);
> + if (drm_kms_helper_poll)
> + queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, 0);
> }
> EXPORT_SYMBOL(drm_helper_hpd_irq_event);
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2010-08-19 22:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-12 19:57 [PATCH] drm/kms: Add a module parameter to disable polling Chris Wilson
2010-08-12 22:09 ` Alex Deucher
2010-08-19 22:50 ` Dave Airlie [this message]
2010-08-20 8:13 ` Chris Wilson
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=1282258240.19666.0.camel@clockmaker-el6 \
--to=airlied@redhat.com \
--cc=chris@chris-wilson.co.uk \
--cc=dri-devel@lists.freedesktop.org \
/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.