All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Paalanen <ppaalanen@gmail.com>
To: Simon Ser <contact@emersion.fr>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/connector: demote connector force-probes for non-master clients
Date: Wed, 7 Apr 2021 10:02:24 +0300	[thread overview]
Message-ID: <20210407100224.653fa3e7@eldfell> (raw)
In-Reply-To: <20210402112212.5625-1-contact@emersion.fr>


[-- Attachment #1.1: Type: text/plain, Size: 3055 bytes --]

On Fri,  2 Apr 2021 13:22:12 +0200
Simon Ser <contact@emersion.fr> wrote:

> Force-probing a connector can be slow and cause flickering. As this
> affects the global KMS state, let's make it so only the DRM master
> can force-probe a connector.
> 
> Non-master DRM clients won't be able to force-probe a connector
> anymore. Instead, KMS will perform a regular read-only connector
> query.
> 
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Pekka Paalanen <ppaalanen@gmail.com>

Hi,

seems like a good idea to me.
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>

Btw. can force-probe be triggered via sysfs as well and does it require
root privs?


Thanks,
pq


> ---
>  drivers/gpu/drm/drm_connector.c | 11 ++++++++---
>  include/uapi/drm/drm_mode.h     |  7 ++++---
>  2 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 7631f76e7f34..2f70a52a892b 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -20,6 +20,7 @@
>   * OF THIS SOFTWARE.
>   */
>  
> +#include <drm/drm_auth.h>
>  #include <drm/drm_connector.h>
>  #include <drm/drm_edid.h>
>  #include <drm/drm_encoder.h>
> @@ -2374,9 +2375,13 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
>  
>  	mutex_lock(&dev->mode_config.mutex);
>  	if (out_resp->count_modes == 0) {
> -		connector->funcs->fill_modes(connector,
> -					     dev->mode_config.max_width,
> -					     dev->mode_config.max_height);
> +		if (drm_is_current_master(file_priv))
> +			connector->funcs->fill_modes(connector,
> +						     dev->mode_config.max_width,
> +						     dev->mode_config.max_height);
> +		else
> +			drm_dbg_kms(dev, "User-space requested a forced probe on [CONNECTOR:%d:%s] but is not the DRM master, demoting to read-only probe",
> +				    connector->base.id, connector->name);
>  	}
>  
>  	out_resp->mm_width = connector->display_info.width_mm;
> diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
> index a5e76aa06ad5..3efa2e38d89b 100644
> --- a/include/uapi/drm/drm_mode.h
> +++ b/include/uapi/drm/drm_mode.h
> @@ -413,9 +413,10 @@ enum drm_mode_subconnector {
>   *
>   * **Force-probing a connector**
>   *
> - * If the @count_modes field is set to zero, the kernel will perform a forced
> - * probe on the connector to refresh the connector status, modes and EDID.
> - * A forced-probe can be slow, might cause flickering and the ioctl will block.
> + * If the @count_modes field is set to zero and the DRM client is the DRM
> + * master, the kernel will perform a forced probe on the connector to refresh
> + * the connector status, modes and EDID. A forced-probe can be slow, might
> + * cause flickering and the ioctl will block.
>   *
>   * User-space needs to force-probe connectors to ensure their metadata is
>   * up-to-date at startup and after receiving a hot-plug event. User-space


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-04-07  7:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02 11:22 [PATCH] drm/connector: demote connector force-probes for non-master clients Simon Ser
2021-04-07  7:02 ` Pekka Paalanen [this message]
2021-04-07  7:16   ` Simon Ser
2021-04-07  7:38     ` Pekka Paalanen
2021-04-20  8:47       ` Simon Ser
2021-04-20  9:14 ` Daniel Vetter
2021-04-20 16:53   ` Simon Ser

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=20210407100224.653fa3e7@eldfell \
    --to=ppaalanen@gmail.com \
    --cc=contact@emersion.fr \
    --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.