From: Brian Starkey <brian.starkey@arm.com>
To: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: Gustavo Padovan <gustavo@padovan.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Sean Paul <seanpaul@chromium.org>,
Jonathan Corbet <corbet@lwn.net>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
David Airlie <airlied@linux.ie>,
Alexandru-Cosmin Gheorghe <alexandru-cosmin.gheorghe@arm.com>,
Eric Anholt <eric@anholt.net>,
Boris Brezillon <boris.brezillon@bootlin.com>,
Maxime Ripard <maxime.ripard@bootlin.com>,
Daniel Stone <daniels@collabora.com>,
Rob Clark <robdclark@gmail.com>
Subject: Re: [PATCH v10 3/3] drm: writeback: Add client capability for exposing writeback connectors
Date: Wed, 13 Jun 2018 11:26:05 +0100 [thread overview]
Message-ID: <20180613102605.GA8131@e107564-lin.cambridge.arm.com> (raw)
In-Reply-To: <20180612135233.18575-4-Liviu.Dudau@arm.com>
Hi Liviu,
On Tue, Jun 12, 2018 at 02:52:33PM +0100, Liviu Dudau wrote:
>Due to the fact that writeback connectors behave in a special way
>in DRM (they always report being disconnected) we might confuse some
>userspace. Add a client capability for writeback connectors that will
>filter them out for clients that don't understand the capability.
>
>Changelog:
> - only accept the capability if the client has already set the
>DRM_CLIENT_CAP_ATOMIC one.
>
>Cc: Sean Paul <seanpaul@chromium.org>
>Cc: Brian Starkey <brian.starkey@arm.com>
>Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
LGTM,
Reviewed-by: Brian Starkey <brian.starkey@arm.com>
Thanks,
-Brian
>---
> drivers/gpu/drm/drm_ioctl.c | 7 +++++++
> drivers/gpu/drm/drm_mode_config.c | 5 +++++
> include/drm/drm_file.h | 7 +++++++
> include/uapi/drm/drm.h | 9 +++++++++
> 4 files changed, 28 insertions(+)
>
>diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
>index 0d4cfb232576f..fe49fb0356b5a 100644
>--- a/drivers/gpu/drm/drm_ioctl.c
>+++ b/drivers/gpu/drm/drm_ioctl.c
>@@ -334,6 +334,13 @@ drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
> return -EINVAL;
> file_priv->aspect_ratio_allowed = req->value;
> break;
>+ case DRM_CLIENT_CAP_WRITEBACK_CONNECTORS:
>+ if (!file_priv->atomic)
>+ return -EINVAL;
>+ if (req->value > 1)
>+ return -EINVAL;
>+ file_priv->writeback_connectors = req->value;
>+ break;
> default:
> return -EINVAL;
> }
>diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
>index e5c653357024d..21e353bd3948e 100644
>--- a/drivers/gpu/drm/drm_mode_config.c
>+++ b/drivers/gpu/drm/drm_mode_config.c
>@@ -145,6 +145,11 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
> count = 0;
> connector_id = u64_to_user_ptr(card_res->connector_id_ptr);
> drm_for_each_connector_iter(connector, &conn_iter) {
>+ /* only expose writeback connectors if userspace understands them */
>+ if (!file_priv->writeback_connectors &&
>+ (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK))
>+ continue;
>+
> if (drm_lease_held(file_priv, connector->base.id)) {
> if (count < card_res->count_connectors &&
> put_user(connector->base.id, connector_id + count)) {
>diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
>index 027ac16da3d15..26485acc51d79 100644
>--- a/include/drm/drm_file.h
>+++ b/include/drm/drm_file.h
>@@ -192,6 +192,13 @@ struct drm_file {
> */
> unsigned aspect_ratio_allowed:1;
>
>+ /**
>+ * @writeback_connectors:
>+ *
>+ * True if client understands writeback connectors
>+ */
>+ unsigned writeback_connectors:1;
>+
> /**
> * @is_master:
> *
>diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
>index 9c660e1688abe..300f336633f28 100644
>--- a/include/uapi/drm/drm.h
>+++ b/include/uapi/drm/drm.h
>@@ -687,6 +687,15 @@ struct drm_get_cap {
> */
> #define DRM_CLIENT_CAP_ASPECT_RATIO 4
>
>+/**
>+ * DRM_CLIENT_CAP_WRITEBACK_CONNECTORS
>+ *
>+ * If set to 1, the DRM core will expose special connectors to be used for
>+ * writing back to memory the scene setup in the commit. Depends on client
>+ * also supporting DRM_CLIENT_CAP_ATOMIC
>+ */
>+#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5
>+
> /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
> struct drm_set_client_cap {
> __u64 capability;
>--
>2.17.1
>
prev parent reply other threads:[~2018-06-13 10:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-12 13:52 [PATCH v10 0/3] drm: Introduce " Liviu Dudau
2018-06-12 13:52 ` [PATCH v10 1/3] drm: Add writeback connector type Liviu Dudau
2018-06-12 13:52 ` [PATCH v10 2/3] drm: writeback: Add out-fences for writeback connectors Liviu Dudau
2018-06-12 13:52 ` [PATCH v10 3/3] drm: writeback: Add client capability for exposing " Liviu Dudau
2018-06-13 10:26 ` Brian Starkey [this message]
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=20180613102605.GA8131@e107564-lin.cambridge.arm.com \
--to=brian.starkey@arm.com \
--cc=Liviu.Dudau@arm.com \
--cc=airlied@linux.ie \
--cc=alexandru-cosmin.gheorghe@arm.com \
--cc=boris.brezillon@bootlin.com \
--cc=corbet@lwn.net \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=eric@anholt.net \
--cc=gustavo@padovan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=maxime.ripard@bootlin.com \
--cc=robdclark@gmail.com \
--cc=seanpaul@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®