From: Daniel Vetter <daniel@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH] drm/lease: look at ->universal_planes only once
Date: Tue, 6 Nov 2018 18:23:47 +0100 [thread overview]
Message-ID: <20181106172347.GT21967@phenom.ffwll.local> (raw)
In-Reply-To: <20181105101211.22737-1-daniel.vetter@ffwll.ch>
On Mon, Nov 05, 2018 at 11:12:11AM +0100, Daniel Vetter wrote:
> It's lockless, and userspace might chance it underneath us. That's not
> really a problem, all userspace gets is a slightly dysfunctional
> lease with the current code. But this might change, and gcc might
> decide to reload a few too many times, and then boom. So better safe
> than sorry.
>
> v2: Remove the now unused lessor_priv argument from validate_lease()
> (Keith).
>
> v3: Actually add everything ... silly me.
>
> Cc: Keith Packard <keithp@keithp.com>
> Cc: Dave Airlie <airlied@gmail.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
All pulled in with CI approving and Keith's irc-ack on this one here.
-Daniel
> ---
> drivers/gpu/drm/drm_lease.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c
> index 3b0342a45ae9..3650d3c46718 100644
> --- a/drivers/gpu/drm/drm_lease.c
> +++ b/drivers/gpu/drm/drm_lease.c
> @@ -353,9 +353,9 @@ void drm_lease_revoke(struct drm_master *top)
> }
>
> static int validate_lease(struct drm_device *dev,
> - struct drm_file *lessor_priv,
> int object_count,
> - struct drm_mode_object **objects)
> + struct drm_mode_object **objects,
> + bool universal_planes)
> {
> int o;
> int has_crtc = -1;
> @@ -372,14 +372,14 @@ static int validate_lease(struct drm_device *dev,
> if (objects[o]->type == DRM_MODE_OBJECT_CONNECTOR && has_connector == -1)
> has_connector = o;
>
> - if (lessor_priv->universal_planes) {
> + if (universal_planes) {
> if (objects[o]->type == DRM_MODE_OBJECT_PLANE && has_plane == -1)
> has_plane = o;
> }
> }
> if (has_crtc == -1 || has_connector == -1)
> return -EINVAL;
> - if (lessor_priv->universal_planes && has_plane == -1)
> + if (universal_planes && has_plane == -1)
> return -EINVAL;
> return 0;
> }
> @@ -393,6 +393,8 @@ static int fill_object_idr(struct drm_device *dev,
> struct drm_mode_object **objects;
> u32 o;
> int ret;
> + bool universal_planes = READ_ONCE(lessor_priv->universal_planes);
> +
> objects = kcalloc(object_count, sizeof(struct drm_mode_object *),
> GFP_KERNEL);
> if (!objects)
> @@ -421,7 +423,7 @@ static int fill_object_idr(struct drm_device *dev,
> }
> }
>
> - ret = validate_lease(dev, lessor_priv, object_count, objects);
> + ret = validate_lease(dev, object_count, objects, universal_planes);
> if (ret) {
> DRM_DEBUG_LEASE("lease validation failed\n");
> goto out_free_objects;
> @@ -448,7 +450,7 @@ static int fill_object_idr(struct drm_device *dev,
> object_id, ret);
> goto out_free_objects;
> }
> - if (obj->type == DRM_MODE_OBJECT_CRTC && !lessor_priv->universal_planes) {
> + if (obj->type == DRM_MODE_OBJECT_CRTC && !universal_planes) {
> struct drm_crtc *crtc = obj_to_crtc(obj);
> ret = idr_alloc(leases, &drm_lease_idr_object, crtc->primary->base.id, crtc->primary->base.id + 1, GFP_KERNEL);
> if (ret < 0) {
> --
> 2.14.4
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-11-06 17:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-02 13:25 [PATCH 1/3] drm/lease: debug output for lease creation Daniel Vetter
2018-11-02 13:25 ` [PATCH 2/3] drm/file: Uncompact the feature flags Daniel Vetter
2018-11-02 17:05 ` Chris Wilson
2018-11-02 13:25 ` [PATCH 3/3] drm/lease: look at ->universal_planes only once Daniel Vetter
2018-11-02 15:04 ` Keith Packard
2018-11-02 21:46 ` [PATCH] " Daniel Vetter
2018-11-05 10:12 ` Daniel Vetter
2018-11-06 17:23 ` Daniel Vetter [this message]
2018-11-02 14:18 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm/lease: debug output for lease creation Patchwork
2018-11-02 14:36 ` ✓ Fi.CI.BAT: success " Patchwork
2018-11-02 15:02 ` [PATCH 1/3] " Keith Packard
2018-11-02 16:16 ` ✓ Fi.CI.IGT: success for series starting with [1/3] " Patchwork
2018-11-02 22:37 ` ✗ Fi.CI.BAT: failure for series starting with [1/3] drm/lease: debug output for lease creation (rev2) Patchwork
2018-11-05 10:26 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm/lease: debug output for lease creation (rev3) Patchwork
2018-11-05 10:43 ` ✓ Fi.CI.BAT: success " Patchwork
2018-11-05 11:57 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-11-06 8:46 ` ✓ Fi.CI.IGT: success " Patchwork
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=20181106172347.GT21967@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox