dri-devel Archive on lore.kernel.org
 help / color / 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>
Subject: [PATCH] v2: Also add a DRIVER_* check like for all other maps functions to really short-circuit the code. And give drm_legacy_rmmap used by the dev unregister code the same treatment.
Date: Mon, 23 Nov 2015 10:33:03 +0100
Message-ID: <1448271183-20523-31-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1448271183-20523-1-git-send-email-daniel.vetter@ffwll.ch>

---
 drivers/gpu/drm/drm_bufs.c | 14 ++++++++++----
 include/drm/drm_legacy.h   |  2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index de18b8b78a26..5a51633da033 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -542,15 +542,17 @@ int drm_legacy_rmmap_locked(struct drm_device *dev, struct drm_local_map *map)
 }
 EXPORT_SYMBOL(drm_legacy_rmmap_locked);
 
-int drm_legacy_rmmap(struct drm_device *dev, struct drm_local_map *map)
+void drm_legacy_rmmap(struct drm_device *dev, struct drm_local_map *map)
 {
-	int ret;
+	if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
+	    drm_core_check_feature(dev, DRIVER_MODESET))
+		return;
 
 	mutex_lock(&dev->struct_mutex);
-	ret = drm_legacy_rmmap_locked(dev, map);
+	drm_legacy_rmmap_locked(dev, map);
 	mutex_unlock(&dev->struct_mutex);
 
-	return ret;
+	return;
 }
 EXPORT_SYMBOL(drm_legacy_rmmap);
 
