From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 03/12] drm/legacy: move map cleanups into drm_bufs.c
Date: Tue, 23 Apr 2019 12:00:32 +1000 [thread overview]
Message-ID: <20190423020041.32702-4-airlied@gmail.com> (raw)
In-Reply-To: <20190423020041.32702-1-airlied@gmail.com>
From: Dave Airlie <airlied@redhat.com>
This makes it easier to clean this up later.
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/drm_bufs.c | 8 ++++++++
drivers/gpu/drm/drm_drv.c | 5 +----
drivers/gpu/drm/drm_legacy.h | 1 +
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index e407adb033e7..bfc419ed9d6c 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -584,6 +584,14 @@ void drm_legacy_master_rmmaps(struct drm_device *dev, struct drm_master *master)
mutex_unlock(&dev->struct_mutex);
}
+void drm_legacy_rmmaps(struct drm_device *dev)
+{
+ struct drm_map_list *r_list, *list_temp;
+
+ list_for_each_entry_safe(r_list, list_temp, &dev->maplist, head)
+ drm_legacy_rmmap(dev, r_list->map);
+}
+
/* The rmmap ioctl appears to be unnecessary. All mappings are torn down on
* the last close of the device, and this is necessary for cleanup when things
* exit uncleanly. Therefore, having userland manually remove mappings seems
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 50d849d1bc6e..15b0fd5adaaf 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -1038,8 +1038,6 @@ EXPORT_SYMBOL(drm_dev_register);
*/
void drm_dev_unregister(struct drm_device *dev)
{
- struct drm_map_list *r_list, *list_temp;
-
if (drm_core_check_feature(dev, DRIVER_LEGACY))
drm_lastclose(dev);
@@ -1056,8 +1054,7 @@ void drm_dev_unregister(struct drm_device *dev)
if (dev->agp)
drm_pci_agp_destroy(dev);
- list_for_each_entry_safe(r_list, list_temp, &dev->maplist, head)
- drm_legacy_rmmap(dev, r_list->map);
+ drm_legacy_rmmaps(dev);
remove_compat_control_link(dev);
drm_minor_unregister(dev, DRM_MINOR_PRIMARY);
diff --git a/drivers/gpu/drm/drm_legacy.h b/drivers/gpu/drm/drm_legacy.h
index e6bf1a94374b..3dc626090fcb 100644
--- a/drivers/gpu/drm/drm_legacy.h
+++ b/drivers/gpu/drm/drm_legacy.h
@@ -83,6 +83,7 @@ int __drm_legacy_mapbufs(struct drm_device *, void *, int *,
void drm_legacy_master_rmmaps(struct drm_device *dev,
struct drm_master *master);
+void drm_legacy_rmmaps(struct drm_device *dev);
#ifdef CONFIG_DRM_VM
void drm_legacy_vma_flush(struct drm_device *d);
--
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-04-23 2:00 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-23 2:00 drm: make legacy support code optional Dave Airlie
2019-04-23 2:00 ` [PATCH 01/12] drm/nouveau: add kconfig option to turn off nouveau legacy contexts. (v2) Dave Airlie
2019-04-23 2:00 ` [PATCH 02/12] drm/legacy: move drm_legacy_master_rmmaps to non-driver legacy header Dave Airlie
2019-04-23 2:00 ` Dave Airlie [this message]
2019-04-23 2:00 ` [PATCH 04/12] drm/radeon: drop unused ati pcigart include Dave Airlie
2019-04-23 13:07 ` Christian König
2019-04-23 2:00 ` [PATCH 05/12] drm/legacy: move lock cleanup for master into lock file Dave Airlie
2019-04-23 18:44 ` Daniel Vetter
2019-04-23 2:00 ` [PATCH 06/12] drm/legacy: move map_hash create/destroy into inlines Dave Airlie
2019-04-23 18:45 ` Daniel Vetter
2019-04-23 18:58 ` Daniel Vetter
2019-04-23 19:48 ` Sam Ravnborg
2019-04-23 2:00 ` [PATCH 07/12] drm/legacy: move init/destroy of struct members " Dave Airlie
2019-04-23 18:46 ` Daniel Vetter
2019-04-23 19:52 ` Sam Ravnborg
2019-04-23 2:00 ` [PATCH 08/12] drm/legacy: move legacy dev reinit into an inline Dave Airlie
2019-04-23 18:47 ` Daniel Vetter
2019-04-23 19:55 ` Sam Ravnborg
2019-04-23 2:00 ` [PATCH 09/12] drm/legacy: don't include any of ati_pcigart in legacy Dave Airlie
2019-04-23 18:50 ` Daniel Vetter
2019-04-23 19:58 ` Sam Ravnborg
2019-04-23 2:00 ` [PATCH 10/12] drm: allow removal of legacy codepaths (v4) Dave Airlie
2019-04-23 18:53 ` Daniel Vetter
2019-04-23 2:00 ` [PATCH 11/12] drm/legacy: place all drm legacy members under DRM_LEGACY Dave Airlie
2019-04-23 18:55 ` Daniel Vetter
2019-04-23 2:00 ` [PATCH 12/12] drm/legacy: remove some legacy lock struct members Dave Airlie
2019-04-23 18:57 ` 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=20190423020041.32702-4-airlied@gmail.com \
--to=airlied@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox