Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08269364 authored by Daniel Vetter's avatar Daniel Vetter
Browse files

Merge branch 'drm-legacy-cleanup' of git://people.freedesktop.org/~airlied/linux into drm-next

parents abbc0697 ee22f763
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -255,6 +255,9 @@ config DRM_VKMS

	  If M is selected the module will be called vkms.

config DRM_ATI_PCIGART
        bool

source "drivers/gpu/drm/exynos/Kconfig"

source "drivers/gpu/drm/rockchip/Kconfig"
@@ -347,6 +350,7 @@ menuconfig DRM_LEGACY
	bool "Enable legacy drivers (DANGEROUS)"
	depends on DRM && MMU
	select DRM_VM
	select DRM_ATI_PCIGART if PCI
	help
	  Enable legacy DRI1 drivers. Those drivers expose unsafe and dangerous
	  APIs to user-space, which can be used to circumvent access
+4 −5
Original line number Diff line number Diff line
@@ -3,11 +3,9 @@
# Makefile for the drm device driver.  This driver provides support for the
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.

drm-y       :=	drm_auth.o drm_bufs.o drm_cache.o \
		drm_context.o drm_dma.o \
drm-y       :=	drm_auth.o drm_cache.o \
		drm_file.o drm_gem.o drm_ioctl.o drm_irq.o \
		drm_lock.o drm_memory.o drm_drv.o \
		drm_scatter.o drm_pci.o \
		drm_memory.o drm_drv.o drm_pci.o \
		drm_sysfs.o drm_hashtab.o drm_mm.o \
		drm_crtc.o drm_fourcc.o drm_modes.o drm_edid.o \
		drm_encoder_slave.o \
@@ -21,12 +19,13 @@ drm-y := drm_auth.o drm_bufs.o drm_cache.o \
		drm_syncobj.o drm_lease.o drm_writeback.o drm_client.o \
		drm_atomic_uapi.o

drm-$(CONFIG_DRM_LEGACY) += drm_legacy_misc.o drm_bufs.o drm_context.o drm_dma.o drm_scatter.o drm_lock.o
drm-$(CONFIG_DRM_LIB_RANDOM) += lib/drm_random.o
drm-$(CONFIG_DRM_VM) += drm_vm.o
drm-$(CONFIG_COMPAT) += drm_ioc32.o
drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o
drm-$(CONFIG_DRM_GEM_SHMEM_HELPER) += drm_gem_shmem_helper.o
drm-$(CONFIG_PCI) += ati_pcigart.o
drm-$(CONFIG_DRM_ATI_PCIGART) += ati_pcigart.o
drm-$(CONFIG_DRM_PANEL) += drm_panel.o
drm-$(CONFIG_OF) += drm_of.o
drm-$(CONFIG_AGP) += drm_agpsupport.o
+2 −17
Original line number Diff line number Diff line
@@ -103,8 +103,7 @@ struct drm_master *drm_master_create(struct drm_device *dev)
		return NULL;

	kref_init(&master->refcount);
	spin_lock_init(&master->lock.spinlock);
	init_waitqueue_head(&master->lock.lock_queue);
	drm_master_legacy_init(master);
	idr_init(&master->magic_map);
	master->dev = dev;

@@ -274,21 +273,7 @@ void drm_master_release(struct drm_file *file_priv)
	if (!drm_is_current_master(file_priv))
		goto out;

	if (drm_core_check_feature(dev, DRIVER_LEGACY)) {
		/*
		 * Since the master is disappearing, so is the
		 * possibility to lock.
		 */
		mutex_lock(&dev->struct_mutex);
		if (master->lock.hw_lock) {
			if (dev->sigdata.lock == master->lock.hw_lock)
				dev->sigdata.lock = NULL;
			master->lock.hw_lock = NULL;
			master->lock.file_priv = NULL;
			wake_up_interruptible_all(&master->lock.lock_queue);
		}
		mutex_unlock(&dev->struct_mutex);
	}
	drm_legacy_lock_master_cleanup(dev, master);

	if (dev->master == file_priv->master)
		drm_drop_master(dev, file_priv);
+8 −0
Original line number Diff line number Diff line
@@ -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
+7 −14
Original line number Diff line number Diff line
@@ -659,20 +659,16 @@ int drm_dev_init(struct drm_device *dev,
	/* no per-device feature limits by default */
	dev->driver_features = ~0u;

	drm_legacy_init_members(dev);
	INIT_LIST_HEAD(&dev->filelist);
	INIT_LIST_HEAD(&dev->filelist_internal);
	INIT_LIST_HEAD(&dev->clientlist);
	INIT_LIST_HEAD(&dev->ctxlist);
	INIT_LIST_HEAD(&dev->vmalist);
	INIT_LIST_HEAD(&dev->maplist);
	INIT_LIST_HEAD(&dev->vblank_event_list);

	spin_lock_init(&dev->buf_lock);
	spin_lock_init(&dev->event_lock);
	mutex_init(&dev->struct_mutex);
	mutex_init(&dev->filelist_mutex);
	mutex_init(&dev->clientlist_mutex);
	mutex_init(&dev->ctxlist_mutex);
	mutex_init(&dev->master_mutex);

	dev->anon_inode = drm_fs_inode_new();
@@ -692,7 +688,7 @@ int drm_dev_init(struct drm_device *dev,
	if (ret)
		goto err_minors;

	ret = drm_ht_create(&dev->map_hash, 12);
	ret = drm_legacy_create_map_hash(dev);
	if (ret)
		goto err_minors;

@@ -717,7 +713,7 @@ int drm_dev_init(struct drm_device *dev,
		drm_gem_destroy(dev);
err_ctxbitmap:
	drm_legacy_ctxbitmap_cleanup(dev);
	drm_ht_remove(&dev->map_hash);
	drm_legacy_remove_map_hash(dev);
err_minors:
	drm_minor_free(dev, DRM_MINOR_PRIMARY);
	drm_minor_free(dev, DRM_MINOR_RENDER);
@@ -725,10 +721,10 @@ int drm_dev_init(struct drm_device *dev,
err_free:
	put_device(dev->dev);
	mutex_destroy(&dev->master_mutex);
	mutex_destroy(&dev->ctxlist_mutex);
	mutex_destroy(&dev->clientlist_mutex);
	mutex_destroy(&dev->filelist_mutex);
	mutex_destroy(&dev->struct_mutex);
	drm_legacy_destroy_members(dev);
	return ret;
}
EXPORT_SYMBOL(drm_dev_init);
@@ -792,7 +788,7 @@ void drm_dev_fini(struct drm_device *dev)
		drm_gem_destroy(dev);

	drm_legacy_ctxbitmap_cleanup(dev);
	drm_ht_remove(&dev->map_hash);
	drm_legacy_remove_map_hash(dev);
	drm_fs_inode_free(dev->anon_inode);

	drm_minor_free(dev, DRM_MINOR_PRIMARY);
@@ -801,10 +797,10 @@ void drm_dev_fini(struct drm_device *dev)
	put_device(dev->dev);

	mutex_destroy(&dev->master_mutex);
	mutex_destroy(&dev->ctxlist_mutex);
	mutex_destroy(&dev->clientlist_mutex);
	mutex_destroy(&dev->filelist_mutex);
	mutex_destroy(&dev->struct_mutex);
	drm_legacy_destroy_members(dev);
	kfree(dev->unique);
}
EXPORT_SYMBOL(drm_dev_fini);
@@ -1038,8 +1034,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 +1050,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);
Loading