@@ -558,6 +560,10 @@ void drm_legacy_master_rmmaps(struct drm_device *dev, struct drm_master *master)
 {
 	struct drm_map_list *r_list, *list_temp;
 
+	if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
+	    drm_core_check_feature(dev, DRIVER_MODESET))
+		return;
+
 	mutex_lock(&dev->struct_mutex);
 	list_for_each_entry_safe(r_list, list_temp, &dev->maplist, head) {
 		if (r_list->master == master) {
diff --git a/include/drm/drm_legacy.h b/include/drm/drm_legacy.h
index 24504b0eafea..a5ef2c7e40f8 100644
--- a/include/drm/drm_legacy.h
+++ b/include/drm/drm_legacy.h
@@ -154,7 +154,7 @@ struct drm_map_list {
 int drm_legacy_addmap(struct drm_device *d, resource_size_t offset,
 		      unsigned int size, enum drm_map_type type,
 		      enum drm_map_flags flags, struct drm_local_map **map_p);
-int drm_legacy_rmmap(struct drm_device *d, struct drm_local_map *map);
+void drm_legacy_rmmap(struct drm_device *d, struct drm_local_map *map);
 int drm_legacy_rmmap_locked(struct drm_device *d, struct drm_local_map *map);
 void drm_legacy_master_rmmaps(struct drm_device *dev,
 			      struct drm_master *master);
-- 
2.5.1

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

  parent reply index

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23  9:32 [PATCH 00/29] dev->struct_mutex crusade, once more Daniel Vetter
2015-11-23  9:32 ` [PATCH 01/29] drm/armada: Use unlocked gem unreferencing Daniel Vetter
2015-11-23  9:32 ` [PATCH 02/29] drm/nouveau: " Daniel Vetter
2015-11-23  9:32 ` [PATCH 03/29] drm/omapdrm: " Daniel Vetter
2015-11-23  9:32 ` [PATCH 04/29] drm/amdgpu: " Daniel Vetter
2015-11-23  9:56   ` Christian König
2015-11-23  9:32 ` [PATCH 05/29] drm/radeon: " Daniel Vetter
2015-11-23  9:32 ` [PATCH 06/29] drm/qxl: " Daniel Vetter
2015-11-23  9:32 ` [PATCH 07/29] drm/tegra: " Daniel Vetter
2015-11-23 10:00   ` Thierry Reding
2015-11-23  9:32 ` [PATCH 08/29] drm/msm: " Daniel Vetter
2015-11-23  9:32 ` [PATCH 09/29] drm/udl: " Daniel Vetter
2015-11-23  9:32 ` [PATCH 10/29] drm/armada: Plug leak in dumb_map_offset Daniel Vetter
2015-11-23  9:32 ` [PATCH 11/29] drm/armada: Don't grab dev->struct_mutex for in mmap offset ioctl Daniel Vetter
2015-11-23  9:32 ` [PATCH 12/29] drm/armada: Drop struct_mutex from cursor paths Daniel Vetter
2015-12-03 16:08   ` Russell King - ARM Linux
2015-12-04  7:51     ` Daniel Vetter
2015-11-23  9:32 ` [PATCH 13/29] drm/armada: Use a private mutex to protect priv->linear Daniel Vetter
2015-11-23 17:40   ` Russell King - ARM Linux
2015-11-23 20:17     ` Daniel Vetter
2015-11-24  9:00   ` [PATCH] " Daniel Vetter
2015-11-23  9:32 ` [PATCH 14/29] drm/tegra: don't take dev->struct_mutex in mmap offset ioctl Daniel Vetter
2015-11-23 10:00   ` Thierry Reding
2015-11-23  9:32 ` [PATCH 15/29] drm/tegra: Use drm_gem_object_unreference_unlocked Daniel Vetter
2015-11-23 10:01   ` Thierry Reding
2015-11-23  9:32 ` [PATCH 16/29] drm/gma500: Use correct unref in the gem bo create function Daniel Vetter
2015-11-23  9:32 ` [PATCH 17/29] drm/gma500: Drop dev->struct_mutex from modeset code Daniel Vetter
2015-11-23  9:32 ` [PATCH 18/29] drm/gma500: Drop dev->struct_mutex from fbdev init/teardown code Daniel Vetter
2015-11-23  9:32 ` [PATCH 19/29] drm/gma500: Drop dev->struct_mutex from mmap offset function Daniel Vetter
2015-11-23  9:32 ` [PATCH 20/29] drm/gma500: Add driver private mutex for the fault handler Daniel Vetter
2015-11-23  9:32 ` [PATCH 21/29] drm/nouveau: Drop dev->struct_mutex from fbdev init Daniel Vetter
2015-11-23  9:32 ` [PATCH 22/29] drm/exynos: Drop dev->struct_mutex from mmap offset function Daniel Vetter
2015-11-23 10:00   ` Daniel Stone
2015-11-23  9:32 ` [PATCH 23/29] drm/exynos: drop struct_mutex from exynos_gem_map_sgt_with_dma Daniel Vetter
2015-11-23 10:01   ` Daniel Stone
2015-11-23  9:32 ` [PATCH 24/29] drm/exynos: drop struct_mutex from exynos_drm_gem_get_ioctl Daniel Vetter
2015-11-23 10:00   ` Daniel Stone
2015-11-23  9:32 ` [PATCH 25/29] drm/exynos: drop struct_mutex from fbdev setup Daniel Vetter
2015-11-23  9:59   ` Daniel Stone
2015-11-23  9:32 ` [PATCH 26/29] drm/vgem: Simplify dum_map Daniel Vetter
2015-11-23  9:33 ` [PATCH 27/29] drm/vgem: Move get_pages to gem_create Daniel Vetter
2016-01-05 15:52   ` poma
2015-11-23  9:33 ` [PATCH 28/29] drm/vgem: Drop dev->struct_mutex Daniel Vetter
2015-11-23  9:33 ` [PATCH 29/29] drm/vma_manage: Drop has_offset Daniel Vetter
2015-11-23  9:33 ` Daniel Vetter [this message]
2015-11-23 10:15   ` [Intel-gfx] [PATCH] v2: Also add a DRIVER_* check like for all other maps functions to really short-circuit the code. And give drm_legacy_rmmap used by the dev unregister code the same treatment Jani Nikula
2015-11-23 10:13     ` Daniel Vetter
2015-12-07  8:14 ` [PATCH 00/29] dev->struct_mutex crusade, once more 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=1448271183-20523-31-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --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

dri-devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dri-devel/0 dri-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dri-devel dri-devel/ https://lore.kernel.org/dri-devel \
		dri-devel@lists.freedesktop.org
	public-inbox-index dri-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.freedesktop.lists.dri-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git