All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@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: [PATCH 4/7] drm: Enforce BKL-less ioctls for modern drivers
Date: Fri,  9 Dec 2016 15:19:41 +0100	[thread overview]
Message-ID: <20161209141944.22121-4-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20161209141944.22121-1-daniel.vetter@ffwll.ch>

With the last round of changes all ioctls called by modern drivers now
have their own locking. Everything else is only allowed for legacy
drivers and hence the lack of locking doesn't matter.

One exception is nouveau, due to the DRIVER_KMS_LEGACY_CONTEXT flag.
But that only works its magic on the context and bufs ioctls. And
drm_bufs.c is protected with dev->struct_mutex, and drm_context.c by
the same and dev->ctxlist_mutex. That should be all safe, and we can
finally mandata drm-bkl-less ioctls for everyone!

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_ioctl.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index e1b2c372f021..e21a18ac968e 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -735,9 +735,8 @@ long drm_ioctl(struct file *filp,
 	if (ksize > in_size)
 		memset(kdata + in_size, 0, ksize - in_size);
 
-	/* Enforce sane locking for modern driver ioctls. Core ioctls are
-	 * too messy still. */
-	if ((!drm_core_check_feature(dev, DRIVER_LEGACY) && is_driver_ioctl) ||
+	/* Enforce sane locking for modern driver ioctls. */
+	if (!drm_core_check_feature(dev, DRIVER_LEGACY) ||
 	    (ioctl->flags & DRM_UNLOCKED))
 		retcode = func(dev, kdata, file_priv);
 	else {
-- 
2.10.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-12-09 14:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-09 14:19 [PATCH 1/7] drm/hisilicon: Don't set drm_device->platformdev Daniel Vetter
2016-12-09 14:19 ` [PATCH 2/7] drm: Protect master->unique with dev->master_mutex Daniel Vetter
2016-12-09 14:54   ` Emil Velikov
2016-12-09 15:31     ` Daniel Vetter
2016-12-09 14:19 ` [PATCH 3/7] drm: setclientcap doesn't need the drm BKL Daniel Vetter
2016-12-09 14:19 ` Daniel Vetter [this message]
2016-12-09 14:19 ` [PATCH 5/7] drm: Don't compute obj counts expensively in get_resources Daniel Vetter
2016-12-09 21:47   ` Chris Wilson
2016-12-09 22:25     ` Daniel Vetter
2016-12-09 14:19 ` [PATCH 6/7] drm: Don't walk fb list twice in getresources Daniel Vetter
2016-12-09 21:57   ` Chris Wilson
2016-12-10 21:30     ` [Intel-gfx] " Daniel Vetter
2016-12-09 14:19 ` [PATCH 7/7] drm: Resurrect atomic rmfb code Daniel Vetter
2016-12-09 20:59   ` Daniel Vetter
2016-12-12  8:46     ` Maarten Lankhorst
2016-12-12  9:23       ` Daniel Vetter
2016-12-09 15:27 ` ✗ Fi.CI.BAT: failure for series starting with [1/7] drm/hisilicon: Don't set drm_device->platformdev Patchwork
2016-12-09 20:59   ` Daniel Vetter
2016-12-09 18:04 ` [PATCH 1/7] " Sean Paul
2016-12-13  9:20   ` Daniel Vetter

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=20161209141944.22121-4-daniel.vetter@ffwll.ch \
    --to=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 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.